initSource

lsst.meas.extensions.scarlet.initSource(frame, center, observation, symmetric=False, monotonic=True, thresh=1, maxComponents=1, edgeDistance=1, shifting=False, downgrade=False, fallback=True)

Initialize a Source

The user can specify the number of desired components for the modeled source. If scarlet cannot initialize a model with the desired number of components it continues to attempt initialization of one fewer component until it finds a model that can be initialized. It is possible that scarlet will be unable to initialize a source with the desired number of components, for example a two component source might have degenerate components, a single component source might not have enough signal in the joint coadd (all bands combined together into single signal-to-noise weighted image for initialization) to initialize, and a true spurious detection will not have enough signal to initialize as a point source. If all of the models fail, including a PointSource model, then this source is skipped.

Parameters:
frame : LsstFrame

The model frame for the scene

center : tuple of float`

(y, x) location for the center of the source.

observation : Observation

The Observation that contains the images, weights, and PSF used to generate the model.

symmetric : bool

Whether or not the object is symmetric

monotonic : bool

Whether or not the object has flux monotonically decreasing from its center

thresh : float

Fraction of the background to use as a threshold for each pixel in the initialization

maxComponents : int

The maximum number of components in a source. If fallback is True then when a source fails to initialize with maxComponents it will continue to subtract one from the number of components until it reaches zero (which fits a point source). If a point source cannot be fit then the source is skipped.

edgeDistance : int

The distance from the edge of the image to consider a source an edge source. For example if edgeDistance=3 then any source within 3 pixels of the edge will be considered to have edge flux. If edgeDistance is None then the edge check is ignored.

shifting : bool

Whether or not to fit the position of a source. This is an expensive operation and is typically only used when a source is on the edge of the detector.

downgrade : bool

Whether or not to decrease the number of components for sources with small bounding boxes. For example, a source with no flux outside of its 16x16 box is unlikely to be resolved enough for multiple components, so a single source can be used.

fallback : bool

Whether to reduce the number of components if the model cannot be initialized with maxComponents. This is unlikely to be used in production but can be useful for troubleshooting when an error can cause a particular source class to fail every time.