LSSTApplications  10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
Public Types | Public Member Functions | List of all members
lsst::afw::coord::Fk5Coord Class Reference

A class to handle Fk5 coordinates (inherits from Coord) More...

#include <Coord.h>

Inheritance diagram for lsst::afw::coord::Fk5Coord:
lsst::afw::coord::Coord

Public Types

typedef boost::shared_ptr
< Fk5Coord
Ptr
 
- Public Types inherited from lsst::afw::coord::Coord
typedef boost::shared_ptr< CoordPtr
 
typedef boost::shared_ptr
< Coord const > 
ConstPtr
 

Public Member Functions

 Fk5Coord (lsst::afw::geom::Point2D const &p2d, lsst::afw::geom::AngleUnit unit=lsst::afw::geom::degrees, double const epoch=2000.0)
 
 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.))
 
 Fk5Coord (lsst::afw::geom::Angle const ra, lsst::afw::geom::Angle const dec, double const epoch=2000.0)
 
 Fk5Coord (std::string const ra, std::string const dec, double const epoch=2000.0)
 
 Fk5Coord ()
 
virtual Coord::Ptr clone () const
 
virtual std::string getClassName () const
 
Fk5Coord precess (double const epochTo) const
 Precess ourselves from whence we are to a new epoch. More...
 
lsst::afw::geom::Angle getRa () const
 
lsst::afw::geom::Angle getDec () const
 
std::string getRaStr (lsst::afw::geom::AngleUnit unit) const
 
std::string getDecStr () const
 
virtual Fk5Coord toFk5 (double const epoch) const
 Convert ourself to Fk5 (ie. a no-op): RA, Dec (precess to new epoch) More...
 
virtual Fk5Coord toFk5 () const
 Convert ourself to Fk5 (ie. a no-op): RA, Dec (keep current epoch) More...
 
virtual IcrsCoord toIcrs () const
 Convert ourself to ICRS: RA, Dec (basically J2000) More...
 
virtual GalacticCoord toGalactic () const
 Convert ourself to Galactic: l, b. More...
 
virtual EclipticCoord toEcliptic (double const epoch) const
 Convert ourself to Ecliptic: lambda, beta (precess to new epoch) More...
 
virtual EclipticCoord toEcliptic () const
 Convert ourself to Ecliptic: lambda, beta (use current epoch) More...
 
virtual TopocentricCoord toTopocentric (Observatory const &obs, lsst::daf::base::DateTime const &obsDate) const
 Convert ourself to Altitude/Azimuth: alt, az. More...
 
- Public Member Functions inherited from lsst::afw::coord::Coord
 Coord (lsst::afw::geom::Point2D const &p2d, lsst::afw::geom::AngleUnit unit=lsst::afw::geom::degrees, double const epoch=2000.0)
 Constructor for the Coord base class. More...
 
 Coord (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.))
 Constructor for the Coord base class. More...
 
 Coord (lsst::afw::geom::Angle const ra, lsst::afw::geom::Angle const dec, double const epoch=2000.0)
 Constructor for the Coord base class. More...
 
 Coord (std::string const ra, std::string const dec, double const epoch=2000.0)
 Constructor for the Coord base class. More...
 
 Coord ()
 Default constructor for the Coord base class. More...
 
virtual ~Coord ()
 
virtual void reset (lsst::afw::geom::Angle const longitude, lsst::afw::geom::Angle const latitude)
 
virtual void reset (lsst::afw::geom::Angle const longitude, lsst::afw::geom::Angle const latitude, double const epoch)
 Reset our coordinates wholesale. More...
 
double getEpoch () const
 
lsst::afw::geom::Point2D getPosition (lsst::afw::geom::AngleUnit unit=lsst::afw::geom::degrees) const
 Return our contents in a Point2D object. More...
 
lsst::afw::geom::Point3D getVector () const
 Return our contents in a position vector. More...
 
virtual std::pair< std::string,
std::string > 
getCoordNames () const
 
lsst::afw::geom::Angle operator[] (int const index) const
 Provide access to our contents via an index. More...
 
bool operator== (Coord const &rhs) const
 Equality operator, compares each element directly. More...
 
