LSST Applications  21.0.0-147-g0e635eb1+1acddb5be5,22.0.0+052faf71bd,22.0.0+1ea9a8b2b2,22.0.0+6312710a6c,22.0.0+729191ecac,22.0.0+7589c3a021,22.0.0+9f079a9461,22.0.1-1-g7d6de66+b8044ec9de,22.0.1-1-g87000a6+536b1ee016,22.0.1-1-g8e32f31+6312710a6c,22.0.1-10-gd060f87+016f7cdc03,22.0.1-12-g9c3108e+df145f6f68,22.0.1-16-g314fa6d+c825727ab8,22.0.1-19-g93a5c75+d23f2fb6d8,22.0.1-19-gb93eaa13+aab3ef7709,22.0.1-2-g8ef0a89+b8044ec9de,22.0.1-2-g92698f7+9f079a9461,22.0.1-2-ga9b0f51+052faf71bd,22.0.1-2-gac51dbf+052faf71bd,22.0.1-2-gb66926d+6312710a6c,22.0.1-2-gcb770ba+09e3807989,22.0.1-20-g32debb5+b8044ec9de,22.0.1-23-gc2439a9a+fb0756638e,22.0.1-3-g496fd5d+09117f784f,22.0.1-3-g59f966b+1e6ba2c031,22.0.1-3-g849a1b8+f8b568069f,22.0.1-3-gaaec9c0+c5c846a8b1,22.0.1-32-g5ddfab5d3+60ce4897b0,22.0.1-4-g037fbe1+64e601228d,22.0.1-4-g8623105+b8044ec9de,22.0.1-5-g096abc9+d18c45d440,22.0.1-5-g15c806e+57f5c03693,22.0.1-7-gba73697+57f5c03693,master-g6e05de7fdc+c1283a92b8,master-g72cdda8301+729191ecac,w.2021.39
LSST Data Management Base Package
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
lsst.meas.astrom.matchOptimisticBTask.MatchOptimisticBTask Class Reference
Inheritance diagram for lsst.meas.astrom.matchOptimisticBTask.MatchOptimisticBTask:

Public Member Functions

def __init__ (self, **kwargs)
 
def filterStars (self, refCat)
 
def matchObjectsToSources (self, refCat, sourceCat, wcs, sourceFluxField, refFluxField, match_tolerance=None)
 

Public Attributes

 edgeKey
 
 interpolatedCenterKey
 
 saturatedKey
 

Static Public Attributes

 ConfigClass = MatchOptimisticBConfig
 

Detailed Description

Match sources to reference objects using the Optimistic Pattern Matcher
B algorithm of Tabur 2007.

Definition at line 103 of file matchOptimisticBTask.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.meas.astrom.matchOptimisticBTask.MatchOptimisticBTask.__init__ (   self,
**  kwargs 
)

Definition at line 110 of file matchOptimisticBTask.py.

110  def __init__(self, **kwargs):
111  pipeBase.Task.__init__(self, **kwargs)
112 

Member Function Documentation

◆ filterStars()

def lsst.meas.astrom.matchOptimisticBTask.MatchOptimisticBTask.filterStars (   self,
  refCat 
)
Extra filtering pass; subclass if desired.

Parameters
----------
refCat : `lsst.afw.table.SimpleCatalog`
    Catalog of reference objects.

Returns
-------
trimmedRefCat : `lsst.afw.table.SimpleCatalog`
    Reference catalog with some filtering applied. Currently no
    filtering is applied.

Definition at line 113 of file matchOptimisticBTask.py.

113  def filterStars(self, refCat):
114  """Extra filtering pass; subclass if desired.
115 
116  Parameters
117  ----------
118  refCat : `lsst.afw.table.SimpleCatalog`
119  Catalog of reference objects.
120 
121  Returns
122  -------
123  trimmedRefCat : `lsst.afw.table.SimpleCatalog`
124  Reference catalog with some filtering applied. Currently no
125  filtering is applied.
126  """
127  return refCat
128 

◆ matchObjectsToSources()

def lsst.meas.astrom.matchOptimisticBTask.MatchOptimisticBTask.matchObjectsToSources (   self,
  refCat,
  sourceCat,
  wcs,
  sourceFluxField,
  refFluxField,
  match_tolerance = None 
)
Match sources to position reference stars.

Parameters
----------
refCat : `lsst.afw.table.SimpleCatalog`
    Reference catalog to match.
sourceCat : `lsst.afw.table.SourceCatalog`
    Catalog of sources found on an exposure.  This should already be
    down-selected to "good"/"usable" sources in the calling Task.
wcs : `lsst.afw.geom.SkyWcs`
    Current WCS of the  exposure containing the sources.
sourceFluxField : `str`
    Field of the sourceCat to use for flux
refFluxField : `str`
    Field of the refCat to use for flux
match_tolerance : `lsst.meas.astrom.MatchTolerance`
    Object containing information from previous
    `lsst.meas.astrom.AstrometryTask` match/fit cycles for use in
    matching. If `None` is config defaults.

