LSST Applications 24.1.5,g02d81e74bb+fa3a7a026e,g180d380827+a53a32eff8,g2079a07aa2+86d27d4dc4,g2305ad1205+c0501b3732,g295015adf3+7d3e92f0ec,g2bbee38e9b+0e5473021a,g337abbeb29+0e5473021a,g33d1c0ed96+0e5473021a,g3a166c0a6a+0e5473021a,g3ddfee87b4+5dd1654d75,g48712c4677+3bf1020dcb,g487adcacf7+065c13d9cf,g50ff169b8f+96c6868917,g52b1c1532d+585e252eca,g591dd9f2cf+d7ac436cfb,g5a732f18d5+53520f316c,g64a986408d+fa3a7a026e,g858d7b2824+fa3a7a026e,g8a8a8dda67+585e252eca,g99cad8db69+a5a909b84f,g9ddcbc5298+9a081db1e4,ga1e77700b3+15fc3df1f7,ga8c6da7877+4cf350ccb2,gb0e22166c9+60f28cb32d,gba4ed39666+c2a2e4ac27,gbb8dafda3b+f991a0b59f,gc120e1dc64+9ccbfdb8be,gc28159a63d+0e5473021a,gcf0d15dbbd+5dd1654d75,gd96a1ce819+42fd0ee607,gdaeeff99f8+f9a426f77a,ge6526c86ff+0d71447b4b,ge79ae78c31+0e5473021a,gee10cc3b42+585e252eca,gff1a9f87cc+fa3a7a026e
LSST Data Management Base Package
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | List of all members
lsst.meas.algorithms.matcherSourceSelector.MatcherSourceSelectorTask Class Reference
Inheritance diagram for lsst.meas.algorithms.matcherSourceSelector.MatcherSourceSelectorTask:
lsst.meas.algorithms.sourceSelector.BaseSourceSelectorTask

Public Member Functions

 __init__ (self, *args, **kwargs)
 
 selectSources (self, sourceCat, matches=None, exposure=None)
 

Public Attributes

 parentKey
 
 centroidXKey
 
 centroidYKey
 
 centroidFlagKey
 
 fluxField
 
 fluxKey
 
 fluxFlagKey
 
 fluxErrKey
 
 edgeKey
 
 interpolatedCenterKey
 
 saturatedKey
 

Static Public Attributes

 ConfigClass = MatcherSourceSelectorConfig
 

Protected Member Functions

 _getSchemaKeys (self, schema)
 
 _isParent (self, sourceCat)
 
 _hasCentroid (self, sourceCat)
 
 _goodSN (self, sourceCat)
 
 _isUsable (self, sourceCat)
 
 _isGood (self, sourceCat)
 

Detailed Description

Select sources that are useful for matching.

Good matching sources have high signal/noise, are non-blended. They need not
be PSF sources, just have reliable centroids.

Distinguished from astrometrySourceSelector because it is more lenient
(i.e. not checking footprints or bad flags).

Definition at line 59 of file matcherSourceSelector.py.

Constructor & Destructor Documentation

◆ __init__()

lsst.meas.algorithms.matcherSourceSelector.MatcherSourceSelectorTask.__init__ ( self,
* args,
** kwargs )

Reimplemented from lsst.meas.algorithms.sourceSelector.BaseSourceSelectorTask.

Definition at line 70 of file matcherSourceSelector.py.

70 def __init__(self, *args, **kwargs):
71 BaseSourceSelectorTask.__init__(self, *args, **kwargs)
72

Member Function Documentation

◆ _getSchemaKeys()

lsst.meas.algorithms.matcherSourceSelector.MatcherSourceSelectorTask._getSchemaKeys ( self,
schema )
protected
Extract and save the necessary keys from schema with asKey.

Definition at line 102 of file matcherSourceSelector.py.

