Imaging (Maximum Entropy)

BSMEM (BiSpectrum Maximum Entropy Method) reconstruction.

You can pass data and ft directly from readoifits / setup_ftreconstruct_bsmem auto-dispatches based on the input dimensions. For explicit control, pass a single OIdata (mono) or a 3D starting image with Vector{OIdata} (polychromatic).

FunctionDescription
reconstruct_bsmem(x0, data, ft)BSMEM image reconstruction (mono or polychromatic)
auto_pixsize(data)Estimate pixel size from data
gaussian_prior(nx, fwhm)Generate a 2D Gaussian prior image
gaussian_prior_cube(nx, pixsize, nwav)Generate a 3D Gaussian prior cube for polychromatic BSMEM
OITOOLS.reconstruct_bsmemFunction
reconstruct_bsmem(x_start, data, ft; kwargs...) → Matrix{Float64}

Maximum Entropy image reconstruction using power spectra (V²) and closure phases (T3φ), with the same calling convention as reconstruct.

This is the recommended high-level entry point. Pixel size and image size are inferred from the OITOOLS NFFT plan ft; you do not need to call maxent_setup or maxent_reconstruct! directly.

Arguments

  • x_start — starting image: an nx×nx matrix or length-nx² vector. Used as the initial iterate and, unless overridden via regularizers, as the entropy prior.
  • data::OIdata — interferometric data loaded by readoifits.
  • ft — NFFT plan produced by setup_nfft(data, nx, pixsize).

Keyword arguments

Reconstruction control

  • method — MaximENT stopping criterion. Either a 4-element Int vector passed directly as methd, or one of these shorthands:
    • 1[1,1,1,2] classic known noise
    • 4[4,1,1,2] χ² = N (default)
  • maxiter — maximum outer iterations. Default: 200.
  • verbose — print iteration diagnostics. Default: true.

Prior / entropy

  • regularizers — list of regularization entries. The first entry of the form ["mem", model] supplies the entropy prior image; all other entries are ignored by MaxEnt. If no "mem" entry is found, x_start is used as the prior.

Data-space options

  • flux_err — relative flux uncertainty for the zero-baseline constraint. Default: 1e-5.
  • biserrtype — bispectrum noise model: :full (Meimon 2005 elliptic, default) or :classic (first-order approximation).
  • force_extrapolate — always estimate triple amplitudes from V² rather than using measured values. Default: false.

MaximENT hyper-parameters

  • nrand — number of random probe vectors for evidence estimation. Default: 10.
  • aim, rate, utol, alpha — MaximENT convergence parameters.
  • mackay_alpha — use MacKay fixed-point α update. Default: false.
  • ritz_alpha — use Ritz-value bisection α update. Default: false.

Example

data   = readoifits("data/2004-data1.oifits")[1,1]
nx     = 128
pixsize = 0.05   # mas/pixel
ft      = setup_nfft(data, nx, pixsize)
prior   = gaussian_prior(nx, pixsize; fwhm_mas = nx * pixsize / 5)
x = reconstruct_bsmem(prior, data, ft;
                      regularizers = [["mem", prior]],
                      method       = [1, 1, 1, 2],
                      maxiter      = 100,
                      flux_err     = 1e-5)
imdisp(x; pixsize)

See also: maxent_setup, maxent_reconstruct!.

source
reconstruct_bsmem(x_start_3d, data_channels, ft_channels; kwargs...) → Array{Float64,3}

Polychromatic Maximum Entropy reconstruction. Same keyword arguments as the monochromatic reconstruct_bsmem, but accepts:

  • x_start_3dnx × nx × nwav starting image cube
  • data_channelsVector{OIdata} (one per wavelength channel)
  • ft_channelsVector of NFFT plans (one per channel, from a column of setup_ft)

Returns an nx × nx × nwav image cube normalised to unit flux per channel.

source
reconstruct_bsmem(x_start_4d, data_matrix, ft_matrix; kwargs...) → Array{Float64,4}

Polychromatic convenience wrapper accepting 4D image and Matrix{OIdata}. Requires single epoch (size(data,2) == 1).

source
reconstruct_bsmem(x_start_2d, data::AbstractMatrix{OIdata}, ft; kwargs...)

Convenience method accepting the raw Matrix{OIdata} from readoifits and a 2D starting image. If size(data,1) == 1 (monochromatic), delegates to the monochromatic path; otherwise wraps into 3D/Vector form for polychromatic.

source
OITOOLS.auto_pixsizeFunction
auto_pixsize(data; oversampling=3.0) → Float64

Return a pixel size in mas giving oversampling pixels per fringe at the longest baseline.

source
OITOOLS.gaussian_priorFunction
gaussian_prior(nx, pixsize_mas; fwhm_mas, flux=1.0) → Vector{Float64}

Centred Gaussian prior matching bsmem.c modeltype=3. fwhm_mas defaults to 1/5 of the image FoV. Pixels are clipped at 1e-8 to avoid log(0) in the entropy.

source
OITOOLS.gaussian_prior_cubeFunction
gaussian_prior_cube(nx, pixsize_mas, nwav; fwhm_mas=nx*pixsize_mas/5)

Build an nx × nx × nwav Gaussian prior image cube with identical spatial profile in each channel, each normalised to unit flux.

source