Plotting OIFITS data
These functions are in a package extension; without PythonPlot loaded they raise a MethodError:
using Pkg; Pkg.add("PythonPlot")
using OITOOLS, PythonPlotSee Plotting.
The plot functions take an OIdata or an array of them (the output of readoifits, a polychromatic array, a multi-epoch vector). set_oiplot_defaults() applies the OITOOLS matplotlib style; set_oiplot_defaults(compact=true) makes smaller fonts, markers and error bars and drops the in-plot title, for stacked panels. The same figures drawn with Makie, without Python, are the _makie functions (see Makie plotting).
UV coverage
uvplot(data) # one colour per baseline
uvplot(data; color="wav") # colour by wavelength
uvplot(data; color="mjd") # colour by MJD
uvplot(data; color="baseline", flipx=true, square=true, figsize=(10,10))Key keyword arguments: color, figsize, minuv, maxuv, square, legend_below, figtitle, cmap, flipx.
Squared visibilities
plot_v2(data) # linear scale
plot_v2(data; logplot=true) # log scale
plot_v2(data; color="wav") # colour by wavelength
plot_v2(data; color="mjd") # colour by timestampKey arguments: figsize, logplot, color, markopt, legend_below, figtitle.
Closure phases
plot_t3phi(data) # x-axis = geometric mean baseline (default)
plot_t3phi(data; t3base="max") # x-axis = longest baseline
plot_t3phi(data; color="mjd") # colour by MJDKey arguments: figsize, color, markopt, legend_below, t3base, figtitle.
Triple amplitudes
plot_t3amp(data)
plot_t3amp(data; logplot=true) # log scale
plot_t3amp(data; color="mjd") # colour by MJDKey arguments: figsize, logplot, color, markopt, legend_below, t3base, figtitle.
Visibility amplitudes and phases
plot_visamp(data) # adapts title to AMPTYP (absolute, differential, correlated flux)
plot_visamp(data; logplot=true) # log scale
plot_visamp(data; color="wav") # colour by wavelength
plot_visphi(data) # auto-detects PHITYP: absolute → single panel, differential → per-baseline subplots
plot_visphi(data; color="mjd") # colour by MJD (absolute phases)Key arguments: figsize, logplot (visamp only), color, markopt, legend_below, figtitle.
Flux spectra
plot_flux(data) # coloured by wavelength (default)
plot_flux(data; color="station") # colour by station; "Calibrated" for CALSTAT=C data
plot_flux(data; color="mjd") # scatter coloured by MJD with colorbarplot_flux maps flux_sta_index == 0 (calibrated OI_FLUX) to the label "Calibrated" and uses the station name otherwise.
Key arguments: figsize, color, markopt, legend_below, figtitle.
Residuals vs model
With model observables computed beforehand:
plot_v2_residuals(data, v2_model)
plot_t3phi_residuals(data, t3phi_model)
plot_t3amp_residuals(data, t3amp_model)Multi-file V² comparison
files_data = [data1, data2, data3] # Vector{OIdata}
plot_v2_multifile(files_data)Image display
imdisp(image; pixsize=0.5, colormap="gist_heat", use_colorbar=true)
imdisp_multi(image_cube; labels=string.(wavs), pixsize=0.5) # polychromatic
imdisp_multi(image_cube; labels=["Epoch $i" for i in 1:n], pixsize=0.5) # multi-temporalpixsize is in mas/pixel. beamsize (mas) draws a PSF indicator.
Multi-panel overview
Several observables in one figure, with a shared x axis and legend:
plot_obs(data) # default: V², T3φ, T3amp
plot_obs(data; obs=["V2", "T3PHI", "VISAMP", "VISPHI"]) # custom selection
plot_obs(data; color="wav") # colour by wavelength
set_oiplot_defaults(compact=true)
plot_obs(data) # compact panels
set_oiplot_defaults(compact=false)Observables absent from the data are skipped.
Facility / array layout
Telescope positions of a FacilityConfig:
facility = read_facility_file("CHARA.toml")
plot_facility(facility)The docstrings are in the Plotting API reference.