102 def _getSchemaKeys(self, schema):
103 """Extract and save the necessary keys from schema with asKey.
104 """
105 self.parentKey = schema["parent"].asKey()
106 self.centroidXKey = schema["slot_Centroid_x"].asKey()
107 self.centroidYKey = schema["slot_Centroid_y"].asKey()
108 self.centroidFlagKey = schema["slot_Centroid_flag"].asKey()
109
110 fluxPrefix = "slot_%sFlux_" % (self.config.sourceFluxType,)
111 self.fluxField = fluxPrefix + "instFlux"
112 self.fluxKey = schema[fluxPrefix + "instFlux"].asKey()
113 self.fluxFlagKey = schema[fluxPrefix + "flag"].asKey()
114 self.fluxErrKey = schema[fluxPrefix + "instFluxErr"].asKey()
115
116 self.edgeKey = schema["base_PixelFlags_flag_edge"].asKey()
117 self.interpolatedCenterKey = schema["base_PixelFlags_flag_interpolatedCenter"].asKey()
118 self.saturatedKey = schema["base_PixelFlags_flag_saturated"].asKey()
119

◆ _goodSN()

lsst.meas.algorithms.matcherSourceSelector.MatcherSourceSelectorTask._goodSN ( self,
sourceCat )
protected
Return True for each source that has Signal/Noise > config.minSnr.

Definition at line 133 of file matcherSourceSelector.py.

133 def _goodSN(self, sourceCat):
134 """Return True for each source that has Signal/Noise > config.minSnr.
135 """
136 if self.config.minSnr <= 0:
137 return True
138 else:
139 with np.errstate(invalid="ignore"): # suppress NAN warnings
140 return sourceCat[self.fluxKey]/sourceCat[self.fluxErrKey] > self.config.minSnr
141

◆ _hasCentroid()

lsst.meas.algorithms.matcherSourceSelector.MatcherSourceSelectorTask._hasCentroid ( self,
sourceCat )
protected
Return True for each source that has a valid centroid

Definition at line 126 of file matcherSourceSelector.py.

126 def _hasCentroid(self, sourceCat):
127 """Return True for each source that has a valid centroid
128 """
129 return np.isfinite(sourceCat[self.centroidXKey]) \
130 & np.isfinite(sourceCat[self.centroidYKey]) \
131 & ~sourceCat[self.centroidFlagKey]
132

◆ _isGood()

lsst.meas.algorithms.matcherSourceSelector.MatcherSourceSelectorTask._isGood ( self,
sourceCat )
protected
Return True for each source that is usable for matching, even if it may
have a poor centroid.

For a source to be usable it must:

- Not be on a CCD edge.
- Not have an interpolated pixel within 3x3 around their centroid.
- Not have a saturated pixel in their footprint.

Definition at line 159 of file matcherSourceSelector.py.

159 def _isGood(self, sourceCat):
160 """
161 Return True for each source that is usable for matching, even if it may
162 have a poor centroid.
163
164 For a source to be usable it must:
165
166 - Not be on a CCD edge.
167 - Not have an interpolated pixel within 3x3 around their centroid.
168 - Not have a saturated pixel in their footprint.
169 """
170 return ~sourceCat[self.edgeKey] & \
171 ~sourceCat[self.interpolatedCenterKey] & \
172 ~sourceCat[self.saturatedKey]

◆ _isParent()

lsst.meas.algorithms.matcherSourceSelector.MatcherSourceSelectorTask._isParent ( self,
sourceCat )
protected
Return True for each source that is the parent source.

Definition at line 120 of file matcherSourceSelector.py.

120 def _isParent(self, sourceCat):
121 """Return True for each source that is the parent source.
122 """
123 test = (sourceCat[self.parentKey] == 0)
124 return test
125

◆ _isUsable()

lsst.meas.algorithms.matcherSourceSelector.MatcherSourceSelectorTask._isUsable ( self,
sourceCat )
protected
Return True for each source that is usable for matching, even if it may
have a poor centroid.

For a source to be usable it must:

