LSSTApplications  19.0.0-10-g920eed2,19.0.0-11-g48a0200+2,19.0.0-18-gfc4e62b+10,19.0.0-2-g3b2f90d+2,19.0.0-2-gd671419+5,19.0.0-20-g5a5a17ab+8,19.0.0-21-g2644856+10,19.0.0-22-gc5dc5b1+5,19.0.0-23-gdc29a50+2,19.0.0-24-g923e380+10,19.0.0-25-g6c8df7140,19.0.0-27-g567f04d+6,19.0.0-3-g2b32d65+5,19.0.0-3-g8227491+9,19.0.0-3-g9c54d0d+9,19.0.0-3-gca68e65+5,19.0.0-3-gcfc5f51+5,19.0.0-3-ge110943+8,19.0.0-3-ge74d124,19.0.0-3-gfe04aa6+10,19.0.0-4-g06f5963+5,19.0.0-4-g3d16501+10,19.0.0-4-g4a9c019+5,19.0.0-4-g5a8b323,19.0.0-4-g66397f0+1,19.0.0-4-g8278b9b+1,19.0.0-4-g8557e14,19.0.0-4-g8964aba+10,19.0.0-4-ge404a01+9,19.0.0-5-g40f3a5a,19.0.0-5-g4db63b3,19.0.0-5-gfb03ce7+10,19.0.0-6-gbaebbfb+9,19.0.0-60-gafafd468+10,19.0.0-64-gf672fef+7,19.0.0-7-g039c0b5+8,19.0.0-7-gbea9075+4,19.0.0-7-gc567de5+10,19.0.0-8-g3a3ce09+5,19.0.0-9-g463f923+9,w.2020.21
LSSTDataManagementBasePackage
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
lsst.meas.astrom.ref_match.RefMatchTask Class Reference
Inheritance diagram for lsst.meas.astrom.ref_match.RefMatchTask:
lsst.meas.astrom.astrometry.AstrometryTask

Public Member Functions

def __init__ (self, refObjLoader, **kwargs)
 
def setRefObjLoader (self, refObjLoader)
 
def loadAndMatch (self, exposure, sourceCat)
 

Public Attributes

 refObjLoader
 

Static Public Attributes

 ConfigClass = RefMatchConfig
 

Detailed Description

Match an input source catalog with objects from a reference catalog.

Parameters
----------
refObjLoader : `lsst.meas.algorithms.ReferenceLoader`
    A reference object loader object
**kwargs
    additional keyword arguments for pipe_base `lsst.pipe.base.Task`

Definition at line 76 of file ref_match.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.meas.astrom.ref_match.RefMatchTask.__init__ (   self,
  refObjLoader,
**  kwargs 
)

Definition at line 89 of file ref_match.py.

89  def __init__(self, refObjLoader, **kwargs):
90  pipeBase.Task.__init__(self, **kwargs)
91  if refObjLoader:
92  self.refObjLoader = refObjLoader
93  else:
94  self.refObjLoader = None
95 
96  if self.config.sourceSelector.name == 'matcher':
97  if self.config.sourceSelector['matcher'].sourceFluxType != self.config.sourceFluxType:
98  raise RuntimeError("The sourceFluxType in the sourceSelector['matcher'] must match "
99  "the configured sourceFluxType")
100 
101  self.makeSubtask("matcher")
102  self.makeSubtask("sourceSelector")
103  self.makeSubtask("referenceSelector")
104 

Member Function Documentation

◆ loadAndMatch()

def lsst.meas.astrom.ref_match.RefMatchTask.loadAndMatch (   self,
  exposure,
  sourceCat 
)
Load reference objects overlapping an exposure and match to sources
detected on that exposure.

Parameters
----------
exposure : `lsst.afw.image.Exposure`
    exposure that the sources overlap
sourceCat : `lsst.afw.table.SourceCatalog.`
    catalog of sources detected on the exposure

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

    - ``refCat`` : reference object catalog of objects that overlap the
      exposure (`lsst.afw.table.SimpleCatalog`)
    - ``matches`` :  Matched sources and references
      (`list` of `lsst.afw.table.ReferenceMatch`)
    - ``matchMeta`` : metadata needed to unpersist matches
      (`lsst.daf.base.PropertyList`)

Notes
-----
ignores config.matchDistanceSigma

Definition at line 116 of file ref_match.py.

