Installation

OITOOLS needs Julia 1.13 or later. It is not in the General registry; some of its dependencies (OIFITS, OptimPackNextGen) are in EmmtRegistry:

using Pkg
pkg"registry add General"
pkg"registry add https://github.com/emmt/EmmtRegistry"
Pkg.add(url = "https://github.com/fabienbaron/OITOOLS.jl.git")

using OITOOLS loads no plotting package, no Python and no GUI. These come from optional packages, each enabling part of the package when it is loaded:

packageenablesinstall
PythonPlotthe matplotlib figures (uvplot, plot_v2, imdisp, …)Pkg.add("PythonPlot")
PythonCallUltraNest (fit_model_nested(…; backend = :ultranest))Pkg.add("PythonCall")
Nautilusnested sampling in JuliaPkg.add(url = "https://github.com/fabienbaron/Nautilus.jl.git")
Pigeonsparallel tempering (fit_model_pigeons, reconstruct_squeeze_tempered)Pkg.add("Pigeons")
PairPlotscorner plots (plot_corner_makie)Pkg.add("PairPlots")
VarInfvariational inference for imagingPkg.add(url = "https://github.com/fabienbaron/VarInf.jl.git")
GLMakie, QMLMakie, QMLthe GUI and the _makie figuresPkg.add(["GLMakie", "QMLMakie", "QML"])
GLFW_jllnative Wayland for the GUIPkg.add("GLFW_jll")

Main dependencies: OIFITS.jl and AstroFITS (files), NFFT and FFTW (Fourier transforms), OptimPackNextGen (VMLMB, image reconstruction), NLopt and LsqFit (model fitting), NearestNeighbors (uv deduplication), SpecialFunctions, ForwardDiff and RuntimeGeneratedFunctions (models).

Python

Python is used only through PythonCall (UltraNest) and PythonPlot (matplotlib). When either is first loaded, CondaPkg installs CondaPkg.toml's packages (python, matplotlib-base, numpy, scipy, ultranest) into a project-local environment. matplotlib-base has no GUI backend; PythonPlot installs full matplotlib.

To use an existing Python instead, set JULIA_PYTHONCALL_EXE to its interpreter; matplotlib and ultranest must then be installed there.

What each optimiser needs

A function whose package is not loaded raises a MethodError, or, for fit_model_nested and fit_model_pigeons, an error naming the package.

Model fitting

methodfunctionneeds
NLopt (any LD_/LN_ method)fit_model(…; method = :LD_LBFGS)—
Levenberg–Marquardtfit_model_lsqfit—
Grid search, two parameterschi2_map—
Bootstrapbootstrap_fit—
Ensemble slice samplingfit_model_ensemble—
Nested sampling, Juliafit_model_nestedNautilus
Nested sampling, UltraNestfit_model_nested(…; backend = :ultranest), fit_model_ultranestPythonCall
Parallel temperingfit_model_pigeonsPigeons

With both nested samplers loaded, nested_backend() reports the default and set_nested_backend! changes it.

Imaging

methodfunctionneeds
VMLMB with regularisersreconstruct—
Maximum entropyreconstruct_bsmem—
ADMMreconstruct_bsdmm—
SPARCO, chromatic hybridreconstruct_sparco, reconstruct_hybrid—
SQUEEZE (simulated annealing)reconstruct_squeeze—
SQUEEZE, parallel temperingreconstruct_squeeze_temperedPigeons
Variational inferencereconstruct_map, reconstruct_mgviVarInf

Figures

figurefunctionneeds
matplotlib figuressee PlottingPythonPlot
Makie figures (*_makie)see Plottinga Makie backend
Corner plotplot_corner_makiePairPlots and a Makie backend
UltraNest corner plotplot_ultranest_cornerPythonPlot
SQUEEZE monitorreconstruct_squeeze(…; monitor = n)PythonPlot

Plotting

Pkg.add("PythonPlot")
using OITOOLS, PythonPlot
uvplot(data)

Loading PythonPlot activates the extension that provides uvplot, plot_v2, plot_t3phi, plot_t3amp, plot_visamp, plot_visphi, plot_diffphi, plot_flux, plot_obs, plot_multi, the *_residuals functions, plot_residuals, plot_v2_multifile, plot_facility, imdisp, imdisp_multi, plot_ultranest_corner, set_oiplot_defaults, gantt_onenight, obs_plan, chara_plan and empty_night. Without it these functions have no methods.

For scripts without a display, set the backend before loading PythonPlot:

ENV["MPLBACKEND"] = "Agg"
using OITOOLS, PythonPlot

OBS_PLOT_SPECS, oiplot_colors and canonical_color (axis labels, groupings, palette) are in the core package, for other plotting front-ends.

The GUI

From a clone of the repository, in its root directory:

julia -e 'using Pkg; Pkg.Registry.add("General"); Pkg.Registry.add(url = "https://github.com/emmt/EmmtRegistry")'   # once
julia --project=bin -e 'using Pkg; Pkg.instantiate()'   # once
julia --project=bin bin/oitoolsgui.jl [file.oifits]

From Julia, with GLMakie, QMLMakie and QML installed:

using OITOOLS
oitoolsgui()                       # or oitoolsgui("mydata.oifits")

Call oitoolsgui() before using GLMakie in that session.

A sysimage makes the start faster:

julia --project=bin bin/compile.jl                  # once; tens of minutes
julia --project=bin --sysimage bin/oitoolsgui.so bin/oitoolsgui.jl [file.oifits]

Rebuild it after updating OITOOLS or Julia. app/build.jl builds a standalone application, and app/appimage.sh packs it as a Linux AppImage.