Validation¶
Synthetic source injection and recovery measurement (SPEC §10) — used by the test suite to quantify completeness and photometric fidelity end to end.
validation
¶
Synthetic source injection and recovery measurement (SPEC §10).
Reusable helpers for the injection–recovery validation suite and benchmarks: render Gaussian point sources, inject them into a frame, and measure peaks / aperture fluxes / completeness on the difference or score image.
gaussian_psf
¶
gaussian_psf(
shape: tuple[int, int],
x: float,
y: float,
flux: float,
sigma: float,
) -> NDArray[float64]
A Gaussian point source of given total flux and sigma, on a blank frame.
Source code in python/delta/validation.py
inject
¶
Return a copy of image with Gaussian sources added at positions.
Source code in python/delta/validation.py
render_stars
¶
Render Gaussian point sources onto a blank frame.
Each source is drawn only within a local box (radius ~ 5*sigma by
default), so this stays cheap on survey-scale frames where a full-frame mgrid
per star would be prohibitive. Positions may be sub-pixel.
Source code in python/delta/validation.py
sample_starfield
¶
sample_starfield(
shape,
n_stars: int,
rng,
flux_range: tuple[float, float] = (200.0, 60000.0),
slope: float = 1.8,
border: int = 16,
min_separation: float = 0.0,
) -> tuple[NDArray[float64], NDArray[float64]]
Sample a realistic star field: random positions, power-law fluxes.
Returns (positions (N, 2), fluxes (N,)). Fluxes follow a bounded power law
p(F) ∝ F**-slope over flux_range (many faint, few bright — a stellar
luminosity function), far more realistic than a regular grid of equal-flux
sources. Positions are uniform within a border margin; min_separation
rejection-samples to limit crowding so stamp selection has isolated sources.
Source code in python/delta/validation.py
peak_near
¶
Peak value and its (x, y) location within radius of xy.
Source code in python/delta/validation.py
aperture_flux
¶
Sum of pixels within a circular aperture of radius about xy.
Source code in python/delta/validation.py
completeness
¶
Boolean recovery flag per position: score peak within radius >= threshold.