23 """Select sources that have an existing flag field set."""
24 import lsst.pex.config
28 from .sourceSelector
import BaseSourceSelectorTask, sourceSelectorRegistry
30 __all__ = [
"FlaggedSourceSelectorConfig",
"FlaggedSourceSelectorTask"]
34 field = lsst.pex.config.Field(
35 dtype=str, default=
"calib_psf_used",
36 doc=
"Name of a flag field that is True for Sources that should be used.",
40 @lsst.pex.config.registerConfigurable(
"flagged", sourceSelectorRegistry)
43 A trivial SourceSelector that simply uses an existing flag field to filter
46 This is most frequently used in steps that occur after the a PSF model has
47 been built, to allow other procedures that need Sources to use the set of
48 Sources used to determine the PSF.
53 A boolean variable specify if the inherited source selector uses
57 ConfigClass = FlaggedSourceSelectorConfig
58 _DefaultName =
"flagged"
61 """Return a bool array representing which sources to select from
64 The input catalog must be contiguous in memory.
68 sourceCat : `lsst.afw.table.SourceCatalog`
69 Catalog of sources to select from.
70 matches : `list` of `lsst.afw.table.ReferenceMatch` or None
71 Ignored in this SourceSelector.
72 exposure : `lsst.afw.image.Exposure` or None
73 The exposure the catalog was built from; used for debug display.
77 struct : `lsst.pipe.base.Struct`
78 The struct contains the following data:
80 - selected : `array` of `bool`
81 Boolean array of sources that were selected, same length as
84 key = sourceCat.schema.find(self.config.field).key
85 return pipeBase.Struct(selected=sourceCat.get(key))