lsst::afw::geom::Angle getLongitude () const
 The main access method for the longitudinal coordinate. More...
 
lsst::afw::geom::Angle getLatitude () const
 The main access method for the latitudinal coordinate. More...
 
std::string getLongitudeStr (lsst::afw::geom::AngleUnit unit) const
 Allow quick access to the longitudinal coordinate as a string. More...
 
std::string getLatitudeStr () const
 Allow quick access to the longitude coordinate as a string. More...
 
Coord transform (Coord const &poleFrom, Coord const &poleTo) const
 Tranform our current coords to another spherical polar system. More...
 
lsst::afw::geom::Angle angularSeparation (Coord const &c) const
 compute the angular separation between two Coords More...
 
std::pair
< lsst::afw::geom::Angle,
lsst::afw::geom::Angle
getOffsetFrom (Coord const &c) const
 Compute the offset from a coordinate. More...
 
std::pair
< lsst::afw::geom::Angle,
lsst::afw::geom::Angle
getTangentPlaneOffset (Coord const &c) const
 Get the offset on the tangent plane. More...
 
void rotate (Coord const &axis, lsst::afw::geom::Angle const theta)
 Rotate our current coords about a pole. More...
 
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 More...
 
Coord::Ptr convert (CoordSystem system) const
 Convert to a specified Coord type. More...
 

Detailed Description

A class to handle Fk5 coordinates (inherits from Coord)

Definition at line 191 of file Coord.h.

Member Typedef Documentation

typedef boost::shared_ptr<Fk5Coord> lsst::afw::coord::Fk5Coord::Ptr

Definition at line 194 of file Coord.h.

Constructor & Destructor Documentation

lsst::afw::coord::Fk5Coord::Fk5Coord ( lsst::afw::geom::Point2D const &  p2d,
lsst::afw::geom::AngleUnit  unit = lsst::afw::geom::degrees,
double const  epoch = 2000.0 
)
inline

Definition at line 196 of file Coord.h.

196  :
197  Coord(p2d, unit, epoch) {}
Coord()
Default constructor for the Coord base class.
Definition: Coord.cc:441
lsst::afw::coord::Fk5Coord::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.) 
)
inline

Definition at line 198 of file Coord.h.

200  :
201  Coord(p3d, epoch, normalize, defaultLongitude) {}
Coord()
Default constructor for the Coord base class.
Definition: Coord.cc:441
lsst::afw::coord::Fk5Coord::Fk5Coord ( lsst::afw::geom::Angle const  ra,
lsst::afw::geom::Angle const  dec,
double const  epoch = 2000.0 
)
inline

Definition at line 202 of file Coord.h.

202  :
203  Coord(ra, dec, epoch) {}
Coord()
Default constructor for the Coord base class.
Definition: Coord.cc:441
lsst::afw::coord::Fk5Coord::Fk5Coord ( std::string const  ra,
std::string const  dec,
double const  epoch = 2000.0 
)
inline

Definition at line 204 of file Coord.h.

204  :
205  Coord(ra, dec, epoch) {}
Coord()
Default constructor for the Coord base class.
Definition: Coord.cc:441
lsst::afw::coord::Fk5Coord::Fk5Coord ( )
inline

Definition at line 206 of file Coord.h.

206 : Coord() {}
Coord()
Default constructor for the Coord base class.
Definition: Coord.cc:441

Member Function Documentation

virtual Coord::Ptr lsst::afw::coord::Fk5Coord::clone ( ) const
inlinevirtual

Reimplemented from lsst::afw::coord::Coord.

Definition at line 208 of file Coord.h.

208 { return Fk5Coord::Ptr(new Fk5Coord(*this)); }
boost::shared_ptr< Fk5Coord > Ptr
Definition: Coord.h:194
virtual std::string lsst::afw::coord::Fk5Coord::getClassName ( ) const
inlinevirtual

Reimplemented from lsst::afw::coord::Coord.

Definition at line 210 of file Coord.h.

210 { return "Fk5Coord"; }
lsst::afw::geom::Angle lsst::afw::coord::Fk5Coord::getDec ( ) const
inline