Returns
-------
matchResult : `lsst.pipe.base.Struct`
    Result struct with components

    - ``matches`` : List of matches with distance below the maximum match
      distance (`list` of `lsst.afw.table.ReferenceMatch`).
    - ``useableSourceCat`` : Catalog of sources matched and suited for
      WCS fitting (`lsst.afw.table.SourceCatalog`).
    - ``match_tolerance`` : MatchTolerance object updated from this
      match iteration (`lsst.meas.astrom.MatchTolerance`).

Definition at line 130 of file matchOptimisticBTask.py.

131  match_tolerance=None):
132  """Match sources to position reference stars.
133 
134  Parameters
135  ----------
136  refCat : `lsst.afw.table.SimpleCatalog`
137  Reference catalog to match.
138  sourceCat : `lsst.afw.table.SourceCatalog`
139  Catalog of sources found on an exposure. This should already be
140  down-selected to "good"/"usable" sources in the calling Task.
141  wcs : `lsst.afw.geom.SkyWcs`
142  Current WCS of the exposure containing the sources.
143  sourceFluxField : `str`
144  Field of the sourceCat to use for flux
145  refFluxField : `str`
146  Field of the refCat to use for flux
147  match_tolerance : `lsst.meas.astrom.MatchTolerance`
148  Object containing information from previous
149  `lsst.meas.astrom.AstrometryTask` match/fit cycles for use in
150  matching. If `None` is config defaults.
151 
152  Returns
153  -------
154  matchResult : `lsst.pipe.base.Struct`
155  Result struct with components
156 
157  - ``matches`` : List of matches with distance below the maximum match
158  distance (`list` of `lsst.afw.table.ReferenceMatch`).
159  - ``useableSourceCat`` : Catalog of sources matched and suited for
160  WCS fitting (`lsst.afw.table.SourceCatalog`).
161  - ``match_tolerance`` : MatchTolerance object updated from this
162  match iteration (`lsst.meas.astrom.MatchTolerance`).
163  """
164  import lsstDebug
165  debug = lsstDebug.Info(__name__)
166 
167  preNumObj = len(refCat)
168  refCat = self.filterStars(refCat)
169  numRefObj = len(refCat)
170 
171  if self.log:
172  self.log.info("filterStars purged %d reference stars, leaving %d stars" %
173  (preNumObj - numRefObj, numRefObj))
174 
175  if match_tolerance is None:
176  match_tolerance = MatchTolerance()
177 
178  # Make a name alias here for consistency with older code, and to make
179  # it clear that this is a good/usable (cleaned) source catalog.
180  usableSourceCat = sourceCat
181 
182  numUsableSources = len(usableSourceCat)
183 
184  if len(usableSourceCat) == 0:
185  raise pipeBase.TaskError("No sources are usable")
186 
187  minMatchedPairs = min(self.config.minMatchedPairs,
188  int(self.config.minFracMatchedPairs * min([len(refCat), len(usableSourceCat)])))
189 
190  # match usable (possibly saturated) sources and then purge saturated sources from the match list
191  usableMatches = self._doMatch(
192  refCat=refCat,
193  sourceCat=usableSourceCat,
194  wcs=wcs,
195  refFluxField=refFluxField,
196  numUsableSources=numUsableSources,
197  minMatchedPairs=minMatchedPairs,
198  maxMatchDist=match_tolerance.maxMatchDist,
199  sourceFluxField=sourceFluxField,
200  verbose=debug.verbose,
201  )
202 
203  # cull non-good sources
204  matches = []
205  self._getIsGoodKeys(usableSourceCat.schema)
206  for match in usableMatches:
207  if self._isGoodTest(match.second):
208  # Append the isGood match.
209  matches.append(match)
210 
211  self.log.debug("Found %d usable matches, of which %d had good sources",
212  len(usableMatches), len(matches))
213 
214  if len(matches) == 0:
215  raise RuntimeError("Unable to match sources")
216 
217  self.log.info("Matched %d sources" % len(matches))
218  if len(matches) < minMatchedPairs:
219  self.log.warn("Number of matches is smaller than request")
220 
221  return pipeBase.Struct(
222  matches=matches,
223  usableSourceCat=usableSourceCat,
224  match_tolerance=match_tolerance,
225  )
226 
int min

Member Data Documentation

◆ ConfigClass

lsst.meas.astrom.matchOptimisticBTask.MatchOptimisticBTask.ConfigClass = MatchOptimisticBConfig
static

Definition at line 107 of file matchOptimisticBTask.py.

◆ edgeKey

lsst.meas.astrom.matchOptimisticBTask.MatchOptimisticBTask.edgeKey

Definition at line 236 of file matchOptimisticBTask.py.

◆ interpolatedCenterKey

lsst.meas.astrom.matchOptimisticBTask.MatchOptimisticBTask.interpolatedCenterKey

Definition at line 237 of file matchOptimisticBTask.py.

◆ saturatedKey

lsst.meas.astrom.matchOptimisticBTask.MatchOptimisticBTask.saturatedKey

Definition at line 238 of file matchOptimisticBTask.py.


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