Imaging (SPARCO)

SPARCO models the scene as a parametric model (star, background) plus a reconstructed image (environment).

FunctionDescription
reconstruct_sparco(x0, data, ft; lambda_ref, ...)SPARCO with the standard star + background + image model
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=false,
                   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: OIdata or Vector{<:OIdata}
  • ft: Fourier transform plans from setup_nfft
  • lambda_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); star_flux + bg_flux ≤ 1
  • d_env: environment spectral index (default 0.0)
  • star_di: stellar spectral index (default 4.0 = Rayleigh-Jeans)
  • star_spectral_index_fixed: fix star_di during reconstruction (default true)
  • fit_model_first: fit the model parameters with the starting image as the environment before the first image step (default false). With a centrally peaked starting image, true can move part of the star's flux into the image

The free parameters are star,f0, bg,frac (the background's fraction of the flux the star leaves, bg,f0 = (1 − star,f0) · bg,frac) and d_env, plus star,di when it is free. With star,f0 and bg,frac in [0, 1], the star, background and image fluxes at λ₀ are each in [0, 1] and sum to 1.

Returns a named tuple (params, image, model, free_params, chi2, param_names): params are the values of free_params (for model), and param_names maps every fitted quantity, bg,f0 included, to its value.

source
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)

Evaluate chi2 for the SPARCO-flat model (no gradient).

source
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).

source
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).

source