boxed_moments#
- scarlet2.init.boxed_moments(obs, center, footprint=None, bbox=None)[source]#
Measure 2nd moments of the observation in the region of the bounding box
The methods cuts out the pixel included in bbox or in footprint, measures their 2nd moments with respect to center, adjust the spatial coordinates and the PSF to match the model frame.
- Parameters:
obs (
Observation) – The Observation instance to derive moments fromcenter (
tuple) – central pixel of the sourcefootprint (
array, optional) – 2D image with non-zero values for all pixels associated with this source (aka a segmentation map or footprint)bbox (
BBox, optional) – box to cut out source from observation, in pixel coordinates
- Returns:
2nd moments, corrected to match the model frame
- Return type:
Moments- Raises:
AssertionError – If neither bbox or footprint are set