116  def loadAndMatch(self, exposure, sourceCat):
117  """Load reference objects overlapping an exposure and match to sources
118  detected on that exposure.
119 
120  Parameters
121  ----------
122  exposure : `lsst.afw.image.Exposure`
123  exposure that the sources overlap
124  sourceCat : `lsst.afw.table.SourceCatalog.`
125  catalog of sources detected on the exposure
126 
127  Returns
128  -------
129  result : `lsst.pipe.base.Struct`
130  Result struct with Components:
131 
132  - ``refCat`` : reference object catalog of objects that overlap the
133  exposure (`lsst.afw.table.SimpleCatalog`)
134  - ``matches`` : Matched sources and references
135  (`list` of `lsst.afw.table.ReferenceMatch`)
136  - ``matchMeta`` : metadata needed to unpersist matches
137  (`lsst.daf.base.PropertyList`)
138 
139  Notes
140  -----
141  ignores config.matchDistanceSigma
142  """
143  if self.refObjLoader is None:
144  raise RuntimeError("Running matcher task with no refObjLoader set in __ini__ or setRefObjLoader")
145  import lsstDebug
146  debug = lsstDebug.Info(__name__)
147 
148  expMd = self._getExposureMetadata(exposure)
149 
150  sourceSelection = self.sourceSelector.run(sourceCat)
151 
152  sourceFluxField = "slot_%sFlux_instFlux" % (self.config.sourceFluxType)
153 
154  loadRes = self.refObjLoader.loadPixelBox(
155  bbox=expMd.bbox,
156  wcs=expMd.wcs,
157  filterName=expMd.filterName,
158  photoCalib=expMd.photoCalib,
159  )
160 
161  refSelection = self.referenceSelector.run(loadRes.refCat)
162 
163  matchMeta = self.refObjLoader.getMetadataBox(
164  bbox=expMd.bbox,
165  wcs=expMd.wcs,
166  filterName=expMd.filterName,
167  photoCalib=expMd.photoCalib,
168  )
169 
170  matchRes = self.matcher.matchObjectsToSources(
171  refCat=refSelection.sourceCat,
172  sourceCat=sourceSelection.sourceCat,
173  wcs=expMd.wcs,
174  sourceFluxField=sourceFluxField,
175  refFluxField=loadRes.fluxField,
176  match_tolerance=None,
177  )
178 
179  distStats = self._computeMatchStatsOnSky(matchRes.matches)
180  self.log.info(
181  "Found %d matches with scatter = %0.3f +- %0.3f arcsec; " %
182  (len(matchRes.matches), distStats.distMean.asArcseconds(), distStats.distStdDev.asArcseconds())
183  )
184 
185  if debug.display:
186  frame = int(debug.frame)
188  refCat=refSelection.sourceCat,
189  sourceCat=sourceSelection.sourceCat,
190  matches=matchRes.matches,
191  exposure=exposure,
192  bbox=expMd.bbox,
193  frame=frame,
194  title="Matches",
195  )
196 
197  return pipeBase.Struct(
198  refCat=loadRes.refCat,
199  refSelection=refSelection,
200  sourceSelection=sourceSelection,
201  matches=matchRes.matches,
202  matchMeta=matchMeta,
203  )
204 

◆ setRefObjLoader()

def lsst.meas.astrom.ref_match.RefMatchTask.setRefObjLoader (   self,
  refObjLoader 
)
Sets the reference object loader for the task

Parameters
----------
refObjLoader
    An instance of a reference object loader task or class

Definition at line 105 of file ref_match.py.

105  def setRefObjLoader(self, refObjLoader):
106  """Sets the reference object loader for the task
107 
108  Parameters
109  ----------
110  refObjLoader
111  An instance of a reference object loader task or class
112  """
113  self.refObjLoader = refObjLoader
114 

Member Data Documentation

◆ ConfigClass

lsst.meas.astrom.ref_match.RefMatchTask.ConfigClass = RefMatchConfig
static

Definition at line 86 of file ref_match.py.

◆ refObjLoader

lsst.meas.astrom.ref_match.RefMatchTask.refObjLoader

Definition at line 92 of file ref_match.py.


The documentation for this class was generated from the following file:
lsst::log.log.logContinued.info
def info(fmt, *args)
Definition: logContinued.py:198
lsst.pipe.tasks.assembleCoadd.run
def run(self, skyInfo, tempExpRefList, imageScalerList, weightList, altMaskList=None, mask=None, supplementaryData=None)
Definition: assembleCoadd.py:712
lsstDebug.Info
Definition: lsstDebug.py:28
lsst::meas::astrom.display.displayAstrometry
def displayAstrometry(refCat=None, sourceCat=None, distortedCentroidKey=None, bbox=None, exposure=None, matches=None, frame=1, title="", pause=True)
Definition: display.py:33