hierarchical_sources#
- scarlet2.init.hierarchical_sources(obs, scales=None, strict=True, K=3, split_peaks=True, image_type='ground', min_separation=0, min_area=9, thresh=0, catalog=None)[source]#
Initialize sources from a wavelet-based hierarchical footprint detection.
Computes a detection image from
obs, decomposes it into a hierarchy of footprints across starlet scales, and returns oneHierarchicalSourceInfoper footprint, suitable for constructingSourceobjects.Spectra and morphologies are initialized from the wavelet detection image at each source’s scale, with a least-squares flux estimate that progressively subtracts brighter/larger sources before fitting fainter/ smaller ones (largest scale first).
- Parameters:
obs (
Observation) – The observation providing image data, per-pixel weights, and the coordinate frame used to convertcentersto pixel positions.scales (
listofint, optional) – Starlet scales (indices into the coefficient array, default [1,2,3]) to use for detection.strict (
bool, optional) – IfTrue, the coarse residual plane is pushed one scale higher so that the selectedscalesare cleanly separated without bleed from the largest-scale smooth background. DefaultFalse.K (
float, optional) – Detection threshold multiplier: coefficients with|w| > K * sigma_jare considered significant. Also used for the SNR-based bounding box extension. Default3.split_peaks (
bool, optional) – IfTrue(default), footprints with multiple peaks are split into separate sources using a watershed algorithm. Otherwise, additional peaks become children of the originating footprint, which retains the full footprint area, i.e. the children overlap. Splitting peaks allows to reduce the overlap of mostly independent sources.image_type (
str) – The type of image that is being used. This should be"ground"for ground based images with wide PSFs or"space"for images from space-based telescopes with a narrow PSF.min_separation (
float, optional) – Minimum pixel separation between peaks within a footprint.min_area (
int, optional) – Minimum number of pixels a footprint must contain to be kept.thresh (
float, optional) – Detection threshold; pixels must strictly exceed this value.catalog (
listofastropy.coordinates.SkyCoord, optional) – If given, only footprints that contain one of these sky positions are returned. Converted to pixel coordinates viaobs.frame.get_pixel.
- Returns:
sources – One entry per detected footprint. Will create a “compact” source, i.e. a morphology array from the model PSF for every location in catalog that is not detected as a footprint.
- Return type:
listofHierarchicalSourceInfo
See also