- have a valid centroid
- not be deblended
- have a valid instFlux (of the type specified in this object's constructor)
- have adequate signal-to-noise

Definition at line 142 of file matcherSourceSelector.py.

142 def _isUsable(self, sourceCat):
143 """
144 Return True for each source that is usable for matching, even if it may
145 have a poor centroid.
146
147 For a source to be usable it must:
148
149 - have a valid centroid
150 - not be deblended
151 - have a valid instFlux (of the type specified in this object's constructor)
152 - have adequate signal-to-noise
153 """
154 return self._hasCentroid(sourceCat) \
155 & self._isParent(sourceCat) \
156 & self._goodSN(sourceCat) \
157 & ~sourceCat[self.fluxFlagKey]
158

◆ selectSources()

lsst.meas.algorithms.matcherSourceSelector.MatcherSourceSelectorTask.selectSources ( self,
sourceCat,
matches = None,
exposure = None )
Return a selection of sources that are useful for matching.

Parameters
----------
sourceCat : `lsst.afw.table.SourceCatalog`
    Catalog of sources to select from.
    This catalog must be contiguous in memory.
matches : `list` of `lsst.afw.table.ReferenceMatch` or None
    Ignored in this SourceSelector.
exposure : `lsst.afw.image.Exposure` or None
    The exposure the catalog was built from; used for debug display.

Returns
-------
struct : `lsst.pipe.base.Struct`
    The struct contains the following data:

    ``selected``
        Boolean array of sources that were selected, same length as
        sourceCat. (`numpy.ndarray` of `bool`)

Reimplemented from lsst.meas.algorithms.sourceSelector.BaseSourceSelectorTask.

Definition at line 73 of file matcherSourceSelector.py.

73 def selectSources(self, sourceCat, matches=None, exposure=None):
74 """Return a selection of sources that are useful for matching.
75
76 Parameters
77 ----------
78 sourceCat : `lsst.afw.table.SourceCatalog`
79 Catalog of sources to select from.
80 This catalog must be contiguous in memory.
81 matches : `list` of `lsst.afw.table.ReferenceMatch` or None
82 Ignored in this SourceSelector.
83 exposure : `lsst.afw.image.Exposure` or None
84 The exposure the catalog was built from; used for debug display.
85
86 Returns
87 -------
88 struct : `lsst.pipe.base.Struct`
89 The struct contains the following data:
90
91 ``selected``
92 Boolean array of sources that were selected, same length as
93 sourceCat. (`numpy.ndarray` of `bool`)
94 """
95 self._getSchemaKeys(sourceCat.schema)
96
97 good = self._isUsable(sourceCat)
98 if self.config.excludePixelFlags:
99 good = good & self._isGood(sourceCat)
100 return Struct(selected=good)
101

Member Data Documentation

◆ centroidFlagKey

lsst.meas.algorithms.matcherSourceSelector.MatcherSourceSelectorTask.centroidFlagKey

Definition at line 108 of file matcherSourceSelector.py.

◆ centroidXKey

lsst.meas.algorithms.matcherSourceSelector.MatcherSourceSelectorTask.centroidXKey

Definition at line 106 of file matcherSourceSelector.py.

◆ centroidYKey

lsst.meas.algorithms.matcherSourceSelector.MatcherSourceSelectorTask.centroidYKey

Definition at line 107 of file matcherSourceSelector.py.

◆ ConfigClass

lsst.meas.algorithms.matcherSourceSelector.MatcherSourceSelectorTask.ConfigClass = MatcherSourceSelectorConfig
static

Definition at line 68 of file matcherSourceSelector.py.

◆ edgeKey

lsst.meas.algorithms.matcherSourceSelector.MatcherSourceSelectorTask.edgeKey

Definition at line 116 of file matcherSourceSelector.py.

◆ fluxErrKey

lsst.meas.algorithms.matcherSourceSelector.MatcherSourceSelectorTask.fluxErrKey

Definition at line 114 of file matcherSourceSelector.py.

◆ fluxField

lsst.meas.algorithms.matcherSourceSelector.MatcherSourceSelectorTask.fluxField

Definition at line 111 of file matcherSourceSelector.py.

◆ fluxFlagKey

lsst.meas.algorithms.matcherSourceSelector.MatcherSourceSelectorTask.fluxFlagKey

Definition at line 113 of file matcherSourceSelector.py.

◆ fluxKey

lsst.meas.algorithms.matcherSourceSelector.MatcherSourceSelectorTask.fluxKey

Definition at line 112 of file matcherSourceSelector.py.

◆ interpolatedCenterKey

lsst.meas.algorithms.matcherSourceSelector.MatcherSourceSelectorTask.interpolatedCenterKey

Definition at line 117 of file matcherSourceSelector.py.

◆ parentKey

lsst.meas.algorithms.matcherSourceSelector.MatcherSourceSelectorTask.parentKey

Definition at line 105 of file matcherSourceSelector.py.

◆ saturatedKey

lsst.meas.algorithms.matcherSourceSelector.MatcherSourceSelectorTask.saturatedKey

Definition at line 118 of file matcherSourceSelector.py.


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