multiscale_footprints#
- scarlet2.detect.multiscale_footprints(obs, scales=None, strict=True, K=3, split_peaks=True, image_type='ground', min_separation=0, min_area=9, thresh=0, return_intermediates=False)[source]#
Detect footprints at multiple starlet scales from an observation.
Builds a detection image from the inverse-variance weighted sum of
obs.data, computes its starlet decomposition, and detects connected footprints at each requested scale. Optionally splits footprints that contain more than one peak into non-overlapping single-peak sub-footprints via a watershed algorithm.- Parameters:
obs (
Observation) – The observation providing image data and per-pixel weights.scales (
listofint, optional) – Starlet scale indices to detect on. Default is[1, 2, 3].strict (
bool, optional) – IfTrue, the coarse residual plane is pushed one scale higher so that the selectedscalesare cleanly separated from the smooth background. DefaultTrue.K (
float, optional) – Detection threshold multiplier: wavelet coefficients with|w| > K * sigma_jare considered significant. Default3.split_peaks (
bool, optional) – IfTrue(default), footprints that contain more than one peak are split into non-overlapping single-peak sub-footprints using a priority-queue watershed. IfFalse, multi-peak footprints are returned intact.image_type (
str, optional) – PSF width regime used when computing the multi-resolution support."ground"(default) for wide ground-based PSFs;"space"for narrow space-based PSFs.min_separation (
float, optional) – Minimum pixel distance between peaks within a footprint. Dimmer peaks closer than this to a brighter one are suppressed. Default0.min_area (
int, optional) – Minimum number of pixels a footprint (or watershed sub-footprint) must contain to be kept. Default9.thresh (
float, optional) – Additional detection threshold; pixels must strictly exceed this value to be included in a footprint. Default0.return_intermediates (
bool, optional) – IfTrue, return a 4-tuple(detect, sigma, scales, all_footprints)that exposes the intermediate products. DefaultFalse.
- Returns:
all_footprints (
dict mapping int → listofFootprint) – Footprints at each requested scale, keyed by scale index. Whensplit_peaksisTrueevery footprint carries exactly one peak.detect (
ndarray,shape (max_scale+2,height,width)) – Masked starlet coefficients of the detection image. Only returned whenreturn_intermediatesisTrue.sigma (
ndarray,shape (max_scale+2,)) – Per-scale noise estimates used for thresholding. Only returned whenreturn_intermediatesisTrue.scales (
listofint) – The sorted list of scales that were used. Only returned whenreturn_intermediatesisTrue.
See also
get_detect_wavelets()builds the detection image.
split_footprint()watershed splitting of multi-peak footprints.
hierarchical_footprints()higher-level function that links footprints across scales into a source hierarchy.