DonutSourceSelectorTask#
- class lsst.ts.wep.task.DonutSourceSelectorTask(**kwargs)#
Bases:
TaskDonut Source Selector that uses a nearest neighbors radius query to find all donuts within the pixel radius set in the config. Then it goes from the brightest sources down to the faintest picking donuts that are at least isolatedMagDiff brighter than any sources with centers within 2 times the unblendedSeparation until reaching numSources kept or going through the whole list.
When the input catalog lacks flux information (and
config.allowFluxlessis True) the selector operates on coordinates only (e.g. a detection catalog with only coordinates). In that mode magnitude cuts are skipped, sources are ordered by field distance (center-out), and isolation/blending decisions are made purely on separation. No blend centers are produced. Flux is always used when it is present.- Parameters:
kwargs (
Any)
Methods Summary
run(sourceCat, detector, filterName)Select sources and return them.
selectSources(sourceCat, detector, filterName)Run the source selection algorithm and return the indices to keep in the original catalog.
Methods Documentation
- run(sourceCat, detector, filterName)#
Select sources and return them.
- Parameters:
sourceCat (
lsst.afw.table.SourceCatalogorpandas.DataFrame)astropy.table.Table (or) – Catalog of sources to select from.
detector (
lsst.afw.cameraGeom.Detector) – Detector object from the camera.filterName (
str) – Name of camera filter. Ignored when the catalog has no flux field andconfig.allowFluxlessis True.
- Returns:
struct –
- The struct contains the following data:
sourceCat :
lsst.afw.table.SourceCatalog
- or
pandas.DataFrameorastropy.table.Table The catalog of sources that were selected. (may not be memory-contiguous)
- selected
numpy.ndarrayofbool Boolean array of sources that were selected, same length as sourceCat.
- selected
- Return type:
lsst.pipe.base.Struct- Raises:
RuntimeError – Raised if
sourceCatis not contiguous.
- selectSources(sourceCat, detector, filterName)#
Run the source selection algorithm and return the indices to keep in the original catalog.
- Parameters:
sourceCat (
lsst.afw.table.SourceCatalogorpandas.DataFrame)astropy.table.Table (or) – Catalog of sources to select from.
detector (
lsst.afw.cameraGeom.Detector) – Detector object from the camera.filterName (
str) – Name of camera filter. Ignored when the catalog has no flux field andconfig.allowFluxlessis True.
- Returns:
struct –
- The struct contains the following data:
- selected
numpy.ndarrayofbool Boolean array of sources that were selected, same length as sourceCat.
- selected
- Return type:
lsst.pipe.base.Struct- Raises:
RuntimeError – Raised if the catalog lacks the flux field
f"{filterName}_flux"andconfig.allowFluxlessis False.KeyError – Raised if a required coordinate column is missing from
sourceCat, or (when flux is used and useCustomMagLimit is False) iffilterNamehas no entry in policy:magLimitStar.yaml.