Definition at line 215 of file Coord.h.

215 { return getLatitude(); }
lsst::afw::geom::Angle getLatitude() const
The main access method for the latitudinal coordinate.
Definition: Coord.h:120
std::string lsst::afw::coord::Fk5Coord::getDecStr ( ) const
inline

Definition at line 217 of file Coord.h.

217 { return getLatitudeStr(); }
std::string getLatitudeStr() const
Allow quick access to the longitude coordinate as a string.
Definition: Coord.h:460
lsst::afw::geom::Angle lsst::afw::coord::Fk5Coord::getRa ( ) const
inline

Definition at line 214 of file Coord.h.

214 { return getLongitude(); }
lsst::afw::geom::Angle getLongitude() const
The main access method for the longitudinal coordinate.
Definition: Coord.h:113
std::string lsst::afw::coord::Fk5Coord::getRaStr ( lsst::afw::geom::AngleUnit  unit) const
inline

Definition at line 216 of file Coord.h.

216 { return getLongitudeStr(unit); }
std::string getLongitudeStr(lsst::afw::geom::AngleUnit unit) const
Allow quick access to the longitudinal coordinate as a string.
Definition: Coord.h:443
afwCoord::Fk5Coord lsst::afw::coord::Fk5Coord::precess ( double const  epochTo) const

Precess ourselves from whence we are to a new epoch.

Parameters
epochToepoch to precess to

Definition at line 947 of file Coord.cc.

949  {
950 
951  // return a copy if the epochs are the same
952  if ( fabs(getEpoch() - epochTo) < epochTolerance) {
953  return Fk5Coord(getLongitude(), getLatitude(), getEpoch());
954  }
955 
958  double const jd0 = dateFrom.get(dafBase::DateTime::JD);
959  double const jd = dateTo.get(dafBase::DateTime::JD);
960 
961  double const T = (jd0 - JD2000)/36525.0;
962  double const t = (jd - jd0)/36525.0;
963  double const tt = t*t;
964  double const ttt = tt*t;
965 
966  afwGeom::Angle const xi = ((2306.2181 + 1.39656*T - 0.000139*T*T)*t +
967  (0.30188 - 0.000344*T)*tt + 0.017998*ttt) * afwGeom::arcseconds;
968  afwGeom::Angle const z = ((2306.2181 + 1.39656*T - 0.000139*T*T)*t +
969  (1.09468 + 0.000066*T)*tt + 0.018203*ttt) * afwGeom::arcseconds;
970  afwGeom::Angle const theta = ((2004.3109 - 0.85330*T - 0.000217*T*T)*t -
971  (0.42665 + 0.000217*T)*tt - 0.041833*ttt) * afwGeom::arcseconds;
972 
973  Fk5Coord fk5 = this->toFk5();
974  afwGeom::Angle const alpha0 = fk5.getRa();
975  afwGeom::Angle const delta0 = fk5.getDec();
976 
977  double const a = std::cos(delta0) * std::sin((alpha0 + xi));
978  double const b = std::cos(theta) * std::cos(delta0) * std::cos((alpha0 + xi)) - std::sin(theta) * std::sin(delta0);
979  double const c = std::sin(theta) * std::cos(delta0) * std::cos((alpha0 + xi)) + std::cos(theta) * std::sin(delta0);
980 
981  afwGeom::Angle const alpha = (std::atan2(a,b) + z) * afwGeom::radians;
982  afwGeom::Angle const delta = std::asin(c) * afwGeom::radians;
983 
984  return Fk5Coord(alpha, delta, epochTo);
985 }
Class for handling dates/times, including MJD, UTC, and TAI.
Definition: DateTime.h:58
lsst::afw::geom::Angle getLongitude() const
The main access method for the longitudinal coordinate.
Definition: Coord.h:113
Matrix alpha
AngleUnit const radians
constant with units of radians
Definition: Angle.h:91
virtual Fk5Coord toFk5() const
Convert ourself to Fk5 (ie. a no-op): RA, Dec (keep current epoch)
Definition: Coord.cc:845
double getEpoch() const
Definition: Coord.h:93
afw::table::Key< double > b
lsst::afw::geom::Angle getLatitude() const
The main access method for the latitudinal coordinate.
Definition: Coord.h:120
AngleUnit const arcseconds
Definition: Angle.h:95
afwCoord::EclipticCoord lsst::afw::coord::Fk5Coord::toEcliptic ( double const  epoch) const
virtual

