LSST Applications  21.0.0+04719a4bac,21.0.0-1-ga51b5d4+f5e6047307,21.0.0-11-g2b59f77+a9c1acf22d,21.0.0-11-ga42c5b2+86977b0b17,21.0.0-12-gf4ce030+76814010d2,21.0.0-13-g1721dae+760e7a6536,21.0.0-13-g3a573fe+768d78a30a,21.0.0-15-g5a7caf0+f21cbc5713,21.0.0-16-g0fb55c1+b60e2d390c,21.0.0-19-g4cded4ca+71a93a33c0,21.0.0-2-g103fe59+bb20972958,21.0.0-2-g45278ab+04719a4bac,21.0.0-2-g5242d73+3ad5d60fb1,21.0.0-2-g7f82c8f+8babb168e8,21.0.0-2-g8f08a60+06509c8b61,21.0.0-2-g8faa9b5+616205b9df,21.0.0-2-ga326454+8babb168e8,21.0.0-2-gde069b7+5e4aea9c2f,21.0.0-2-gecfae73+1d3a86e577,21.0.0-2-gfc62afb+3ad5d60fb1,21.0.0-25-g1d57be3cd+e73869a214,21.0.0-3-g357aad2+ed88757d29,21.0.0-3-g4a4ce7f+3ad5d60fb1,21.0.0-3-g4be5c26+3ad5d60fb1,21.0.0-3-g65f322c+e0b24896a3,21.0.0-3-g7d9da8d+616205b9df,21.0.0-3-ge02ed75+a9c1acf22d,21.0.0-4-g591bb35+a9c1acf22d,21.0.0-4-g65b4814+b60e2d390c,21.0.0-4-gccdca77+0de219a2bc,21.0.0-4-ge8a399c+6c55c39e83,21.0.0-5-gd00fb1e+05fce91b99,21.0.0-6-gc675373+3ad5d60fb1,21.0.0-64-g1122c245+4fb2b8f86e,21.0.0-7-g04766d7+cd19d05db2,21.0.0-7-gdf92d54+04719a4bac,21.0.0-8-g5674e7b+d1bd76f71f,master-gac4afde19b+a9c1acf22d,w.2021.13
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: