lsst.meas.algorithms g1581cd22ba+880e5d07f7
Loading...
Searching...
No Matches
lsst.meas.algorithms.setPrimaryFlags.SetPrimaryFlagsTask Class Reference
Inheritance diagram for lsst.meas.algorithms.setPrimaryFlags.SetPrimaryFlagsTask:

Public Member Functions

 __init__ (self, *, schema, isSingleFrame=False, **kwargs)
 
 run (self, sources, skyMap=None, tractInfo=None, patchInfo=None)
 

Public Attributes

 schema = schema
 
 isSingleFrame = isSingleFrame
 
bool includeDeblend = False
 
 isPatchInnerKey
 
 isTractInnerKey
 
 isPrimaryKey
 
 isDeblendedSourceKey
 
 fromBlendKey
 
 isIsolatedKey
 
 isDeblendedModelKey
 

Static Public Attributes

 ConfigClass = SetPrimaryFlagsConfig
 

Protected Member Functions

 _getPseudoSources (self, sources)
 

Static Protected Attributes

str _DefaultName = "setPrimaryFlags"
 

Detailed Description

Set the ``isPrimary`` flag and either various blendedness, or
patch/tract flags to a catalog (for single frame or coadd catalogs,
respectively), based on other properties of the sources.

Parameters
----------
schema : `lsst.afw.table.Schema`
    Source catalog schema to add fields to.
isSingleFrame : `bool`
    Flag specifying if task is operating with single frame imaging.
includeDeblend : `bool`
    Include deblend information in isPrimary and add blendedness fields?

Notes
-----
The tests for this task still live in
``pipe_tasks/tests/test_isPrimaryFlag.py``; see discussion on DM-42720.

Definition at line 36 of file setPrimaryFlags.py.

Constructor & Destructor Documentation

◆ __init__()

lsst.meas.algorithms.setPrimaryFlags.SetPrimaryFlagsTask.__init__ ( self,
* ,
schema,
isSingleFrame = False,
** kwargs )

Definition at line 59 of file setPrimaryFlags.py.

Member Function Documentation

◆ _getPseudoSources()

lsst.meas.algorithms.setPrimaryFlags.SetPrimaryFlagsTask._getPseudoSources ( self,
sources )
protected
Get a flag that marks pseudo sources.

Some categories of sources, for example sky objects, are not really
detected sources and should not be considered primary sources.

Parameters
----------
sources : `lsst.afw.table.SourceCatalog`
    The catalog of sources for which to identify "pseudo"
    (e.g. sky) objects.

Returns
-------
isPseudo : array-like of `bool`
    True for each source that is a pseudo source.
    Note: to remove pseudo sources use `~isPseudo`.

Definition at line 157 of file setPrimaryFlags.py.

◆ run()

lsst.meas.algorithms.setPrimaryFlags.SetPrimaryFlagsTask.run ( self,
sources,
skyMap = None,
tractInfo = None,
patchInfo = None )
Set isPrimary and related flags on sources.

For coadded imaging, the `isPrimary` flag returns True when an object
has no children, is in the inner region of a coadd patch, is in the
inner region of a coadd trach, and is not detected in a pseudo-filter
(e.g., a sky_object).
For single frame imaging, the isPrimary flag returns True when a
source has no children and is not a sky source.

Parameters
----------
sources : `lsst.afw.table.SourceCatalog`
    A sourceTable. Reads in centroid fields and an nChild field.
    Writes is-patch-inner, is-tract-inner, and is-primary flags.
skyMap : `lsst.skymap.BaseSkyMap`
    Sky tessellation object
tractInfo : `lsst.skymap.TractInfo`, optional
    Tract object; required if ``self.isSingleFrame`` is False.
patchInfo : `lsst.skymap.PatchInfo`
    Patch object; required if ``self.isSingleFrame`` is False.

Definition at line 104 of file setPrimaryFlags.py.

Member Data Documentation

◆ _DefaultName

str lsst.meas.algorithms.setPrimaryFlags.SetPrimaryFlagsTask._DefaultName = "setPrimaryFlags"
staticprotected

Definition at line 56 of file setPrimaryFlags.py.

◆ ConfigClass

lsst.meas.algorithms.setPrimaryFlags.SetPrimaryFlagsTask.ConfigClass = SetPrimaryFlagsConfig
static

Definition at line 57 of file setPrimaryFlags.py.

◆ fromBlendKey

lsst.meas.algorithms.setPrimaryFlags.SetPrimaryFlagsTask.fromBlendKey
Initial value:
= self.schema.addField(
"detect_fromBlend", type="Flag",
doc="This source is deblended from a parent with more than one child."
)

Definition at line 89 of file setPrimaryFlags.py.

◆ includeDeblend

bool lsst.meas.algorithms.setPrimaryFlags.SetPrimaryFlagsTask.includeDeblend = False

Definition at line 63 of file setPrimaryFlags.py.

◆ isDeblendedModelKey

lsst.meas.algorithms.setPrimaryFlags.SetPrimaryFlagsTask.isDeblendedModelKey
Initial value:
= self.schema.addField(
"detect_isDeblendedModelSource", type="Flag",
doc=primaryDoc + " and is a deblended child")

Definition at line 98 of file setPrimaryFlags.py.

◆ isDeblendedSourceKey

lsst.meas.algorithms.setPrimaryFlags.SetPrimaryFlagsTask.isDeblendedSourceKey
Initial value:
= self.schema.addField(
"detect_isDeblendedSource", type="Flag",
doc=primaryDoc + " and is either an unblended isolated source or a "
"deblended child from a parent with 'deblend_nChild' > 1")

Definition at line 85 of file setPrimaryFlags.py.

◆ isIsolatedKey

lsst.meas.algorithms.setPrimaryFlags.SetPrimaryFlagsTask.isIsolatedKey
Initial value:
= self.schema.addField(
"detect_isIsolated", type="Flag",
doc="This source is not a part of a blend."
)

Definition at line 93 of file setPrimaryFlags.py.

◆ isPatchInnerKey

lsst.meas.algorithms.setPrimaryFlags.SetPrimaryFlagsTask.isPatchInnerKey
Initial value:
= self.schema.addField(
"detect_isPatchInner", type="Flag",
doc="True if source is in the inner region of a coadd patch",
)

Definition at line 68 of file setPrimaryFlags.py.

◆ isPrimaryKey

lsst.meas.algorithms.setPrimaryFlags.SetPrimaryFlagsTask.isPrimaryKey
Initial value:
= self.schema.addField(
"detect_isPrimary", type="Flag",
doc=primaryDoc,
)

Definition at line 78 of file setPrimaryFlags.py.

◆ isSingleFrame

lsst.meas.algorithms.setPrimaryFlags.SetPrimaryFlagsTask.isSingleFrame = isSingleFrame

Definition at line 62 of file setPrimaryFlags.py.

◆ isTractInnerKey

lsst.meas.algorithms.setPrimaryFlags.SetPrimaryFlagsTask.isTractInnerKey
Initial value:
= self.schema.addField(
"detect_isTractInner", type="Flag",
doc="True if source is in the inner region of a coadd tract",
)

Definition at line 72 of file setPrimaryFlags.py.

◆ schema

lsst.meas.algorithms.setPrimaryFlags.SetPrimaryFlagsTask.schema = schema

Definition at line 61 of file setPrimaryFlags.py.


The documentation for this class was generated from the following file: