CullFromMaskedRegion#

class lsst.meas.algorithms.CullFromMaskedRegion(*args, **kw)#

Bases: Config

Deselect sources that lie in a “bad” mask plane.

This will select against objects whose image coordinates lie in a region with any of the mask bits in the badMaskNames list set. Namely used for a reference catalog for which the flag columns we would get from the measurement plugins do not exist.

NOTE: In the context of reference objects, it is recommended NOT to include EDGE in the badMaskNames list as that will remove all the reference objects outside the detector but within the pixelMargin (thus nulling the pixelMargin padding all together!)

Attributes Summary

badMaskNames

List of mask planes for which sources should be removed if a bit is set.

xColName

Name of column for image x coordinate.

yColName

Name of column for image y coordinate.

Methods Summary

apply(catalog, exposure)

Apply the mask plane requirements to a catalog.

Attributes Documentation

badMaskNames#

List of mask planes for which sources should be removed if a bit is set. (List, default ['NO_DATA', 'NOT_DEBLENDED'])

xColName#

Name of column for image x coordinate. (str, default 'centroid_x')

yColName#

Name of column for image y coordinate. (str, default 'centroid_y')

Methods Documentation

apply(catalog, exposure)#

Apply the mask plane requirements to a catalog.

Returns whether the sources were selected.

Parameters#

cataloglsst.afw.table.SourceCatalog or pandas.DataFrame

or astropy.table.Table

Catalog of sources to which the requirements will be applied.

exposurelsst.afw.image.Exposure or None

The exposure whose mask plane is to be respected.

Returns#

selectednumpy.ndarray

Boolean array indicating for each source whether it is selected (True means selected).

Raises#

RuntimeError

Raised if exposure passed is None.