Outputs API
The Outputs module writes images and computes interferometric observables.
BlackLightPlus.Outputs — Module
OutputsImage writers and interferometry (blacklight outputs/ heritage): a zero-dependency NumPy .npy (format v1.0) writer, mirroring blacklight's in-house npy.cpp, whose arrays load directly with numpy.load.
Image output
BlackLightPlus.Outputs.write_npy — Function
Write a Float64 matrix as NumPy .npy v1.0 with shape size(a) (C element order).
Interferometry
Visibility amplitudes from an image, following AART (Cárdenas-Avendaño et al., 2023). radon_cut takes a projection through the image; visamp computes the visibility amplitude along a baseline; visamp_minima locates the minima whose spacing encodes the photon-ring diameter.
BlackLightPlus.Outputs.radon_cut — Function
radon_cut(img, angle_deg; fov_muas) -> (projection, s_axis_muas)Parallel-beam Radon projection of a square image (I[iβ, iα], rows = β) at baseline angle_deg; fov_muas is the full field of view in μas. Each pixel is linearly splatted into the two bins straddling its projected coordinate t = x·cosθ + y·sinθ — exact for axis-aligned cuts, first-order at oblique angles (sufficient for the visibility-amplitude ring ruler). Returns the length-N projection and its μas offset axis.
BlackLightPlus.Outputs.visamp — Function
visamp(img; angles=(0.0, 90.0), fov_muas, pad=16, maxbaseline=Inf,
window=:tukey) -> Vector{NamedTuple}Interferometric visibility amplitude of img along each baseline angle (degrees): radon_cut → Tukey window (window=:tukey, else rectangular) → zero-pad by pad× → 1-D FFT → |V| (normalised to |V(0)| = 1) on the non-negative baselines below maxbaseline, in Gλ. Returns one (angle, baselines, amplitude) entry per angle. The minima are spaced by ≈ 1/(d · MUAS_TO_RAD · 1e9) Gλ for a ring of angular diameter d μas.
BlackLightPlus.Outputs.visamp_minima — Function
visamp_minima(baselines, amplitude; skip=1, bl_min=0.0) -> VectorBaselines (Gλ) of the local minima of a visibility-amplitude curve — the strict-interior valleys with bl > bl_min, dropping the first skip (the DC lobe roll-off). Successive minima spacings give the photon-ring-diameter ruler.
BlackLightPlus.Outputs.tukey_window — Function
tukey_window(n, α=0.5) -> VectorThe tapered-cosine (Tukey) window of length n: a flat centre with cosine tapers over the outer α fraction (α=0 rectangular, α=1 Hann). Matches scipy.signal.windows.tukey; AART uses α=0.5 to suppress FFT ringing from the finite Radon cut without over-smoothing the ring minima.
BlackLightPlus.Outputs.MUAS_TO_RAD — Constant
One microarcsecond in radians (AART muas_to_rad): π / (180·3600·10⁶). Converts a μas image scale / baseline to radians and back.