Loading [MathJax]/jax/output/HTML-CSS/config.js
LSST Applications g0000d66e7c+c494921ce2,g0485b4d2cb+c8d56b10d4,g0fba68d861+5edec0d8fd,g1ec0fe41b4+3e153770da,g1fd858c14a+fca1f36da6,g2440f9efcc+8c5ae1fdc5,g35bb328faa+8c5ae1fdc5,g4d2262a081+c7405b0ea5,g53246c7159+8c5ae1fdc5,g56a49b3a55+8699aedcf1,g60b5630c4e+2a1e2fbeda,g67b6fd64d1+035c836e50,g78460c75b0+7e33a9eb6d,g786e29fd12+668abc6043,g7ac00fbb6c+9a90021cfb,g8352419a5c+8c5ae1fdc5,g8852436030+5e76f8a839,g89139ef638+035c836e50,g94187f82dc+2a1e2fbeda,g989de1cb63+035c836e50,g9d31334357+2a1e2fbeda,g9f33ca652e+3552fd4ab0,ga815be3f0b+18fb55f1cc,gabe3b4be73+8856018cbb,gabf8522325+21619da9f3,gb1101e3267+d93ea6153f,gb89ab40317+035c836e50,gc91f06edcd+512a684587,gcef618a4dd+2a1e2fbeda,gcf25f946ba+5e76f8a839,gd6cbbdb0b4+958adf5c1f,gde0f65d7ad+ffac69d1db,ge278dab8ac+83c63f4893,ge410e46f29+035c836e50,gf35d7ec915+97dd712d81,gf5e32f922b+8c5ae1fdc5,gf67bdafdda+035c836e50,gf6800124b1+2c49cd4815,w.2025.19
LSST Data Management Base Package
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
lsst.meas.astrom.setMatchDistance Namespace Reference

Functions

 setMatchDistance (matches)
 

Function Documentation

◆ setMatchDistance()

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.

28def 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()
A FunctorKey used to get or set celestial coordinates from a pair of lsst::geom::Angle keys.
Definition aggregates.h:292