LSSTApplications  18.0.0+46,18.0.0+95,19.0.0,19.0.0+1,19.0.0+2,19.0.0+4,19.0.0+5,19.0.0+6,19.0.0-1-g20d9b18+2,19.0.0-1-g425ff20,19.0.0-1-g5549ca4,19.0.0-1-g580fafe+2,19.0.0-1-g5db401e+5,19.0.0-1-g6fe20d0+1,19.0.0-1-g7011481+4,19.0.0-1-g8c57eb9+2,19.0.0-1-gb5175dc+4,19.0.0-1-gd7f3e1b+4,19.0.0-1-gdc0e4a7+4,19.0.0-1-ge272bc4+2,19.0.0-1-gf46fa72,19.0.0-2-g0d9f9cd+4,19.0.0-2-g1c703f9ef+1,19.0.0-2-g3d9e4fb2+4,19.0.0-2-gd955cfd+4,19.0.0-2-gdbc0a5a+1,19.0.0-3-g2d13df8,19.0.0-3-g3c38ad5,19.0.0-4-g725f80e,19.0.0-7-gf796fef9+5,19.0.0-8-g608b899+1,w.2019.49
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()
52 
A FunctorKey used to get or set celestial coordinates from a pair of lsst::geom::Angle keys...
Definition: aggregates.h:210