DonutSourceSelectorTask#

class lsst.ts.wep.task.DonutSourceSelectorTask(**kwargs)#

Bases: Task

Donut 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.allowFluxless is 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.SourceCatalog or pandas.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 and config.allowFluxless is True.

Returns:

struct –

The struct contains the following data:
  • sourceCat : lsst.afw.table.SourceCatalog

or pandas.DataFrame or astropy.table.Table

The catalog of sources that were selected. (may not be memory-contiguous)

  • selectednumpy.ndarray of bool

    Boolean array of sources that were selected, same length as sourceCat.

Return type:

lsst.pipe.base.Struct

Raises:

RuntimeError – Raised if sourceCat is 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.SourceCatalog or pandas.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 and config.allowFluxless is True.

Returns:

struct –

The struct contains the following data:
  • selectednumpy.ndarray of bool

    Boolean array of sources that were selected, same length as sourceCat.

  • blendCentersXlist of numpy.ndarray or None

    Per-selected-source x positions of the accepted blend neighbors, in the same order as the selected sources, for building a deblend mask. Empty arrays where a source was kept unblended; None when the catalog was empty.

  • blendCentersYlist of numpy.ndarray or None

    Per-selected-source y positions of the accepted blend neighbors, matching blendCentersX.

Return type:

lsst.pipe.base.Struct

Raises:
  • RuntimeError – Raised if the catalog lacks the flux field f"{filterName}_flux" and config.allowFluxless is False.

  • KeyError – Raised if a required coordinate column is missing from sourceCat, or (when flux is used and useCustomMagLimit is False) if filterName has no entry in policy:magLimitStar.yaml.