25 #if !defined(LSST_AFW_COORD_COORD_H)
26 #define LSST_AFW_COORD_COORD_H
39 #include "boost/shared_ptr.hpp"
61 class TopocentricCoord;
72 typedef boost::shared_ptr<Coord>
Ptr;
73 typedef boost::shared_ptr<Coord const>
ConstPtr;
80 Coord(std::string
const ra, std::string
const dec,
double const epoch = 2000.0);
87 double const epoch = 2000.0;
88 reset(longitude, latitude, epoch);
98 return std::pair<std::string, std::string>(
"RA",
"Dec");
128 std::pair<lsst::afw::geom::Angle, lsst::afw::geom::Angle>
getOffsetFrom(
Coord const &c)
const;
159 typedef boost::shared_ptr<IcrsCoord>
Ptr;
165 IcrsCoord(std::string
const ra, std::string
const dec) :
Coord(ra, dec, 2000.0) {}
194 typedef boost::shared_ptr<Fk5Coord>
Ptr;
197 Coord(p2d, unit, epoch) {}
203 Coord(ra, dec, epoch) {}
204 Fk5Coord(std::string
const ra, std::string
const dec,
double const epoch = 2000.0) :
205 Coord(ra, dec, epoch) {}
240 typedef boost::shared_ptr<GalacticCoord>
Ptr;
257 return std::pair<std::string, std::string>(
"L",
"B");
281 typedef boost::shared_ptr<EclipticCoord>
Ptr;
285 double const epoch = 2000.0) :
286 Coord(p2d, unit, epoch) {}
294 double const epoch = 2000.0) :
295 Coord(lamb, beta, epoch) {}
297 Coord(lamb, beta, epoch) {}
306 return std::pair<std::string, std::string>(
"Lambda",
"Beta");
332 typedef boost::shared_ptr<TopocentricCoord>
Ptr;
347 virtual std::string
getClassName()
const {
return "TopocentricCoord"; }
352 return std::pair<std::string, std::string>(
"Az",
"Alt");
428 throw LSST_EXCEPT(lsst::pex::exceptions::InvalidParameterError,
429 "Index must be 0 or 1.");
449 throw LSST_EXCEPT(lsst::pex::exceptions::InvalidParameterError,
450 "Units must be 'degrees' or 'hours'");
477 return !(lhs == rhs);
virtual Fk5Coord toFk5() const
Convert ourself from Ecliptic to Fk5 (use current epoch)
GalacticCoord(lsst::afw::geom::Point3D const &p3d, bool normalize=true, lsst::afw::geom::Angle const defaultLongitude=lsst::afw::geom::Angle(0.))
virtual IcrsCoord toIcrs() const
Icrs converter for IcrsCoord. (ie. a no-op)
boost::shared_ptr< Coord > Ptr
std::string getAltitudeStr() const
lsst::afw::geom::Angle getB() const
A coordinate class intended to represent absolute positions.
virtual EclipticCoord toEcliptic() const
Convert ourself to Ecliptic: lambda, beta (use existing epoch)
Fk5Coord(lsst::afw::geom::Point2D const &p2d, lsst::afw::geom::AngleUnit unit=lsst::afw::geom::degrees, double const epoch=2000.0)
Class for handling dates/times, including MJD, UTC, and TAI.
EclipticCoord(std::string const lamb, std::string const beta, double const epoch=2000.0)
lsst::afw::geom::Angle _longitude
virtual GalacticCoord toGalactic() const
Convert ourself to Galactic: l, b.
lsst::afw::geom::Angle getDec() const
virtual void reset(lsst::afw::geom::Angle const longitude, lsst::afw::geom::Angle const latitude)
special reset() overload to make sure no epoch can be set
A class to handle Galactic coordinates (inherits from Coord)
GalacticCoord(lsst::afw::geom::Point2D const &p2d, lsst::afw::geom::AngleUnit unit=lsst::afw::geom::degrees)
virtual std::pair< std::string, std::string > getCoordNames() const
lsst::afw::geom::Angle hmsStringToAngle(std::string const hms)
Convert a hh:mm:ss string to Angle.
virtual Fk5Coord toFk5() const
Convert ourself to Fk5 (ie. a no-op): RA, Dec (keep current epoch)
Store information about an observatory ... lat/long, elevation.
virtual Coord::Ptr clone() const
virtual std::string getClassName() const
boost::shared_ptr< Fk5Coord > Ptr
boost::shared_ptr< TopocentricCoord > Ptr
lsst::afw::geom::Angle getAzimuth() const
std::string getLongitudeStr(lsst::afw::geom::AngleUnit unit) const
Allow quick access to the longitudinal coordinate as a string.
bool operator!=(lsst::afw::coord::Coord const &lhs, lsst::afw::coord::Coord const &rhs)
Inequality; the complement of equality.
EclipticCoord precess(double const epochTo) const
precess to new epoch
virtual std::string getClassName() const
virtual Fk5Coord toFk5() const
Convert outself from Topocentric to Fk5 (use current epoch)
virtual TopocentricCoord toTopocentric(Observatory const &obs, lsst::daf::base::DateTime const &obsDate) const
Convert ourself to Altitude/Azimuth: alt, az.
std::pair< lsst::afw::geom::Angle, lsst::afw::geom::Angle > getTangentPlaneOffset(Coord const &c) const
Get the offset on the tangent plane.
IcrsCoord(std::string const ra, std::string const dec)
Fk5Coord precess(double const epochTo) const
Precess ourselves from whence we are to a new epoch.
lsst::afw::geom::Angle getLambda() const
virtual TopocentricCoord toTopocentric() const
Convert ourself from Topocentric to Topocentric with no observatory or date arguments.
Coord()
Default constructor for the Coord base class.
lsst::afw::geom::Angle getAltitude() const
std::pair< lsst::afw::geom::Angle, lsst::afw::geom::Angle > getOffsetFrom(Coord const &c) const
Compute the offset from a coordinate.
lsst::afw::coord::IcrsCoord IcrsCoord
Class to hold observatory information.
virtual IcrsCoord toIcrs() const
Convert ourself to ICRS: RA, Dec (basically J2000)
Fk5Coord(lsst::afw::geom::Point3D const &p3d, double const epoch=2000.0, bool normalize=true, lsst::afw::geom::Angle const defaultLongitude=lsst::afw::geom::Angle(0.))
void rotate(Coord const &axis, lsst::afw::geom::Angle const theta)
Rotate our current coords about a pole.
A class used to convert scalar POD types such as double to Angle.
void _verifyValues() const
Make sure the values we've got are in the range 0 <= x < 2PI.
virtual void reset(lsst::afw::geom::Angle const longitude, lsst::afw::geom::Angle const latitude)
Observatory getObservatory() const
std::ostream & operator<<(std::ostream &os, Coord const &coord)
lsst::afw::geom::Angle _latitude
virtual std::pair< std::string, std::string > getCoordNames() const
TopocentricCoord(lsst::afw::geom::Angle const az, lsst::afw::geom::Angle const alt, double const epoch, Observatory const &obs)
std::string getLambdaStr(lsst::afw::geom::AngleUnit unit) const
virtual Coord::Ptr clone() const
std::string getBetaStr() const
virtual std::string getClassName() const
virtual Fk5Coord toFk5() const
Convert ourself from galactic to Fk5 (no epoch specified)
A class to handle topocentric (AltAz) coordinates (inherits from Coord)
boost::shared_ptr< IcrsCoord > Ptr
std::string getAzimuthStr(lsst::afw::geom::AngleUnit unit) const
virtual Fk5Coord toFk5() const
Convert ourself to Fk5: RA, Dec (use current epoch)
IcrsCoord(lsst::afw::geom::Point3D const &p3d, bool normalize=true, lsst::afw::geom::Angle const defaultLongitude=lsst::afw::geom::Angle(0.))
GalacticCoord(std::string const l, std::string const b)
EclipticCoord(lsst::afw::geom::Angle const lamb, lsst::afw::geom::Angle const beta, double const epoch=2000.0)
virtual EclipticCoord toEcliptic() const
Convert ourself to Ecliptic: lambda, beta (use current epoch)
virtual Coord::Ptr clone() const
TopocentricCoord(lsst::afw::geom::Point3D const &p3d, double const epoch, Observatory const &obs, bool normalize=true, lsst::afw::geom::Angle const defaultLongitude=lsst::afw::geom::Angle(0.))
virtual Coord::Ptr clone() const
lsst::afw::geom::Angle getDec() const
Coord::Ptr makeCoord(CoordSystem const system, lsst::afw::geom::Angle const ra, lsst::afw::geom::Angle const dec, double const epoch)
Factory function to create a Coord of arbitrary type with decimal RA,Dec.
EclipticCoord(lsst::afw::geom::Point2D const &p2d, lsst::afw::geom::AngleUnit unit=lsst::afw::geom::degrees, double const epoch=2000.0)
bool operator==(Coord const &rhs) const
Equality operator, compares each element directly.
lsst::afw::geom::Angle getBeta() const
std::string angleToDmsString(lsst::afw::geom::Angle const deg)
a Function to convert a coordinate in decimal degrees to a string with form dd:mm:ss ...
lsst::afw::geom::Angle offset(lsst::afw::geom::Angle const phi, lsst::afw::geom::Angle const arcLen)
offset our current coords along a great circle defined by an angle wrt a declination parallel ...
std::string angleToHmsString(lsst::afw::geom::Angle const deg)
a function to convert decimal degrees to a string with form hh:mm:ss.s
std::string getRaStr(lsst::afw::geom::AngleUnit unit) const
std::string getLatitudeStr() const
Allow quick access to the longitude coordinate as a string.
virtual void reset(lsst::afw::geom::Angle const longitude, lsst::afw::geom::Angle const latitude)
special reset() overload to make sure no epoch can be set
A class to handle Fk5 coordinates (inherits from Coord)
std::string getRaStr(lsst::afw::geom::AngleUnit unit) const
virtual GalacticCoord toGalactic() const
Convert ourself to Galactic: l, b.
#define LSST_EXCEPT(type,...)
A class to handle Ecliptic coordinates (inherits from Coord)
virtual std::string getClassName() const
boost::shared_ptr< EclipticCoord > Ptr
virtual std::pair< std::string, std::string > getCoordNames() const
virtual std::string getClassName() const
lsst::afw::geom::Angle getRa() const
lsst::afw::geom::Angle getLongitude() const
The main access method for the longitudinal coordinate.
virtual IcrsCoord toIcrs() const
Convert ourself to ICRS: RA, Dec (basically J2000)
TopocentricCoord(std::string const az, std::string const alt, double const epoch, Observatory const &obs)
virtual std::string getClassName() const
GalacticCoord(lsst::afw::geom::Angle const l, lsst::afw::geom::Angle const b)
lsst::afw::geom::Angle operator[](int const index) const
Provide access to our contents via an index.
afw::table::Key< double > b
IcrsCoord(lsst::afw::geom::Angle const ra, lsst::afw::geom::Angle const dec)
virtual Coord::Ptr clone() const
CoordSystem makeCoordEnum(std::string const system)
A utility function to get the enum value of a coordinate system from a string name.
std::string getDecStr() const
virtual Fk5Coord toFk5() const
Fk5 converter for IcrsCoord. (no epoch specified)
lsst::afw::geom::Angle getL() const
virtual GalacticCoord toGalactic() const
Convert ourself from Galactic to Galactic ... a no-op.
Coord::Ptr convert(CoordSystem system) const
Convert to a specified Coord type.
boost::shared_ptr< Coord const > ConstPtr
lsst::afw::geom::Point3D getVector() const
Return our contents in a position vector.
virtual Coord::Ptr clone() const
Fk5Coord(lsst::afw::geom::Angle const ra, lsst::afw::geom::Angle const dec, double const epoch=2000.0)
std::string getBStr() const
lsst::afw::geom::Angle getLatitude() const
The main access method for the latitudinal coordinate.
EclipticCoord(lsst::afw::geom::Point3D const &p3d, double const epoch=2000.0, bool normalize=true, lsst::afw::geom::Angle const defaultLongitude=lsst::afw::geom::Angle(0.))
Fk5Coord(std::string const ra, std::string const dec, double const epoch=2000.0)
std::string getDecStr() const
lsst::afw::geom::Angle getRa() const
A class to handle Icrs coordinates (inherits from Coord)
lsst::afw::geom::Angle dmsStringToAngle(std::string const dms)
Convert a dd:mm:ss string to Angle.
boost::shared_ptr< GalacticCoord > Ptr
virtual std::pair< std::string, std::string > getCoordNames() const
virtual EclipticCoord toEcliptic() const
Convert ourself from Ecliptic to Ecliptic ... a no-op (use the current epoch)
std::string getLStr(lsst::afw::geom::AngleUnit unit) const
lsst::afw::geom::Point2D getPosition(lsst::afw::geom::AngleUnit unit=lsst::afw::geom::degrees) const
Return our contents in a Point2D object.
TopocentricCoord(lsst::afw::geom::Point2D const &p2d, lsst::afw::geom::AngleUnit unit, double const epoch, Observatory const &obs)
lsst::afw::geom::Angle eclipticPoleInclination(double const epoch)
get the inclination of the ecliptic pole (obliquity) at epoch
IcrsCoord(lsst::afw::geom::Point2D const &p2d, lsst::afw::geom::AngleUnit unit=lsst::afw::geom::degrees)
Coord transform(Coord const &poleFrom, Coord const &poleTo) const
Tranform our current coords to another spherical polar system.
lsst::afw::geom::Angle angularSeparation(Coord const &c) const
compute the angular separation between two Coords
virtual TopocentricCoord toTopocentric(Observatory const &obs, lsst::daf::base::DateTime const &obsDate) const
Convert ourself to Altitude/Azimuth: alt, az.