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 | Private Attributes | List of all members
lsst::afw::coord::TopocentricCoord Class Reference

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

#include <Coord.h>

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

Public Types

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

Public Member Functions

 TopocentricCoord (lsst::afw::geom::Point2D const &p2d, lsst::afw::geom::AngleUnit unit, double const epoch, Observatory const &obs)
 
 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.))
 
 TopocentricCoord (lsst::afw::geom::Angle const az, lsst::afw::geom::Angle const alt, double const epoch, Observatory const &obs)
 
 TopocentricCoord (std::string const az, std::string const alt, double const epoch, Observatory const &obs)
 
virtual Coord::Ptr clone () const
 
virtual std::string getClassName () const
 
Observatory getObservatory () const
 
virtual std::pair< std::string,
std::string > 
getCoordNames () const
 
lsst::afw::geom::Angle getAzimuth () const
 
lsst::afw::geom::Angle getAltitude () const
 
std::string getAzimuthStr (lsst::afw::geom::AngleUnit unit) const
 
std::string getAltitudeStr () const
 
virtual Fk5Coord toFk5 (double const epoch) const
 Convert ourself from Topocentric to Fk5. More...
 
virtual Fk5Coord toFk5 () const
 Convert outself from Topocentric to Fk5 (use current epoch) More...
 
virtual TopocentricCoord toTopocentric (Observatory const &obs, lsst::daf::base::DateTime const &date) const
 Convert ourself from Topocentric to Topocentric ... a no-op. More...
 
virtual TopocentricCoord toTopocentric () const
 Convert ourself from Topocentric to Topocentric with no observatory or date arguments. 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...
 
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...
 
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 existing epoch) More...
 

Private Attributes

Observatory _obs
 

Detailed Description

A class to handle topocentric (AltAz) coordinates (inherits from Coord)

Definition at line 329 of file Coord.h.

Member Typedef Documentation

Definition at line 332 of file Coord.h.

Constructor & Destructor Documentation

lsst::afw::coord::TopocentricCoord::TopocentricCoord ( lsst::afw::geom::Point2D const &  p2d,
lsst::afw::geom::AngleUnit  unit,
double const  epoch,
Observatory const &  obs 
)
inline

Definition at line 334 of file Coord.h.

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

Definition at line 336 of file Coord.h.

338  :
339  Coord(p3d, epoch, normalize, defaultLongitude), _obs(obs) {}
Coord()
Default constructor for the Coord base class.
Definition: Coord.cc:441
lsst::afw::coord::TopocentricCoord::TopocentricCoord ( lsst::afw::geom::Angle const  az,
lsst::afw::geom::Angle const  alt,
double const  epoch,
Observatory const &  obs 
)
inline

Definition at line 340 of file Coord.h.

341  : Coord(az, alt, epoch), _obs(obs) {}
Coord()
Default constructor for the Coord base class.
Definition: Coord.cc:441
lsst::afw::coord::TopocentricCoord::TopocentricCoord ( std::string const  az,
std::string const  alt,
double const  epoch,
Observatory const &  obs 
)
inline

Definition at line 342 of file Coord.h.

343  : Coord(az, alt, epoch), _obs(obs) {}
Coord()
Default constructor for the Coord base class.
Definition: Coord.cc:441

Member Function Documentation

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

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

Definition at line 345 of file Coord.h.

345 { return TopocentricCoord::Ptr(new TopocentricCoord(*this)); }
TopocentricCoord(lsst::afw::geom::Point2D const &p2d, lsst::afw::geom::AngleUnit unit, double const epoch, Observatory const &obs)
Definition: Coord.h:334
boost::shared_ptr< TopocentricCoord > Ptr
Definition: Coord.h:332
lsst::afw::geom::Angle lsst::afw::coord::TopocentricCoord::getAltitude ( ) const
inline

Definition at line 355 of file Coord.h.