Convert ourself to Ecliptic: lambda, beta (precess to new epoch)

Reimplemented from lsst::afw::coord::Coord.

Definition at line 886 of file Coord.cc.

886  {
887  afwGeom::Angle const eclPoleIncl = eclipticPoleInclination(epoch);
888  Coord const eclPoleInEquatorial(270.0 * afwGeom::degrees, (90.0 * afwGeom::degrees) - eclPoleIncl, epoch);
889  Coord const equPoleInEcliptic(90.0 * afwGeom::degrees, (90.0 * afwGeom::degrees) - eclPoleIncl, epoch);
890  Coord c = transform(equPoleInEcliptic, eclPoleInEquatorial);
891  return EclipticCoord(c.getLongitude(), c.getLatitude(), epoch);
892 }
Coord()
Default constructor for the Coord base class.
Definition: Coord.cc:441
AngleUnit const degrees
Definition: Angle.h:92
lsst::afw::geom::Angle eclipticPoleInclination(double const epoch)
get the inclination of the ecliptic pole (obliquity) at epoch
Definition: Coord.cc:354
Coord transform(Coord const &poleFrom, Coord const &poleTo) const
Tranform our current coords to another spherical polar system.
Definition: Coord.cc:507
afwCoord::EclipticCoord lsst::afw::coord::Fk5Coord::toEcliptic ( ) const
virtual

Convert ourself to Ecliptic: lambda, beta (use current epoch)

Reimplemented from lsst::afw::coord::Coord.

Definition at line 896 of file Coord.cc.

896  {
897  return this->toEcliptic(getEpoch());
898 }
double getEpoch() const
Definition: Coord.h:93
virtual EclipticCoord toEcliptic() const
Convert ourself to Ecliptic: lambda, beta (use current epoch)
Definition: Coord.cc:896
afwCoord::Fk5Coord lsst::afw::coord::Fk5Coord::toFk5 ( double const  epoch) const
virtual

Convert ourself to Fk5 (ie. a no-op): RA, Dec (precess to new epoch)

Reimplemented from lsst::afw::coord::Coord.

Definition at line 839 of file Coord.cc.

839  {
840  return Fk5Coord(getLongitude(), getLatitude(), getEpoch()).precess(epoch);
841 }
lsst::afw::geom::Angle getLongitude() const
The main access method for the longitudinal coordinate.
Definition: Coord.h:113
double getEpoch() const
Definition: Coord.h:93
lsst::afw::geom::Angle getLatitude() const
The main access method for the latitudinal coordinate.
Definition: Coord.h:120
afwCoord::Fk5Coord lsst::afw::coord::Fk5Coord::toFk5 ( ) const
virtual

Convert ourself to Fk5 (ie. a no-op): RA, Dec (keep current epoch)

Reimplemented from lsst::afw::coord::Coord.

Definition at line 845 of file Coord.cc.

845  {
846  return Fk5Coord(getLongitude(), getLatitude(), getEpoch());
847 }
lsst::afw::geom::Angle getLongitude() const
The main access method for the longitudinal coordinate.
Definition: Coord.h:113
double getEpoch() const
Definition: Coord.h:93
lsst::afw::geom::Angle getLatitude() const
The main access method for the latitudinal coordinate.
Definition: Coord.h:120
afwCoord::GalacticCoord lsst::afw::coord::Fk5Coord::toGalactic ( ) const
virtual

Convert ourself to Galactic: l, b.

Reimplemented from lsst::afw::coord::Coord.

Definition at line 868 of file Coord.cc.

