Imaging (SPARCO)
SPARCO (SPectral Analysis of Resolved Compact Objects) decomposes the scene into a parametric model (stars, background) + a reconstructed image (environment).
| Function | Description |
|---|---|
reconstruct_sparco(x0, data, ft; lambda_ref, ...) | High-level SPARCO: set physical params, get image back |
chi2_sparco_flat_f(x, params, model, ft, data) | Flat-model SPARCO chi-squared (forward only) |
optimize_sparco_flat_parameters(params, model, x, ft, data) | Optimize flat-model SPARCO parameters (image fixed) |
model_and_image_to_vis(model, params, x_img, ft, data) | Combined visibility: V_model + W(λ) · V_image |
OITOOLS.reconstruct_sparco — Function
reconstruct_sparco(x_start, data, ft;
lambda_ref, star_flux=0.5, bg_flux=0.0,
d_env=0.0, star_di=4.0,
star_spectral_index_fixed=true,
fit_model_first=true,
regularizers=[], weights=[1,1,1],
maxiter=200, rounds=3, verb=false, ...)High-level SPARCO image reconstruction with the standard star + background + image model.
Builds the flat-model dict internally from the physical parameters, then calls reconstruct_hybrid.
Arguments
x_start: starting image (nx × nx)data:OIdataorVector{OIdata}ft: Fourier transform plans fromsetup_nfftlambda_ref: reference wavelength in metres (required)star_flux: initial stellar flux fraction at λ₀ (default 0.5)bg_flux: initial background flux fraction at λ₀ (default 0.0)d_env: environment spectral index (default 0.0)star_di: stellar spectral index (default 4.0 = Rayleigh-Jeans)star_spectral_index_fixed: fixstar_diduring reconstruction (defaulttrue)fit_model_first: run a model-only fit before image reconstruction (defaulttrue)
Returns a named tuple (params, image, model, free_params, chi2).
OITOOLS.chi2_sparco_flat_f — Function
chi2_sparco_flat_f(x_img, params, model, ftplan, data;
w_name="env,f", weights=[1,1,1], verb=true, vonmises=false)Evaluate chi2 for the SPARCO-flat model (no gradient).
OITOOLS.optimize_sparco_flat_parameters — Function
optimize_sparco_flat_parameters(params_start, model, x_img, ft, data;
w_name="W", weights=[1,1,1], lb, ub,
method=:LN_NELDERMEAD, maxeval=2000)Optimize SPARCO-flat model parameters with the image held fixed. Supports gradient-free (:LN_NELDERMEAD) and gradient-based (:LD_LBFGS, etc.) methods. For :LD_* methods, the parameter gradient is extracted from chi2_sparco_flat_fg. Returns (minchi2, params_opt, ret).
OITOOLS.model_and_image_to_vis — Function
model_and_image_to_vis(model, params, x_img, ftplan, data; w_name="W")Compute the combined visibility Vtotal = Vmodel + W(λ) · V_image.
Returns a NamedTuple (; V_total, V_model, V_image, W).