CARMA C++
AntennaCoordinates.h
Go to the documentation of this file.
1 // $Id: AntennaCoordinates.h,v 1.17 2006/01/20 16:03:22 mpound Exp $
2 #ifndef CARMA_SERVICES_ANTENNA_COORDINATES_H
3 #define CARMA_SERVICES_ANTENNA_COORDINATES_H
4 
12 #include "carma/services/Angle.h"
14 #include "carma/services/Vector.h"
15 
16 namespace carma {
17  namespace services {
18 
19  class Delay;
20  class Distance;
21  class HourAngle;
22 
90  class AntennaCoordinates : public Vector<double> {
91  public:
92 
98 
107 
114 
117  AntennaCoordinates( const AntennaCoordinates & rhs );
118 
122  virtual ~AntennaCoordinates();
123 
124 
128 
135  void setLla(Angle longitude, Angle latitude, Length altitude);
136 
141  void setLongitude(Angle longitude);
142 
147  void setLatitude(Angle latitude);
148 
153  void setAltitude(Length altitude);
154 
159  inline const Angle& longitude() const {
160  return longitude_;
161  }
162 
163  /*
164  * Get the latitude of these coordinates.
165  * @return carma::services::Angle representing the latitude
166  */
167  inline const Angle& latitude() const {
168  return latitude_;
169  }
170 
175  inline const Length& altitude() const {
176  return altitude_;
177  }
178 
189  Vector<double> getAbsXyz(double up = 0.0,
190  double east = 0.0,
191  double north = 0.0);
192 
202  Vector<double> getXyz(double up = 0.0,
203  double east = 0.0,
204  double north = 0.0,
205  bool geocentric = true);
206 
219  Vector<double> getUen(Angle longitude, Angle latitude, Length altitude);
220 
230 
244  Vector<double> getUvw(HourAngle ha, Angle declination);
245 
256  Vector<double> getLla(double up = 0.0,
257  double east = 0.0,
258  double north = 0.0);
259 
269  Vector<Angle> getAzEl(Angle longitude, Angle latitude, Length altitude);
270 
279 
286  void add(double up, double east, double north);
287 
288  //------------------------------------------------------------
289  // Static member functions
290  //------------------------------------------------------------
291 
306  static Vector<double> llaAndUenToLla(Angle longitude,
307  Angle latitude,
308  Length altitude,
309  double up, double east, double north);
310 
322  static Vector<double> llaAndLlaToUen(Angle fiducialLongitude,
323  Angle fiducialLatitude,
324  Length fiducialAltitude,
325  Angle longitude, Angle latitude,
326  Length altitude);
327 
340  static Vector<double> llaAndUenToAbsXyz(Angle longitude,
341  Angle latitude,
342  Length altitude,
343  double up,
344  double east,
345  double north);
346 
357  static Vector<double> topoXYZToUen(double X, double Y, double Z,
358  Angle latitude);
359 
369  static Vector<double> absXyzToLla(double XA, double YA, double ZA);
370 
384  static Vector<double> absXyzAndUenToLla(double XA, double YA, double ZA,
385  double up=0.0, double east=0.0,
386  double north=0.0);
387 
407  static Vector<double> laAndUenToXyz(Angle latitude, Length altitude,
408  double up=0.0, double east=0.0,
409  double north=0.0,
410  bool geocentric=true);
411 
422  static Vector<double> azElToUen(Angle az, Angle el, double r=1.0);
423 
430  static Vector<Angle> uenToAzEl(double U, double E, double N);
439 
449  static Vector<double> haDecAndXyzToUvw(HourAngle ha, Angle declination,
450  double X, double Y, double Z);
466  static Vector<double> haDecToXyz(HourAngle ha, Angle declination,
467  Distance distance,
468  bool geocentric=true
469  );
470 
497  static Vector<Angle>
498  laAndHaDecToAzEl(Angle latitude, Length altitude,
499  HourAngle ha, Angle declination,
500  Distance distance,
501  bool geocentric=true
502  );
503 
513  static Delay getGeometricDelay(HourAngle ha, Angle declination,
514  double X, double Y, double Z,
515  double X0, double Y0, double Z0,
516  bool doMotionCorrection);
517 
533  static Delay getGeometricDelay(Angle latitude,
534  Length altitude,
535  Angle az, Angle el,
536  double X, double Y, double Z);
537 
538  //------------------------------------------------------------
539  // Some utility methods which it may be convenient to leave
540  // public
541  //------------------------------------------------------------
542 
546  static Vector<double> getdUvw(HourAngle ha, Angle declination,
547  double X, double Y, double Z);
548 
552  static Vector<double> getd2Uvw(HourAngle ha, Angle declination,
553  double X, double Y, double Z);
557  friend std::ostream& operator<<(std::ostream& os, const AntennaCoordinates& coords);
558 
559  private:
560 
564  Angle longitude_;
565  Angle latitude_;
566  Length altitude_;
567 
571  static Matrix<double> getUenToXyzLonRot(Angle longitude);
572 
576  static Matrix<double> getUenToXyzLatRot(Angle latitude);
577 
581  static Matrix<double> getXyzToUvwDecRot(Angle declination);
582 
586  static Matrix<double> getXyzToUvwHaRot(HourAngle ha);
587 
592  static Matrix<double> getdXyzToUvwHaRot(HourAngle ha);
593 
598  static Matrix<double> getd2XyzToUvwHaRot(HourAngle ha);
599 
600  }; // End class AntennaCoordinates
601 
602  } // End namespace services
603 } // End namespace carma
604 
605 
606 #endif // End #ifndef CARMA_SERVICES_ANTENNA_COORDINATES_H
This class performs conversions between several different antenna coordinate systems.
This class handles standard mathematical vector operations.
Definition: Location.h:21
static Vector< double > getd2Uvw(HourAngle ha, Angle declination, double X, double Y, double Z)
Second derivatives of the UVW coordinates wrt time.
static Vector< double > getdUvw(HourAngle ha, Angle declination, double X, double Y, double Z)
First derivatives of the UVW coordinates wrt time.
AntennaCoordinates()
Default constructor, uses CARMA reference position.
static Delay getGeometricDelay(HourAngle ha, Angle declination, double X, double Y, double Z, double X0, double Y0, double Z0, bool doMotionCorrection)
Get the delay for the Ha and Dec of a source, given XYZ coordinates of a baseline.
Vector< Angle > getAzEl(Angle longitude, Angle latitude, Length altitude)
Given a LLA coordinate, return its Az, El relative to the position of this object.
virtual ~AntennaCoordinates()
Destructor.
static Vector< double > absXyzAndUenToLla(double XA, double YA, double ZA, double up=0.0, double east=0.0, double north=0.0)
Return the LLA of the point given by the specified absolute XYZ and UEN offset.
void setAltitude(Length altitude)
Set just the altitude.
Representation of an angle, return values are always modulo 2PI radians.
static Vector< double > laAndUenToXyz(Angle latitude, Length altitude, double up=0.0, double east=0.0, double north=0.0, bool geocentric=true)
Return the XYZ coordinates of an UEN point relative to a fiducial LA.
static Vector< double > haDecToXyz(HourAngle ha, Angle declination, Distance distance, bool geocentric=true)
Return the XYZ coordinate of a vector at requested (Ha, Dec) direction and of length r...
void setLla(Angle longitude, Angle latitude, Length altitude)
Set all coordinate parameters.
Vector< double > getAbsXyz(double up=0.0, double east=0.0, double north=0.0)
Return absolute XYZ coordinates of the given UEN point, relative to the LLA point of this object...
static Vector< double > topoXYZToUen(double X, double Y, double Z, Angle latitude)
Given a topocentric XYZ, return the UEN coordinates at a given latitude.
Trivial class for handling delays.
Definition: Delay.h:18
The Distance class can represent an distance in any units.
Definition: Distance.h:43
Vector< double > getUvw(HourAngle ha, Angle declination)
Return the UVW coordinates for the current LLA location, of a source at the requested declination and...
static Vector< double > haDecAndXyzToUvw(HourAngle ha, Angle declination, double X, double Y, double Z)
Return the UVW coordinates, relative to a given XYZ coordinate, for the requested source position...
const Length & altitude() const
Get the altitude of these coordinates.
This class handles standard mathematical matrix operations.
Definition: Matrix.h:26
AntennaCoordinates & operator=(const AntennaCoordinates &rhs)
Assignment operator to go along with the copy constructor.
const Angle & longitude() const
Get the longitude of these coordinates.
static Vector< double > azElToUen(Angle az, Angle el, double r=1.0)
Given Azimuth and Elevation, return the UEN coordinates.
Location specifies a location (observatory if you wish) on planet earth, as longitude, latitude, and altitude above sea-level.
Definition: Location.h:32
The Angle class can represent any angle in any units.
Definition: Angle.h:38
static Vector< double > llaAndLlaToUen(Angle fiducialLongitude, Angle fiducialLatitude, Length fiducialAltitude, Angle longitude, Angle latitude, Length altitude)
Return the UEN of an LLA point relative to a fiducial LLA point.
void setLongitude(Angle longitude)
Set just the longitude.
void add(double up, double east, double north)
Increment the LLA of this object by the specified UEN offset.
static Vector< double > llaAndUenToAbsXyz(Angle longitude, Angle latitude, Length altitude, double up, double east, double north)
Return absolute XYZ of the point offset by UEN from a given LLA point.
Vector< double > getXyz(double up=0.0, double east=0.0, double north=0.0, bool geocentric=true)
Return topocentric XYZ coordinates of the given UEN point, relative to the LLA point of this object...
static Vector< double > absXyzToLla(double XA, double YA, double ZA)
Given absolute XYZ, convert to LLA.
static Vector< Angle > uenToAzEl(double U, double E, double N)
Given UEN, return the Azimuth and Elevation.
friend std::ostream & operator<<(std::ostream &os, const AntennaCoordinates &coords)
Allows cout &lt;&lt; coords.
void setLatitude(Angle latitude)
Set just the latitude.
Vector< double > getLla(double up=0.0, double east=0.0, double north=0.0)
Return LLA of the passed UEN offset point, relative to the LLA coordinates stored in this object...
The Length class can represent a length in any units.
Definition: Length.h:36
Vector< double > getUen(Angle longitude, Angle latitude, Length altitude)
Return UEN coordinates of the specified LLA point, relative to the coordinates stored in this object...
static Vector< Angle > laAndHaDecToAzEl(Angle latitude, Length altitude, HourAngle ha, Angle declination, Distance distance, bool geocentric=true)
Return the Az El of a source at a given HA and Dec.
The HourAngle class extends carma::services::Angle to specifically support hour angles.
Definition: HourAngle.h:36
static Vector< double > llaAndUenToLla(Angle longitude, Angle latitude, Length altitude, double up, double east, double north)
Return the LLA of the point given by an UEN offset relative to a fiducial LLA.