Observation Planning
| Function | Description |
|---|---|
night_observability(facility, ra, dec, date) | One night's LST, hour angle, altitude, azimuth, delay and Moon constraints; ra, dec in decimal degrees |
best_pop(facility, dec, ha, config) | The POP configurations with the most usable time |
print_pop_results(facility, config, results) | Print best_pop results |
pop_plan(facility, dec, ha, config; observable, reference, max_changes, max_drop, change_minutes) | A night's sequence of POP settings and dropped telescopes, ranked by time with every telescope, then with fewer, then fewest changes |
pop_plans(facility, dec, ha, config; …) | The best pop_plan for each number of changes, from one search |
print_pop_plan(facility, plan) | Print a pop_plan result |
pop_plan_targets(facility, targets, lst, config; observable, calibrators, bracket_minutes, max_changes, change_minutes) | One sequence of POP settings shared by a list of targets, scored by the fraction of each science target's night observed with one of its calibrators within reach |
pop_plans_targets(facility, targets, lst, config; …) | The best pop_plan_targets for each number of changes, from one search |
target_pop_plan(plan, j, ra, config) | One target's part of a shared plan, as a PopPlan |
print_pop_plan(facility, plan, targets) | Print a pop_plan_targets result |
unwrap_hour_angles(ha) | A night's hour angles made continuous through ±12 h |
obs_plan(target, facility, ra, dec, date, pop, config) | Gantt chart of the night (needs PythonPlot) |
chara_plan(target, facility, ra, dec, date, pop, config) | Delay plot in the style of CHARA's planner (needs PythonPlot) |
compute_delays(facility, dec, ha, config, pop) | Compute OPD delays for a given config/POP. config: 0=unused, 1=use, 2=reference cart; pop: one entry per telescope in 1:5 |
in_delay(facility, dec, ha, config, pop) | Check which baselines are within delay limits (same argument order as compute_delays) |
delay_ha_intervals(facility, dec, config, pop) | The hour-angle intervals where every baseline is within its delay limits, solved analytically |
horizon_limit(facility, az; config) | Lowest elevation the telescopes in use can see at that azimuth, from the facility's horizon profiles |
night_window(date, lat, lon; zenith) | The dark window bracketing local midnight. zenith picks the twilight: 96 civil, 102 nautical, 108 astronomical |
observable_epochs(facility, target, dates; min_elevation, pops) | The epochs within elevation and, with pops, delay limits; also through simulate(…; observability) |
index_runs(idx) | Consecutive runs in a sorted index vector, as (first, last) pairs |
moon_illumination(jd) | Fractional lunar illumination for a Julian Date |
moon_radec(jd) | Approximate lunar RA/Dec for a Julian Date |
angular_separation(ra1, dec1, ra2, dec2) | Angular separation in degrees |
OITOOLS.night_observability — Function
night_observability(facility, ra, dec, obsdate; alt_limit=30.0, alt_max=90.0,
moon_min_sep=30.0, dark_offset=0.0, step_minutes=1, ut_window=nothing)Compute the observability grid for a target on a given night. Internally uses Float32 for LST, HA, alt, az arrays.
Returns a NamedTuple with fields:
utc: UTC hours vector (Float64)lst: local sidereal time, hours (Float32)ha: hour angle, hours (Float32)alt: altitude, degrees (Float32)az: azimuth, degrees (Float32)lst_midnight: LST at local midnight (Float64)horizon: the lowest usable elevation at each sample, degrees: the larger ofalt_limitand the horizon profile of the telescopesconfigselectsgood_alt: indices wherehorizon < alt < alt_maxgood_riseset: indices wherealt_limit < alt < alt_max(ASPRO's Rise/Set)good_horizon: indices where the target is above the horizon profile (ASPRO's Horizon); every index when the facility has no profilehas_horizon: whether the facility has horizon profilesmoon_sep: Moon–target separation, degrees (Float32)moon_fli: fractional lunar illumination (Float64, single value for the night)good_moon: indices wheremoon_sep > moon_min_sep
Arguments:
facility: FacilityConfig (provides lat, lon)ra: right ascension in degreesdec: declination in degreesobsdate: DateTime of the observing eveningalt_limit: minimum elevation in degrees (default 30)alt_max: maximum safe elevation in degrees (default 90, e.g. 80 for CHARA)moon_min_sep: minimum Moon separation in degrees (default 30)dark_offset: hours after sunset / before sunrise for deeper twilight (default 0)step_minutes: time resolution in minutes (default 1)ut_window:(from, to)in UT hours, the part of the night used (a half night, say);good_twilightkeeps only those hours.from > toruns through 0 h UT;NaNis the start or the end of the night.
OITOOLS.best_pop — Function
best_pop(facility, dec, ha, config; n_best=5, min_minutes=10, delay_length=nothing)Search over all POP combinations.
Returns a vector of NamedTuples (pop, score) sorted by score (minutes observable), keeping up to n_best results with score ≥ min_minutes. The score is the length of the hour-angle intervals where every baseline is within its delay limits (delay_ha_intervals), within the span of ha.
Arguments:
config: telescope configuration (0/1/2); only telescopes with config>0 are usedn_best: number of top solutions to returnmin_minutes: discard solutions below this thresholddelay_length: override per-telescope delay limits with a uniform value (m)beam_order: the order the telescopes feed the combiner's channels, which selects each one's beam sampling table entry; without one the facility's own order is used
OITOOLS.print_pop_results — Function
print_pop_results(facility, config, results)Pretty-print the output of best_pop.
OITOOLS.pop_plan — Function
pop_plan(facility, dec, ha, config; observable = trues(length(ha)), reference = 0,
max_changes = 2, max_drop = 0, change_minutes = 10, min_minutes = 10,
min_stretch = 0, pop_minutes = 0, cart_speed = Inf, delay_length = nothing,
pop_array = nothing, airpath = nothing) -> PopPlanThe sequence of POP settings, and of telescopes dropped from config, that observes a target longest over the hour angles ha where observable is true.
Plans are ranked by the minutes observed with every selected telescope, then with one dropped that is not the reference, then with the reference dropped, then the same with two dropped, then by the fewest POP changes, and last by the fewest POPs moved over all the changes. Each comparison only breaks ties in the previous one, so time with the full array is never given up for time with fewer telescopes.
reference: the telescope protected from being dropped while another drop gains the same time; by default the telescopeconfigmarks 2, if any. A telescope marked 2 is also the delay reference, as inin_delay: a minute is then constrained by the baselines to it, and a segment that drops it has another kept telescope as its delay reference (marked 2 in the segment'sconfig).max_changes: POP changes allowed;0is the single settingbest_popfinds.max_drop: telescopes that may be dropped at once (0, 1 or 2).change_minutes: the time a POP change takes, during which nothing is observed. Dropping or re-adding a telescope moves no POP and costs nothing.min_minutes: POP settings observable for less than this are not considered.pop_minutes,cart_speed: a change then takes the longer ofchange_minutes + pop_minutes ×the POPs it moves and the time the delay carts take to reach their new positions atcart_speedm/s (half the change of each baseline's POP offsets, the delay reference's cart held; with none, the carts centred on their mean move), rounded up to the minute. The default,0andInf, ischange_minutesfor every change. A search with them is slower: the change times are between every two states.min_stretch: minutes a POP setting is held at least, from the end of the change that sets it to the start of the next (the last to the end of the night); a telescope dropped or added back for fewer observed minutes takes its neighbour's telescopes instead when they are in delay then, and is not observed otherwise.
ha is the night's grid in time order. It is taken as continuous (unwrap_hour_angles), so a night through ±12 h gives segments with hour angles beyond 12 in magnitude, on the branch of the night's first sample.
The search runs on a 1-minute grid over the observable span. The delay offsets are those of the whole selection: a dropped telescope's beam keeps its channel. pop_plans gives the best plan for each number of changes from the same search.
OITOOLS.pop_plans — Function
pop_plans(facility, dec, ha, config; kwargs...) -> Vector{PopPlan}The best plan with at most 0, 1, …, max_changes POP changes, in that order, from one search; the keywords are pop_plan's, whose result is the last of these.
OITOOLS.PopPlan — Type
PopPlanThe result of pop_plan: segments in time order, minutes observed in each of the five tiers (see PopSegment), and the number of POP changes.
OITOOLS.PopSegment — Type
PopSegmentOne stretch of a PopPlan: hour angles ha0–ha1 (hours, on the plan's 1-minute grid), the telescopes used (config, 0/1/2 as everywhere, full length) and the POPs (pop, full length; a dropped telescope keeps the POP it is parked on). tier is 1 with every selected telescope, 2 with one dropped that is not the reference, 3 with the reference dropped, 4 and 5 the same with two dropped.
OITOOLS.print_pop_plan — Function
print_pop_plan(facility, plan)Pretty-print a PopPlan: one line per segment, then the minutes per tier.
print_pop_plan(facility, plan::TargetsPopPlan, targets)Pretty-print a TargetsPopPlan: one line per segment, then each target's minutes.
OITOOLS.pop_plan_targets — Function
pop_plan_targets(facility, targets, lst, config; observable, calibrators = [],
bracket_minutes = 30, max_changes = 2, change_minutes = 10,
min_minutes = 10, min_stretch = 0, delay_length = nothing, pop_array = nothing,
airpath = nothing) -> TargetsPopPlanOne sequence of POP settings for the night, shared by every target of targets (each with ra, dec in degrees and cal, true for a calibrator), that observes the list best.
lst is the night's local sidereal times in hours, in time order, and observable[i, j] is true when target j is up at lst[i] (sky only, no delay). config marks the telescopes used (0/1/2) as in pop_plan; a telescope marked 2 is the delay reference, and a minute is then constrained by the baselines to it.
A target is observed at a minute when it is up and every baseline is in delay for it under the setting in force. The score of a plan is the sum, over the science targets (cal false), of the fraction of each one's time up that is observed, so a target up for a short while counts as much as one up all night; ties go to the fewest changes.
calibrators[j]: the indices of science targetj's calibrators (empty, or an empty list, for none). A minute of a science target with calibrators counts only when one of them is observed under the same setting withinbracket_minutesof it, the setting taken as held over that time. A calibrator up at no minute of the night, or in delay under no setting at any minute it is up, is ignored (listed inignored); a science target whose calibrators are all ignored is scored alone.- With no science target in the list, the calibrators are scored as science, alone.
max_changes,change_minutes,min_minutes,min_stretchand the delay keywords as inpop_plan; a setting is considered when it observes the scored targets formin_minutesin all.
pop_plans_targets gives the best plan for each number of changes from the same search; target_pop_plan turns a plan into one target's PopPlan.
OITOOLS.pop_plans_targets — Function
pop_plans_targets(facility, targets, lst, config; kwargs...) -> Vector{TargetsPopPlan}The best shared plan with at most 0, 1, …, max_changes POP changes, in that order, from one search; the keywords are pop_plan_targets's, whose result is the last of these.
OITOOLS.TargetsPopPlan — Type
TargetsPopPlanThe result of pop_plan_targets: segments in time order; lst, the plan's 1-minute grid; observed[t, j], target j observed at minute t under the plan (a science target with a calibrator of its own within reach, see pop_plan_targets); minutes, the count of each column; the number of POP changes; score, the sum over the scored targets of the fraction of their sky time observed; ignored, the calibrators left out.
OITOOLS.SharedSegment — Type
SharedSegmentOne stretch of a TargetsPopPlan: local sidereal times lst0–lst1 (hours, on the plan's 1-minute grid, continuous through 24 h) under the POPs pop (full length).
OITOOLS.target_pop_plan — Function
target_pop_plan(plan, j, ra, config; ha_start = nothing) -> PopPlanTarget j's part of a TargetsPopPlan as a PopPlan for the Observing panel's night_plan: a segment per stretch the target is observed under one setting, in hour angle (ra in degrees), with every telescope of config and tier 1. The hour angles are continuous from ha_start (the night's first, as unwrap_hour_angles gives it), by default from the plan's first minute wrapped to [-12, 12).
OITOOLS.unwrap_hour_angles — Function
unwrap_hour_angles(ha) -> Vector{Float64}Hour angles in time order made continuous: 24 h added or taken off wherever consecutive samples jump by more than 12 h, the first sample in [-12, 12). In the input's floating-point type.
OITOOLS.obs_plan — Function
obs_plan(targetname, facility, ra, dec, obsdate, pop, config;
alt_limit=30.0, alt_max=90.0, delay_length=nothing,
dark_offset=0.0, step_minutes=1, figsize=(10,5), savefile="")Produce a Gantt-style observability plot for one target on one night, showing dark time, altitude window, and delay feasibility.
Pass delay_length=43.0 for a conservative delay estimate. Pass savefile="path.png" to save to file and close the figure.
OITOOLS.chara_plan — Function
chara_plan(targetname, facility, ra, dec, obsdate, pop, config;
alt_limit=30.0, alt_max=90.0, delay_length=nothing,
dark_offset=0.0, step_minutes=1)Produce a delay-vs-LST plot with altitude overlay, similar to the classic chara_plan software from GSU.
Each baseline's delay cart position is plotted vs LST, with the altitude curve and elevation limit overlaid.
Pass delay_length=43.0 for a conservative delay estimate.
OITOOLS.compute_delays — Function
compute_delays(facility, dec, ha, config, pop; pop_array=CHARA_POP_ARRAY, airpath=CHARA_AIRPATH)Compute delay cart positions for all baselines over a time grid.
Returns (delay_carts, nbaselines, baseline_names, baseline_stations) where delay_carts is nbaselines × length(ha).
Arguments:
facility: FacilityConfigdec: declination in degreesha: hour angle vector (hours)config: telescope configuration vector (0=unused, 1=use, 2=reference)pop: POP assignment vector (one per telescope)
OITOOLS.in_delay — Function
in_delay(facility, dec, ha, config, pop; delay_length=nothing, kwargs...)Determine when the target is within delay-line limits for all baselines.
Returns a NamedTuple with:
delay_carts: delay cart positions (nbaselines × ntimes)has_delay: BitVector, true where all baselines are within limitsgood_delay: indices into the time grid where observing is feasiblenbaselines,baseline_names,baseline_stations
The per-telescope delay limits come from facility.delay_lengths. Pass delay_length=43.0 to override with a uniform (conservative) value.
OITOOLS.delay_ha_intervals — Function
delay_ha_intervals(facility, dec, config, pop; kwargs...) -> Vector{Tuple{Float64,Float64}}Hour-angle intervals, in hours, where every baseline is within its delay limits, with the edges solved analytically. The delay of a baseline is a sinusoid in hour angle,
w(h) = A cos h + B sin h + C, A = cosδ (cos l b₃ − sin l b₁)
B = −cosδ b₂
C = sinδ (cos l b₁ + sin l b₃)so w(h) = W inverts in closed form: with R = √(A²+B²) and φ = atan(B, A) it is R cos(h − φ) = W − C, with zero, one or two roots. Each baseline gives at most four critical hour angles, and the midpoint of each sub-interval is tested, as in ASPRO 2's DelayLineService.findHAIntervalsForBaseLine.
OITOOLS.horizon_limit — Function
horizon_limit(facility, az; config = Int[]) -> Float64Minimum elevation, degrees, at azimuth az, for the telescopes config selects.
The maximum over the horizon profiles of the telescopes in use. -Inf when the facility has no horizon profiles. (At Mount Wilson the profiles range from 18° in the south to 48° in the north-west.)
OITOOLS.night_window — Function
night_window(obsdate, lat, lon; zenith = 102.0) -> (t_set, t_rise)The dark window of the night that begins on obsdate, as UTC DateTimes: the sunset and sunrise bracketing the local midnight after obsdate's evening, at any longitude.
zenith is the Sun's zenith angle defining the boundary: 90°50′ for geometric sunrise/sunset, 96 civil, 102 nautical, 108 astronomical.
OITOOLS.moon_illumination — Function
moon_illumination(jd)Fractional lunar illumination (0–1) for a given Julian Date.
OITOOLS.moon_radec — Function
moon_radec(jd)Low-precision Moon RA/Dec (degrees) for a given Julian Date. Accuracy ~1° in position — sufficient for separation checks.
OITOOLS.angular_separation — Function
angular_separation(ra1, dec1, ra2, dec2)Angular separation in degrees between two positions (all in degrees).
OITOOLS.index_runs — Function
index_runs(idx) -> Vector{Tuple{Int,Int}}Split an index vector into maximal runs of consecutive integers, as (first, last) pairs; used to draw observability windows with gaps.
Simulation
| Function | Description |
|---|---|
simulate(facility, target, combiner, wave, dates, outfile) | Simulate observations from array geometry |
simulate_from_oifits(infile, outfile) | Simulate using UV coverage of an existing OIFITS file |
wave_from_image(file_or_model) | The spectral setup a cube defines (one channel per plane), for simulate(…, :image, …) |
get_uv(l, h, λ, δ, baselines) | UV coordinates from latitude l (rad), hour angles h (rad, row vector), wavelengths λ (m), declination δ (rad) and a 3×n baseline matrix (m). Returns (nuv, uv, u_M, v_M, w_M); uv is in cycles/rad |
read_facility_file(file) | Read facility configuration (TOML) |
read_obs_file(file) | Read target configuration (TOML) |
read_comb_file(file) | Read combiner configuration (TOML) |
read_wave_file(file) | Read wavelength configuration (TOML) |
list_configs([dir]) | Enumerate available facility / combiner / wavelength / target configs, classified by content, plus the wavelength→combiner map |
predict_errors(facility, combiner, wavelength; mag, visamp, elevation_deg) | Predicted per-channel σ(V²), σ(CP), σ(visamp), σ(visphi), Strehl, DIT and photon counts, without simulating |
strehl_ratio(λ, D, seeing, t0, mag_ao, ao) | AO Strehl ratio (port of JMMC Band.strehl) |
coupling_efficiency(λ, D, seeing, t0, mag_ao, ao) | Strehl, or seeing-limited coupling when ao === nothing |
fried_parameter(seeing, λ; elevation_deg) | Fried parameter r₀ at a wavelength and airmass |
seeing_from_r0(r0) | Seeing in arcsec from a Fried parameter |
atm_transmission(λ) | Atmospheric transmission hook (1.0 by default) |
band_for_wavelength(λ) / band_by_name(name) | Photometric band lookup |
zero_point_flux(λ) | Zero-magnitude photon flux, ph/s/m²/µm |
airmass(alt_deg) | Plane-parallel airmass from altitude |
datetime_to_jd(dt) / datetime_to_mjd(dt) | Julian and Modified Julian Date |
gantt_onenight(targetname, obsdate, lst, lst_midnight, az, alt, good_alt, good_delay; good_twilight, figsize, savefile, show_alt) | Gantt chart from night_observability output, as drawn by obs_plan (needs PythonPlot) |
sunrise_sunset(obsdate, latitude, longitude; zenith=102.0) | Rise/set times in decimal UT hours. zenith in degrees: 90°50′ sunrise/sunset, 96° civil, 102° nautical (default), 108° astronomical twilight |
alt_az(dec_deg, lat_deg, ha_hours) | Altitude and azimuth in degrees; arguments declination, latitude (degrees), hour angle (hours) |
opd_limits(base, alt, az) | Projected optical path of a baseline vector; alt, az in radians (alt_az returns degrees) |
| Type | Description |
|---|---|
FacilityConfig | Array facility configuration (telescopes, positions, atmosphere) |
TargetConfig | Target configuration (coordinates, proper motion) |
CombinerConfig | Beam combiner configuration (throughput, noise, calibration) |
WaveConfig | Wavelength/spectral configuration |
OITOOLS.simulate — Function
simulate(facility, target, combiner, wavelength, dates, out_file; image | flat_model, ...)Simulate an observation of a sky with facility and combiner at the wavelength channels on dates, and write it to out_file (OIFITS).
The sky is image or flat_model with flat_params:
imagea FITS path: read byread_model_image— East-first, its pixel scale, its wavelength and time axes from the keywords, so a 2-D image, a 3-D wavelength cube, a 3-D time series and a 4-D cube are all observed as what they are: each uv point with the plane of its channel and its date.pixsize(mas) overrides the header's scale. A cube's planes may differ in flux; that spectrum weights each channel's photon count. A file whose third axis says nothing (no CTYPE3) is refused: set its keywords in Tools › FITS Image Handling, or withfits_set_keywords.imagean array: 2-D grey, or 3-D with one plane per channel in order;pixsize(default 0.1 mas) is its scale.dft = truetransforms an array by DFT instead of NFFT.flat_model: a compiled model (image components included) atflat_params.
noise: true the photon-noise model of the combiner (with systematics, debias), false none (the error bars still filled in), or a FractionalNoise for fixed relative errors.
wavelength is a WaveConfig (see read_wave_file), or :image for the cube's own channels (wave_from_image): one per plane of the image, or of the model's image cube, so the two match plane for plane. The combiner still sets the throughput and the noise.
category is written to OI_TARGET's CATEGORY: "SCI" for a science target, "CAL" for a calibrator.
OITOOLS.FractionalNoise — Type
FractionalNoise(; v2 = 0.01, visamp = 0.01, t3amp = 0.01, visphi = 0.5, t3phi = 1.0,
flux = 0.01, floor_v2 = 0.01, floor_visamp = 0.02, floor_t3amp = 0.05,
floor_flux = 0.01)Fixed error bars for simulate's noise, as PMOIRED's oifake sets them: V², |V|, T3 amplitude and flux a fraction of the value, floored (v2 · max(V², floor_v2), …), the phases (differential and closure) in degrees. Each observable gets an independent Gaussian draw with its error bar; no photon model, no calibration systematics. The defaults are PMOIRED's ("typical for GRAVITY, good SNR").
OITOOLS.simulate_from_oifits — Function
simulate_from_oifits(in_oifits, out_file; mode, image | flat_model, ...)Re-observe a sky through an existing file's uv coverage, and write the result as a copy of that file with new data in it.
The observables of another source on the uv points, wavelengths, flags and headers of an input file, so the result compares point by point with the input.
mode decides the error bars:
"copy_errors"— the input's, unchanged. The absolute noise level is preserved."copy_snr"— the input's signal-to-noise, applied to the new observables (for a source much brighter or fainter than the original)."noise_model"—errors.v2_multit/v2_additand the T3 equivalents.
The sky is image or flat_model with flat_params. A FITS path is read by read_model_image, as in simulate: East-first, its scale (pixsize, mas, overrides it), and every uv point of the input with the plane of its wavelength and date — a 2-D image, a wavelength cube, a time series or a 4-D cube alike. An array is 2-D grey, or 3-D with one plane per channel of the input in increasing wavelength, at pixsize (default 0.1 mas). Each plane is normalised by its own flux; no spectrum is written.
noise = false writes the noiseless observables with the error bars filled in. out_file cannot be in_oifits.
OITOOLS.wave_from_image — Function
wave_from_image(src) -> WaveConfigThe spectral setup a cube defines: one channel per wavelength plane, at its wavelength, with its EFF_BAND as the width when the file gives one, else the spacing to the neighbouring planes. src is a FITS path (read by read_model_image) or a compiled model, whose image components' cubes are used — several must agree. A setup taken from the cube matches it plane for plane, which is what simulate(…, :image, …) uses to observe a cube on its own channels.
OITOOLS.observable_epochs — Function
observable_epochs(facility, target, dates; min_elevation=nothing, max_elevation=nothing,
pops=nothing, config=Int[], delay_length=nothing)The epochs in dates at which target is observable from facility. Each constraint is off unless its keyword is given; simulate calls this only with observability.
min_elevation,max_elevation: degrees.nothing(default) applies no elevation cut.pops: a POP configuration, one entry per telescope, values in1:5.nothing(default): no delay-line check.best_popproposes configurations.config: telescope-use flags for the delay check (1use,0skip,2reference cart); defaults to using every telescope, i.e. allntel*(ntel-1)/2baselines must fit.delay_length: override the per-telescope delay-line lengths with one uniform value (m).
target.raep0 / target.decep0 are in degrees.
Returns (dates, mask, report):
dates: the surviving epochs, in input ordermask::BitVector: true where the epoch survivedreport:(n_in, n_out, n_dropped_elevation, n_dropped_delay, elevation), whereelevationis the altitude in degrees at every input epoch.
dates_ok, mask, rep = observable_epochs(facility, target, dates;
min_elevation = 30.0,
pops = [1,3,5,2,4,1])
simulate(facility, target, combiner, wavelength, dates_ok, "sim.oifits"; flat_model=m)OITOOLS.AOConfig — Type
AOConfigAdaptive-optics parameters for a facility's telescopes, consumed by strehl_ratio.
Defaults are ASPRO 2's AO_CHARA setup as of the CHARA 2026A configuration.
band: wavefront-sensor band. "V" is special-cased to a 0.5 um reference wavelength.n_subpupils: subapertures, sets the WFS photon collecting area.n_actuators: corrected modes, sets the fitting error. Falls back ton_subpupilsif 0.dit: WFS integration time [s].ron: WFS detector read noise [e-].qe: WFS quantum efficiency.transmission: fraction of starlight diverted to the WFS, i.e. lost to the science channel. 0 means the WFS is fed by a separate path.mag_offset: added to the guide-star magnitude before computing WFS flux.strehl_max: Strehl ceiling. 0 does not mean "uncapped" — it selects the per-band default fromPHOTOMETRIC_BANDS, matching ASPRO.
OITOOLS.CombinerConfig — Type
CombinerConfigBeam-combiner properties. The fields correspond to ASPRO 2's FocalInstrumentSetup (aspro-conf, e.g. CHARA.xml).
transmission: transmission of the array and instrument, excluding quantum efficiency, Strehl and atmosphere (ASPROtransmission, divided by the band-mean atmospheric transmission; see Simulating observations).FacilityConfig.throughputis then 1.0.instrument_visibility: instrumental contrast (ASPROinstrumentVisibility).dit: detector integration time in seconds, shortened when the detector would saturate (ASPROdit).total_int_time: total on-source time per uv point, seconds (ASPROdefaultTotalIntegrationTime).detector_saturation: full-well in electrons per pixel (ASPROdetectorSaturation).flux_frac_fringes/flux_frac_photometry: how the light splits between the interferometric and photometric channels (ASPROfracFluxIn…).vis_cal_err: systematic error on|V|, as a fraction (ASPROinstrumentVisibilityBias, in percent:1is0.01). The systematic onV²is twice this.phase_cal_err: systematic error on phases and closure phases, in degrees (ASPROinstrumentPhaseBias).
OITOOLS.strehl_ratio — Function
strehl_ratio(λ, D, seeing, t0, mag_ao, ao::AOConfig; elevation_deg=90.0)Strehl ratio at wavelength λ (metres) for a telescope of diameter D (metres), given seeing (arcsec at 500 nm), atmospheric coherence time t0 (seconds), and adaptive optics guiding on a star of magnitude mag_ao in the WFS band.
Port of jmal's Band.strehl. Five variance terms are summed and the result is the sum of a diffraction-limited core and a seeing-limited halo:
S = exp(-σ²) + (1 - exp(-σ²)) / (1 + (D/r0_λ)²)On faint guide stars (σ² → ∞) the Strehl tends to 1/(1 + (D/r0_λ)²). Reproduces ASPRO's CHARA curves to a median 0.7% (worst case 3.1% in H/K). The servo term uses t0 unscaled (not shifted to the science wavelength nor corrected for airmass), and the subaperture pitch is sqrt(π(D/2)²/n_actuators).
OITOOLS.coupling_efficiency — Function
coupling_efficiency(λ, D, seeing, t0, mag_ao, ao; elevation_deg=90.0)Fraction of the light collected by one telescope that reaches the combiner, i.e. the Strehl ratio when an AOConfig is available and the seeing-limited estimate min(1,(r0/D)²) when ao === nothing.
The seeing-limited estimate is about 5× lower than the AO value in H and 20× in R at CHARA; a facility with AO needs an [ao] table in its config.
OITOOLS.fried_parameter — Function
fried_parameter(seeing, λ; elevation_deg=90.0)Fried parameter r0 in metres at wavelength λ (metres) for a given seeing (arcsec, defined at 500 nm), scaled to the line of sight at elevation_deg.
r0 ∝ λ^(6/5) · airmass^(-3/5).
OITOOLS.seeing_from_r0 — Function
seeing_from_r0(r0)Seeing in arcsec (at 500 nm) corresponding to a Fried parameter r0 in metres, using the same constant as fried_parameter.
OITOOLS.atm_transmission — Function
atm_transmission(λ)Fraction of light transmitted by the atmosphere at wavelength λ (metres). Defaults to 1.0 at every wavelength.
To model tellurics, give a transmission column in a wavelength config, or redefine this function. (ASPRO uses an ESO SkyCalc table computed for Paranal.) The telluric bands relevant at CHARA are O2 A at 760 nm and H2O at 820-950 nm (SPICA), and H2O at 1350-1420 nm (MIRC-X J).
OITOOLS.PhotometricBand — Type
PhotometricBandOne photometric band: its name, central wavelength and width in metres, the photon flux of a zero-magnitude star (f0, photons/s/m²/m), and the default Strehl ceiling jmal applies in that band. See PHOTOMETRIC_BANDS.
OITOOLS.PHOTOMETRIC_BANDS — Constant
PHOTOMETRIC_BANDSThe photometric bands known to OITOOLS, from U to Q, as PhotometricBand entries.
Zero points are derived from the Bessell et al. (1998) / Cohen et al. (2003) f_lambda values for a 0-magnitude star, converted to photon flux (V: about 1000 photons/s/cm²/Å).
OITOOLS.band_for_wavelength — Function
band_for_wavelength(λ)The PhotometricBand whose central wavelength is closest to λ (in metres).
OITOOLS.band_by_name — Function
band_by_name(name)Look up a PhotometricBand by name (case-insensitive), or nothing.
OITOOLS.zero_point_flux — Function
zero_point_flux(λ)Photon flux of a zero-magnitude star at wavelength λ (metres), in photons/s/m²/μm.
Interpolated log-linearly in log(λ) between the band centres of PHOTOMETRIC_BANDS, and clamped to the V and Q endpoints outside that range.
OITOOLS.airmass — Function
airmass(alt_deg)Plane-parallel airmass 1/cos(z) from altitude in degrees. The altitude is clamped to ≥ 0.5° so the value stays finite at and below the horizon, matching how ASPRO guards its Strehl computation.
OITOOLS.datetime_to_jd — Function
datetime_to_jd(dt::DateTime)Convert a Julia DateTime to Julian Date.
OITOOLS.datetime_to_mjd — Function
datetime_to_mjd(dt::DateTime)Convert a Julia DateTime to Modified Julian Date (JD - 2400000.5), the epoch OIFITS uses.
OITOOLS.read_facility_file — Function
read_facility_file(path) -> FacilityConfigRead an interferometric array: site coordinates, telescopes, station positions, delay-line lengths, seeing and AO parameters.
path may be a bare name ("CHARA"), a name with extension, or a full path. Bare names are looked up in OITOOLS' own src/configs directory, so the shipped configs work without a path; see list_configs for what is available. A .toml file is read with the current schema, anything else with the legacy whitespace-delimited reader.
OITOOLS.read_obs_file — Function
read_obs_file(path) -> TargetConfigRead a target definition (name, RA/Dec in degrees, proper motion, spectral type) — the OI_TARGET header simulate writes.
path may be a bare name ("CHARA"), a name with extension, or a full path. Bare names are looked up in OITOOLS' own src/configs directory, so the shipped configs work without a path; see list_configs for what is available. A .toml file is read with the current schema, anything else with the legacy whitespace-delimited reader.
OITOOLS.read_comb_file — Function
read_comb_file(path) -> CombinerConfigRead a beam combiner: transmission, detector properties, integration time and the calibration error floors used by the noise model.
path may be a bare name ("CHARA"), a name with extension, or a full path. Bare names are looked up in OITOOLS' own src/configs directory, so the shipped configs work without a path; see list_configs for what is available. A .toml file is read with the current schema, anything else with the legacy whitespace-delimited reader.
OITOOLS.read_wave_file — Function
read_wave_file(path) -> WaveConfigRead a spectral setup: per-channel wavelengths and bandwidths, plus the name of the combiner it belongs to.
path may be a bare name ("CHARA"), a name with extension, or a full path. Bare names are looked up in OITOOLS' own src/configs directory, so the shipped configs work without a path; see list_configs for what is available. A .toml file is read with the current schema, anything else with the legacy whitespace-delimited reader.
OITOOLS.list_configs — Function
list_configs([dir]) -> (; facilities, combiners, wavelengths, targets, unknown, wave_combiner)The configuration files in dir (default: the configs shipped with OITOOLS), classified by content: a facility has lat, a wavelength setup has lambda and names its combiner, a target has raep0, and a file with transmission/read_noise is a combiner. Other files, and files that fail to parse, are listed in unknown. wave_combiner maps each wavelength setup to its combiner.
julia> c = list_configs();
julia> c.facilities
5-element Vector{String}:
"CHARA"
"VLTI_AT_large"
"VLTI_AT_medium"
"VLTI_AT_small"
"VLTI_UT"
julia> c.wave_combiner["MIRCX_LOWH"]
"MIRCX"OITOOLS.predict_errors — Function
predict_errors(facility, combiner, wavelength; mag, visamp=1.0, elevation_deg=90.0,
mag_ao=nothing, fringe_tracker=true) -> NamedTuplePredicted per-channel uncertainties for one setup, from simulate's noise model, without writing a file.
Returns, one entry per spectral channel of wavelength:
| field | meaning |
|---|---|
λ, δλ | channel centre and width, m |
strehl | coupling efficiency actually used |
dit | integration time per frame, s: shortened for saturation, or lengthened to the fringe tracker's limit when it is engaged |
nframes | frames coadded |
nphot | photons per telescope per DIT, fringe channel |
sigma_v2 | σ(V²), including the vis_cal_err systematic |
sigma_cp | σ(closure phase), degrees, including phase_cal_err |
sigma_visamp | σ of the visibility amplitude |
sigma_visphi | σ(visibility phase), degrees |
mag follows the same rules as simulate: a scalar, a Dict of band ⇒ magnitude, or one value per channel. visamp is the visibility amplitude the errors are evaluated at (default 1.0, unresolved).
fringe_tracker uses the combiner's tracker if it has one. The tracker's magnitude limit is in its own band, so mag must include that band (H for SPICA's FTSPICA) for the tracker to be used. See [`fringetrackerstate](@ref) anddemos/validatenoise_model.jl`.
OITOOLS.fringe_tracker_state — Function
fringe_tracker_state(combiner, ft_mag, max_dit; enabled=true) -> NamedTupleWhether combiner's fringe tracker is used, and its effect: (; engaged, extends, vis_factor). engaged: the tracker exists, is enabled, the target is within its magnitude limit, and at least one frame fits before saturation (ASPRO 2's NoiseService.prepareParameters). vis_factor is the tracker's visibility loss. extends: the integration is lengthened ("FringeTrack"; "GroupTrack" only applies the visibility loss).
ft_mag is the target's magnitude in the tracker's band (combiner.ft_band); nothing means not supplied, and the tracker is not used.