868  {
869 
870  // if we're epoch==2000, we can transform, otherwise we need to precess first
871  Fk5Coord c;
872  if ( fabs(getEpoch() - 2000.0) > epochTolerance ) {
873  c = precess(2000.0);
874  } else {
875  c = *this;
876  }
877 
878  Coord ct = c.transform(Fk5PoleInGalactic(), GalacticPoleInFk5());
879  return GalacticCoord(ct.getLongitude(), ct.getLatitude());
880 
881 }
Fk5Coord precess(double const epochTo) const
Precess ourselves from whence we are to a new epoch.
Definition: Coord.cc:947
double getEpoch() const
Definition: Coord.h:93
Coord()
Default constructor for the Coord base class.
Definition: Coord.cc:441
afwCoord::IcrsCoord lsst::afw::coord::Fk5Coord::toIcrs ( ) const
virtual

Convert ourself to ICRS: RA, Dec (basically J2000)

Reimplemented from lsst::afw::coord::Coord.

Definition at line 853 of file Coord.cc.

853  {
854 
855  // only do the precession to 2000 if we're not already there.
856  if ( fabs(getEpoch() - 2000.0) > epochTolerance ) {
857  afwCoord::Fk5Coord c = precess(2000.0);
858  return IcrsCoord(c.getLongitude(), c.getLatitude());
859  } else {
860  return IcrsCoord(getLongitude(), getLatitude());
861  }
862 }
lsst::afw::geom::Angle getLongitude() const
The main access method for the longitudinal coordinate.
Definition: Coord.h:113
Fk5Coord precess(double const epochTo) const
Precess ourselves from whence we are to a new epoch.
Definition: Coord.cc:947
lsst::afw::coord::IcrsCoord IcrsCoord
Definition: misc.h:38
A class to handle Fk5 coordinates (inherits from Coord)
Definition: Coord.h:191
double getEpoch() const
Definition: Coord.h:93
lsst::afw::geom::Angle getLatitude() const
The main access method for the latitudinal coordinate.
Definition: Coord.h:120
afwCoord::TopocentricCoord lsst::afw::coord::Fk5Coord::toTopocentric ( Observatory const &  obs,
lsst::daf::base::DateTime const &  obsDate 
) const
virtual

Convert ourself to Altitude/Azimuth: alt, az.

Parameters
obsobservatory
obsDatedate of obs.

Reimplemented from lsst::afw::coord::Coord.

Definition at line 903 of file Coord.cc.

906  {
907 
908  // make sure we precess to the epoch
909  Fk5Coord fk5 = precess(obsDate.get(dafBase::DateTime::EPOCH));
910 
911  // greenwich sidereal time
912  afwGeom::Angle theta0 = meanSiderealTimeGreenwich(obsDate.get(dafBase::DateTime::JD));
913  theta0.wrap();
914 
915  // lat/long of the observatory
916  afwGeom::Angle const phi = obs.getLatitude();
917  afwGeom::Angle const L = obs.getLongitude();
918 
919  // ra/dec of the target
920  afwGeom::Angle const alpha = fk5.getRa();
921  afwGeom::Angle const delta = fk5.getDec();
922 
923  afwGeom::Angle const H = theta0 + L - alpha;
924 
925  // compute the altitude, h
926  double const sinh = std::sin(phi)* std::sin(delta) + std::cos(phi) * std::cos(delta) * std::cos(H);
927  afwGeom::Angle const h = std::asin(sinh) * afwGeom::radians;
928 
929  // compute the azimuth, A
930  double const tanAnumerator = std::sin(H);
931  double const tanAdenominator = (std::cos(H) * std::sin(phi) - std::tan(delta) * std::cos(phi));
932 
933  // Equations used here assume azimuth is with respect to South
934  // but we use the North as our origin ... must add 180 deg
935  afwGeom::Angle A = (180.0*afwGeom::degrees) + atan2(tanAnumerator, tanAdenominator)* afwGeom::radians;
936  A.wrap();
937 
938  return TopocentricCoord(A, h, obsDate.get(dafBase::DateTime::EPOCH), obs);
939 }
Matrix alpha
Fk5Coord precess(double const epochTo) const
Precess ourselves from whence we are to a new epoch.
Definition: Coord.cc:947
AngleUnit const radians
constant with units of radians
Definition: Angle.h:91
AngleUnit const degrees
Definition: Angle.h:92

The documentation for this class was generated from the following files: