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 | Static Public Attributes | List of all members
lsst.meas.astrom.matchPessimisticB.MatchPessimisticBTask Class Reference
Inheritance diagram for lsst.meas.astrom.matchPessimisticB.MatchPessimisticBTask:

Public Member Functions

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

Static Public Attributes

 ConfigClass = MatchPessimisticBConfig
 

Detailed Description

Match sources to reference objects.

Definition at line 178 of file matchPessimisticB.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.meas.astrom.matchPessimisticB.MatchPessimisticBTask.__init__ (   self,
**  kwargs 
)

Definition at line 185 of file matchPessimisticB.py.

185  def __init__(self, **kwargs):
186  pipeBase.Task.__init__(self, **kwargs)
187 

Member Function Documentation

◆ matchObjectsToSources()

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

refCat : `lsst.afw.table.SimpleCatalog`
    catalog of reference objects that overlap the exposure; reads
    fields for:

    - coord
    - the specified flux field

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`
    estimated WCS
sourceFluxField: `str`
    field of sourceCat to use for flux
refFluxField : `str`
    field of refCat to use for flux
match_tolerance : `lsst.meas.astrom.MatchTolerancePessimistic`
    is a MatchTolerance class object or `None`. This this class is used
    to communicate state between AstrometryTask and MatcherTask.
    AstrometryTask will also set the MatchTolerance class variable
    maxMatchDist based on the scatter AstrometryTask has found after
    fitting for the wcs.

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

    - ``matches`` : source to reference matches found (`list` of
      `lsst.afw.table.ReferenceMatch`)
    - ``usableSourceCat`` : a catalog of sources potentially usable for
      matching and WCS fitting (`lsst.afw.table.SourceCatalog`).
    - ``match_tolerance`` : a MatchTolerance object containing the
      resulting state variables from the match
      (`lsst.meas.astrom.MatchTolerancePessimistic`).

Definition at line 189 of file matchPessimisticB.py.

190  match_tolerance=None):
191  """Match sources to position reference stars
192 
193  refCat : `lsst.afw.table.SimpleCatalog`
194  catalog of reference objects that overlap the exposure; reads
195  fields for:
196 
197  - coord
198  - the specified flux field
199 
200  sourceCat : `lsst.afw.table.SourceCatalog`
201  Catalog of sources found on an exposure. This should already be
202  down-selected to "good"/"usable" sources in the calling Task.
203  wcs : `lsst.afw.geom.SkyWcs`
204  estimated WCS
205  sourceFluxField: `str`
206  field of sourceCat to use for flux
207  refFluxField : `str`
208  field of refCat to use for flux
209  match_tolerance : `lsst.meas.astrom.MatchTolerancePessimistic`
210  is a MatchTolerance class object or `None`. This this class is used
211  to communicate state between AstrometryTask and MatcherTask.
212  AstrometryTask will also set the MatchTolerance class variable
213  maxMatchDist based on the scatter AstrometryTask has found after
214  fitting for the wcs.
215 
216  Returns
217  -------
218  result : `lsst.pipe.base.Struct`
219  Result struct with components:
220 
221  - ``matches`` : source to reference matches found (`list` of
222  `lsst.afw.table.ReferenceMatch`)
223  - ``usableSourceCat`` : a catalog of sources potentially usable for
224  matching and WCS fitting (`lsst.afw.table.SourceCatalog`).
225  - ``match_tolerance`` : a MatchTolerance object containing the
226  resulting state variables from the match
227  (`lsst.meas.astrom.MatchTolerancePessimistic`).
228  """
229  import lsstDebug
230  debug = lsstDebug.Info(__name__)
231 
232  # If we get an empty tolerance struct create the variables we need for
233  # this matcher.
234  if match_tolerance is None:
235  match_tolerance = MatchTolerancePessimistic()
236 
237  # Make a name alias here for consistency with older code, and to make
238  # it clear that this is a good/usable (cleaned) source catalog.
239  goodSourceCat = sourceCat
240 
241  numUsableSources = len(goodSourceCat)
242 
243  if len(goodSourceCat) == 0:
244  raise pipeBase.TaskError("No sources are good")
245 
246  minMatchedPairs = min(self.config.minMatchedPairs,
247  int(self.config.minFracMatchedPairs
248  * min([len(refCat), len(goodSourceCat)])))
249 
250  if len(refCat) > self.config.maxRefObjects:
251  self.log.warning(
252  "WARNING: Reference catalog larger that maximum allowed. "
253  "Trimming to %i", self.config.maxRefObjects)
254  trimmedRefCat = self._filterRefCat(refCat, refFluxField)
255  else:
256  trimmedRefCat = refCat
257 
258  doMatchReturn = self._doMatch(
259  refCat=trimmedRefCat,
260  sourceCat=goodSourceCat,
261  wcs=wcs,
262  refFluxField=refFluxField,
263  numUsableSources=numUsableSources,
264  minMatchedPairs=minMatchedPairs,
265  match_tolerance=match_tolerance,
266  sourceFluxField=sourceFluxField,
267  verbose=debug.verbose,
268  )
269  matches = doMatchReturn.matches
270  match_tolerance = doMatchReturn.match_tolerance
271 
272  if len(matches) == 0:
273  raise RuntimeError("Unable to match sources")
274 
275  self.log.info("Matched %d sources", len(matches))
276  if len(matches) < minMatchedPairs:
277  self.log.warning("Number of matches is smaller than request")
278 
279  return pipeBase.Struct(
280  matches=matches,
281  usableSourceCat=goodSourceCat,
282  match_tolerance=match_tolerance,
283  )
284 
int min

Member Data Documentation

◆ ConfigClass

lsst.meas.astrom.matchPessimisticB.MatchPessimisticBTask.ConfigClass = MatchPessimisticBConfig
static

Definition at line 182 of file matchPessimisticB.py.


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