Fundamental differences between the Coord classes and SpherePoint:
SpherePoint has no coordinate system. Thus it has none of the methods associated with converting from one coordinate system to another.
Our convention (which is enforced by SkyWcs) is that sky coordinates are always ICRS (never FK5, Galactic, etc.). If you want to work with other coordinate systems please do it in Python using astropy. That said, SpherePoint can represent any sort of spherical point. For example
VisitInfo.boresightAzAltis a SpherePoint.
SpherePoint is immutable.
As a result, those methods that mutated the object in place must now return a new object. This applies to
offset. Warning old code that calls
offsetwill now silently do nothing!
Also there is no
clonemethod, since it would be pointless.
SpherePoint is not polymorphic, so there is no special C++ support for
lsst.afw.geom.averageSpherePointtakes a vector of SpherePoint and returns a SpherePoint, unlike
coord.averageCoord, which takes a vector of
std::shared_ptr<Coord>and returns a
std::shared_ptr<Coord>. This change is only visible in C++.
In detail, change the following, noting that the Coord classes are in lsst.afw.coord and SpherePoint is in lsst.afw.geom:
IcrsCoord, etc.) to
SpherePoint(long, lat, units)
assertSpherePoint..., and the
maxDiffargument is renamed to
bearingTofor the first, second returned Angle, respectively
SpherePoint.getPosition(units)requires a units argument (the Coord version defaulted to degrees). Also, both components are returned in the specified units, unlike
Coord.getPosition(hours)which returns the longitude in hours and the latitude in degrees.
offset, but it returns the offset point instead of modifying the existing point
rotated, which returns a new SpherePoint
averageSpherePoint. In C++
std::vector<SpherePoint>and returns a
averageCoord, which takes a vector of shared_ptr and returns a shared_ptr. The Python interface is unchanged.
Things that are not available:
makeCoord(as explained above)
- Coord methods:
afw.table now takes and returns
SpherePoint. Table schemas and data remain unchanged.
CoordKey uses field name suffixes
_dec, so it is intended for ICRS sky coordinates. My recommendation for storing other longitude, latitude pairs, such as azimuth, altitude, is to use two scalar keys with appropriate field name suffixes (e.g.