LSST Applications  21.0.0-172-gfb10e10a+18fedfabac,22.0.0+297cba6710,22.0.0+80564b0ff1,22.0.0+8d77f4f51a,22.0.0+a28f4c53b1,22.0.0+dcf3732eb2,22.0.1-1-g7d6de66+2a20fdde0d,22.0.1-1-g8e32f31+297cba6710,22.0.1-1-geca5380+7fa3b7d9b6,22.0.1-12-g44dc1dc+2a20fdde0d,22.0.1-15-g6a90155+515f58c32b,22.0.1-16-g9282f48+790f5f2caa,22.0.1-2-g92698f7+dcf3732eb2,22.0.1-2-ga9b0f51+7fa3b7d9b6,22.0.1-2-gd1925c9+bf4f0e694f,22.0.1-24-g1ad7a390+a9625a72a8,22.0.1-25-g5bf6245+3ad8ecd50b,22.0.1-25-gb120d7b+8b5510f75f,22.0.1-27-g97737f7+2a20fdde0d,22.0.1-32-gf62ce7b1+aa4237961e,22.0.1-4-g0b3f228+2a20fdde0d,22.0.1-4-g243d05b+871c1b8305,22.0.1-4-g3a563be+32dcf1063f,22.0.1-4-g44f2e3d+9e4ab0f4fa,22.0.1-42-gca6935d93+ba5e5ca3eb,22.0.1-5-g15c806e+85460ae5f3,22.0.1-5-g58711c4+611d128589,22.0.1-5-g75bb458+99c117b92f,22.0.1-6-g1c63a23+7fa3b7d9b6,22.0.1-6-g50866e6+84ff5a128b,22.0.1-6-g8d3140d+720564cf76,22.0.1-6-gd805d02+cc5644f571,22.0.1-8-ge5750ce+85460ae5f3,master-g6e05de7fdc+babf819c66,master-g99da0e417a+8d77f4f51a,w.2021.48
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 104 of file matchOptimisticBTask.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 111 of file matchOptimisticBTask.py.

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

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 114 of file matchOptimisticBTask.py.

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

◆ 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 131 of file matchOptimisticBTask.py.

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

Member Data Documentation

◆ ConfigClass

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

Definition at line 108 of file matchOptimisticBTask.py.

◆ edgeKey

lsst.meas.astrom.matchOptimisticBTask.MatchOptimisticBTask.edgeKey

Definition at line 237 of file matchOptimisticBTask.py.

◆ interpolatedCenterKey

lsst.meas.astrom.matchOptimisticBTask.MatchOptimisticBTask.interpolatedCenterKey

Definition at line 238 of file matchOptimisticBTask.py.

◆ saturatedKey

lsst.meas.astrom.matchOptimisticBTask.MatchOptimisticBTask.saturatedKey

Definition at line 239 of file matchOptimisticBTask.py.


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