LSSTApplications  20.0.0
LSSTDataManagementBasePackage
Functions
lsst.meas.astrom.setMatchDistance Namespace Reference

Functions

def setMatchDistance (matches)
 

Function Documentation

◆ setMatchDistance()

def lsst.meas.astrom.setMatchDistance.setMatchDistance (   matches)
Set the distance field of the matches in a match list to the distance in
radians on the sky.

Parameters
----------
matches : `list` of `lsst.afw.table.ReferenceMatch`
    a list of matches, reads the coord field of the source and reference
    object of each match writes the distance field of each match

Notes
-----
.. warning::
   the coord field of the source in each match must be correct

Definition at line 28 of file setMatchDistance.py.

28 def setMatchDistance(matches):
29  """Set the distance field of the matches in a match list to the distance in
30  radians on the sky.
31 
32  Parameters
33  ----------
34  matches : `list` of `lsst.afw.table.ReferenceMatch`
35  a list of matches, reads the coord field of the source and reference
36  object of each match writes the distance field of each match
37 
38  Notes
39  -----
40  .. warning::
41  the coord field of the source in each match must be correct
42  """
43  if len(matches) < 1:
44  return
45 
46  sourceCoordKey = afwTable.CoordKey(matches[0].first.schema["coord"])
47  refObjCoordKey = afwTable.CoordKey(matches[0].second.schema["coord"])
48  for match in matches:
49  sourceCoord = match.first.get(sourceCoordKey)
50  refObjCoord = match.second.get(refObjCoordKey)
51  match.distance = refObjCoord.separation(sourceCoord).asRadians()
lsst::afw::table::CoordKey
A FunctorKey used to get or set celestial coordinates from a pair of lsst::geom::Angle keys.
Definition: aggregates.h:210
lsst::meas::astrom.setMatchDistance.setMatchDistance
def setMatchDistance(matches)
Definition: setMatchDistance.py:28