355 { 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::TopocentricCoord::getAltitudeStr ( ) const
inline

Definition at line 357 of file Coord.h.

357 { 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::TopocentricCoord::getAzimuth ( ) const
inline

Definition at line 354 of file Coord.h.

354 { 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::TopocentricCoord::getAzimuthStr ( lsst::afw::geom::AngleUnit  unit) const
inline

Definition at line 356 of file Coord.h.

356 { 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
virtual std::string lsst::afw::coord::TopocentricCoord::getClassName ( ) const
inlinevirtual

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

Definition at line 347 of file Coord.h.

347 { return "TopocentricCoord"; }
virtual std::pair<std::string, std::string> lsst::afw::coord::TopocentricCoord::getCoordNames ( ) const
inlinevirtual

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

Definition at line 351 of file Coord.h.

351  {
352  return std::pair<std::string, std::string>("Az", "Alt");
353  }
Observatory lsst::afw::coord::TopocentricCoord::getObservatory ( ) const
inline

Definition at line 349 of file Coord.h.

349 { return _obs; }
afwCoord::Fk5Coord lsst::afw::coord::TopocentricCoord::toFk5 ( double const  epoch) const
virtual

Convert ourself from Topocentric to Fk5.

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

Definition at line 1124 of file Coord.cc.

1124  {
1125 
1126  afwGeom::Angle const phi = _obs.getLatitude();
1127  afwGeom::Angle const L = _obs.getLongitude();
1128 
1129  // Equations used here assume azimuth is with respect to South
1130  // but we use the North as our origin.
1132  A.wrap();
1133  afwGeom::Angle const h = getAltitude();
1134 
1135 
1136  double const jd = dafBase::DateTime(epoch,
1139  afwGeom::Angle theta0 = meanSiderealTimeGreenwich(jd);
1140  theta0.wrap();
1141 
1142  double const tanHnum = std::sin(A);
1143  double const tanHdenom = std::cos(A)*std::sin(phi) + std::tan(h)*std::cos(phi);
1144  afwGeom::Angle H = std::atan2(tanHnum, tanHdenom) * afwGeom::radians;
1145 
1146  afwGeom::Angle const alpha = theta0 + L - H;
1147  double const sinDelta = std::sin(phi)*std::sin(h) - std::cos(phi)*std::cos(h)*std::cos(A);
1148  afwGeom::Angle const delta = (std::asin(sinDelta)) * afwGeom::radians;
1149 
1150  return Fk5Coord(alpha, delta, epoch);
1151 }
Class for handling dates/times, including MJD, UTC, and TAI.
Definition: DateTime.h:58
lsst::afw::geom::Angle getAltitude() const
Definition: Coord.h:355
lsst::afw::geom::Angle getAzimuth() const
Definition: Coord.h:354
double get(DateSystem system=MJD, Timescale scale=TAI) const
Definition: DateTime.cc:419
Matrix alpha
lsst::afw::geom::Angle getLongitude() const
The main access method for the longitudinal coordinate.
Definition: Observatory.cc:88
AngleUnit const radians
constant with units of radians
Definition: Angle.h:91
lsst::afw::geom::Angle getLatitude() const
The main access method for the longitudinal coordinate.
Definition: Observatory.cc:99
AngleUnit const degrees
Definition: Angle.h:92
afwCoord::Fk5Coord lsst::afw::coord::TopocentricCoord::toFk5 ( ) const
virtual

Convert outself from Topocentric to Fk5 (use current epoch)

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

Definition at line 1155 of file Coord.cc.

1155  {
1156  return this->toFk5(getEpoch());
1157 }
virtual Fk5Coord toFk5() const
Convert outself from Topocentric to Fk5 (use current epoch)
Definition: Coord.cc:1155
double getEpoch() const
Definition: Coord.h:93
afwCoord::TopocentricCoord lsst::afw::coord::TopocentricCoord::toTopocentric ( Observatory const &  obs,
lsst::daf::base::DateTime const &  date 
) const
virtual

Convert ourself from Topocentric to Topocentric ... a no-op.

Parameters
obsobservatory of observation
datedate of observation

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

Definition at line 1163 of file Coord.cc.

1167 {
1168  if (obs != _obs) {
1169  throw LSST_EXCEPT(ex::InvalidParameterError,
1170  (boost::format("Expected observatory %s, saw %s") % _obs % obs).str());
1171  }
1172  if (fabs(date.get() - getEpoch()) > std::numeric_limits<double>::epsilon()) {
1173  throw LSST_EXCEPT(ex::InvalidParameterError,
1174  (boost::format("Expected date %g, saw %g") % getEpoch() % date.get()).str());
1175  }
1176 
1178 }
lsst::afw::geom::Angle getLongitude() const
The main access method for the longitudinal coordinate.
Definition: Coord.h:113
TopocentricCoord(lsst::afw::geom::Point2D const &p2d, lsst::afw::geom::AngleUnit unit, double const epoch, Observatory const &obs)
Definition: Coord.h:334
#define LSST_EXCEPT(type,...)
Definition: Exception.h:46
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::TopocentricCoord::toTopocentric ( ) const
virtual

Convert ourself from Topocentric to Topocentric with no observatory or date arguments.

As this is essentially a copy-constructor, the extra info can be obtained internally.

Definition at line 1185 of file Coord.cc.

1185  {
1187 }
lsst::afw::geom::Angle getLongitude() const
The main access method for the longitudinal coordinate.
Definition: Coord.h:113
TopocentricCoord(lsst::afw::geom::Point2D const &p2d, lsst::afw::geom::AngleUnit unit, double const epoch, Observatory const &obs)
Definition: Coord.h:334
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

Member Data Documentation

Observatory lsst::afw::coord::TopocentricCoord::_obs
private

Definition at line 366 of file Coord.h.


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