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 | 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 177 of file matchPessimisticB.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 184 of file matchPessimisticB.py.

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

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 188 of file matchPessimisticB.py.

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

Member Data Documentation

◆ ConfigClass

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

Definition at line 181 of file matchPessimisticB.py.


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