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 std::string getClassName() const
GalacticCoord(std::string const l, std::string const b)
lsst::afw::geom::Point2D getPosition(lsst::afw::geom::AngleUnit unit=lsst::afw::geom::degrees) const
Return our contents in a Point2D object.
virtual Coord::Ptr clone() const
boost::shared_ptr< Coord const > ConstPtr
A coordinate class intended to represent absolute positions.
EclipticCoord(lsst::afw::geom::Point2D const &p2d, lsst::afw::geom::AngleUnit unit=lsst::afw::geom::degrees, double const epoch=2000.0)
virtual Fk5Coord toFk5() const
Convert ourself to Fk5: RA, Dec (use current epoch)
std::string getLongitudeStr(lsst::afw::geom::AngleUnit unit) const
Allow quick access to the longitudinal 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
Class for handling dates/times, including MJD, UTC, and TAI.
lsst::afw::geom::Angle getL() const
TopocentricCoord(std::string const az, std::string const alt, double const epoch, Observatory const &obs)
A class to handle Galactic coordinates (inherits from Coord)
lsst::afw::geom::Angle _latitude
lsst::afw::geom::Angle hmsStringToAngle(std::string const hms)
Convert a hh:mm:ss string to Angle.
std::string getAltitudeStr() const
lsst::afw::geom::Angle angularSeparation(Coord const &c) const
compute the angular separation between two Coords
lsst::afw::geom::Angle getAltitude() const
lsst::afw::geom::Angle getAzimuth() const
boost::shared_ptr< Coord > Ptr
std::pair< lsst::afw::geom::Angle, lsst::afw::geom::Angle > getOffsetFrom(Coord const &c) const
Compute the offset from a coordinate.
Store information about an observatory ... lat/long, elevation.
virtual GalacticCoord toGalactic() const
Convert ourself to Galactic: l, b.
lsst::afw::geom::Angle getBeta() const
IcrsCoord(lsst::afw::geom::Angle const ra, lsst::afw::geom::Angle const dec)
bool operator!=(lsst::afw::coord::Coord const &lhs, lsst::afw::coord::Coord const &rhs)
Inequality; the complement of equality.
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.))
lsst::afw::geom::Angle getRa() const
lsst::afw::geom::Angle getLongitude() const
The main access method for the longitudinal coordinate.
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
virtual GalacticCoord toGalactic() const
Convert ourself to Galactic: l, b.
lsst::afw::geom::Angle _longitude
EclipticCoord(lsst::afw::geom::Angle const lamb, lsst::afw::geom::Angle const beta, double const epoch=2000.0)
virtual IcrsCoord toIcrs() const
Convert ourself to ICRS: RA, Dec (basically J2000)
GalacticCoord(lsst::afw::geom::Point3D const &p3d, 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)
TopocentricCoord(lsst::afw::geom::Angle const az, lsst::afw::geom::Angle const alt, double const epoch, Observatory const &obs)
Fk5Coord(lsst::afw::geom::Angle const ra, lsst::afw::geom::Angle const dec, double const epoch=2000.0)
Class to hold observatory information.
A class used to convert scalar POD types such as double to Angle.
std::string getBetaStr() const
std::string getRaStr(lsst::afw::geom::AngleUnit unit) const
EclipticCoord(std::string const lamb, std::string const beta, double const epoch=2000.0)
virtual Fk5Coord toFk5() const
Convert ourself from galactic to Fk5 (no epoch specified)
virtual std::string getClassName() const
IcrsCoord(lsst::afw::geom::Point3D const &p3d, bool normalize=true, lsst::afw::geom::Angle const defaultLongitude=lsst::afw::geom::Angle(0.))
std::ostream & operator<<(std::ostream &os, Coord const &coord)
virtual TopocentricCoord toTopocentric(Observatory const &obs, lsst::daf::base::DateTime const &obsDate) const
Convert ourself to Altitude/Azimuth: alt, az.
virtual std::string getClassName() const
std::string getAzimuthStr(lsst::afw::geom::AngleUnit unit) const
Fk5Coord precess(double const epochTo) const
Precess ourselves from whence we are to a new epoch.
virtual std::pair< std::string, std::string > getCoordNames() const
Coord::Ptr convert(CoordSystem system) const
Convert to a specified Coord type.
virtual std::string getClassName() const
TopocentricCoord(lsst::afw::geom::Point2D const &p2d, lsst::afw::geom::AngleUnit unit, double const epoch, Observatory const &obs)
A class to handle topocentric (AltAz) coordinates (inherits from Coord)
void rotate(Coord const &axis, lsst::afw::geom::Angle const theta)
Rotate our current coords about a pole.
boost::shared_ptr< EclipticCoord > Ptr
lsst::afw::coord::IcrsCoord IcrsCoord
boost::shared_ptr< TopocentricCoord > Ptr
std::pair< lsst::afw::geom::Angle, lsst::afw::geom::Angle > getTangentPlaneOffset(Coord const &c) const
Get the offset on the tangent plane.
lsst::afw::geom::Point3D getVector() const
Return our contents in a position vector.
std::string getRaStr(lsst::afw::geom::AngleUnit unit) const
virtual std::pair< std::string, std::string > getCoordNames() const
IcrsCoord(std::string const ra, std::string const dec)
std::string getDecStr() 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.
Fk5Coord(lsst::afw::geom::Point2D const &p2d, lsst::afw::geom::AngleUnit unit=lsst::afw::geom::degrees, double const epoch=2000.0)
virtual TopocentricCoord toTopocentric() const
Convert ourself from Topocentric to Topocentric with no observatory or date arguments.
virtual Fk5Coord toFk5() const
Convert outself from Topocentric to Fk5 (use current epoch)
std::string getBStr() const
virtual std::string getClassName() const
bool operator==(Coord const &rhs) const
Equality operator, compares each element directly.
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 Fk5Coord toFk5() const
Convert ourself to Fk5 (ie. a no-op): RA, Dec (keep current epoch)
virtual IcrsCoord toIcrs() const
Icrs converter for IcrsCoord. (ie. a no-op)
boost::shared_ptr< Fk5Coord > Ptr
virtual Fk5Coord toFk5() const
Convert ourself from Ecliptic to Fk5 (use current epoch)
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 ...
lsst::afw::geom::Angle getB() const
std::string angleToHmsString(lsst::afw::geom::Angle const deg)
a function to convert decimal degrees to a string with form hh:mm:ss.s
virtual EclipticCoord toEcliptic() const
Convert ourself from Ecliptic to Ecliptic ... a no-op (use the current epoch)
boost::shared_ptr< IcrsCoord > Ptr
A class to handle Fk5 coordinates (inherits from Coord)
GalacticCoord(lsst::afw::geom::Angle const l, lsst::afw::geom::Angle const b)
virtual Coord::Ptr clone() const
void _verifyValues() const
Make sure the values we've got are in the range 0 <= x < 2PI.
#define LSST_EXCEPT(type,...)
A class to handle Ecliptic coordinates (inherits from Coord)
Observatory getObservatory() const
EclipticCoord precess(double const epochTo) const
precess to new epoch
virtual void reset(lsst::afw::geom::Angle const longitude, lsst::afw::geom::Angle const latitude)
virtual std::pair< std::string, std::string > getCoordNames() const
std::string getLatitudeStr() const
Allow quick access to the longitude coordinate as a string.
Coord()
Default constructor for the Coord base class.
virtual Coord::Ptr clone() const
std::string getDecStr() const
virtual Fk5Coord toFk5() const
Fk5 converter for IcrsCoord. (no epoch specified)
virtual TopocentricCoord toTopocentric(Observatory const &obs, lsst::daf::base::DateTime const &obsDate) const
Convert ourself to Altitude/Azimuth: alt, az.
boost::shared_ptr< GalacticCoord > Ptr
lsst::afw::geom::Angle getDec() const
afw::table::Key< double > b
CoordSystem makeCoordEnum(std::string const system)
A utility function to get the enum value of a coordinate system from a string name.
virtual std::string getClassName() const
virtual EclipticCoord toEcliptic() const
Convert ourself to Ecliptic: lambda, beta (use existing epoch)
virtual EclipticCoord toEcliptic() const
Convert ourself to Ecliptic: lambda, beta (use current epoch)
virtual IcrsCoord toIcrs() const
Convert ourself to ICRS: RA, Dec (basically J2000)
lsst::afw::geom::Angle getLatitude() const
The main access method for the latitudinal coordinate.
IcrsCoord(lsst::afw::geom::Point2D const &p2d, lsst::afw::geom::AngleUnit unit=lsst::afw::geom::degrees)
lsst::afw::geom::Angle getLambda() const
lsst::afw::geom::Angle getRa() const
GalacticCoord(lsst::afw::geom::Point2D const &p2d, lsst::afw::geom::AngleUnit unit=lsst::afw::geom::degrees)
std::string getLStr(lsst::afw::geom::AngleUnit unit) const
virtual Coord::Ptr clone() 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.
virtual Coord::Ptr clone() const
lsst::afw::geom::Angle operator[](int const index) const
Provide access to our contents via an index.
virtual std::pair< std::string, std::string > getCoordNames() const
lsst::afw::geom::Angle getDec() const
virtual GalacticCoord toGalactic() const
Convert ourself from Galactic to Galactic ... a no-op.
lsst::afw::geom::Angle eclipticPoleInclination(double const epoch)
get the inclination of the ecliptic pole (obliquity) at epoch
std::string getLambdaStr(lsst::afw::geom::AngleUnit unit) const
Coord transform(Coord const &poleFrom, Coord const &poleTo) const
Tranform our current coords to another spherical polar system.
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.))