1 #ifndef SZA_UTIL_COORDINATES_H
2 #define SZA_UTIL_COORDINATES_H
11 #include "carma/szautil/Angle.h"
12 #include "carma/szautil/DecAngle.h"
14 #include "carma/szautil/HourAngle.h"
15 #include "carma/szautil/Delay.h"
16 #include "carma/szautil/Vector.h"
148 inline Angle& latitude() {
152 inline double& altitude() {
160 Vector<double>
getAbsXyz(
double east=0.0,
double north=0.0,
double up=0.0);
166 Vector<double>
getXyz(
double east=0.0,
double north=0.0,
double up=0.0,
167 bool geocentric=
true);
173 Vector<double>
getUen(Angle
longitude, Angle latitude,
double altitude);
184 Vector<double>
getUvw(HourAngle ha, DecAngle declination);
190 Vector<double>
getLla(
double east=0.0,
double north=0.0,
double up=0.0);
202 void add(
double up,
double east,
double north);
212 static Vector<double>
214 Angle& az, Angle& el);
222 double up,
double east,
double north);
228 Angle fiducialLatitude,
229 double fiducialAltitude,
239 double up,
double east,
double north,
bool doTrans=
true);
245 static Vector<double>
topoXYZToUen(
double X,
double Y,
double Z,
251 static Vector<double>
absXyzToLla(
double XA,
double YA,
double ZA);
258 double up=0.0,
double east=0.0,
274 static Vector<double>
laAndUenToXyz(Angle latitude,
double altitude,
275 double up=0.0,
double east=0.0,
277 bool geocentric=
true);
284 static Vector<double>
azElToUen(Angle az, Angle el,
double r=1.0);
289 static Vector<Angle>
uenToAzEl(
double U,
double E,
double N);
290 static Vector<Angle>
uenToAzEl(Vector<double>& uen);
302 double X,
double Y,
double Z);
314 static Vector<double>
haDecToXyz(HourAngle ha, DecAngle declination,
315 bool geocentric=
true,
316 SrcDist type=INF,
double r=0.0);
327 static Vector<double>
dHaDdecToXyz(HourAngle dHa, Angle dDec);
334 HourAngle& dHa, Angle& dDec);
341 HourAngle& dHa, Angle& dDec);
349 static Vector<double> thetaRhoToXyz(Declination& dec, Angle& theta, Angle& rho);
351 static Matrix<double> getThetaRhoToXyzDecRot(Declination& dec);
352 static Matrix<double> getThetaRhoToXyzThetaRot(Angle& theta);
353 static Matrix<double> getThetaRhoToXyzRhoRot(Angle& rho);
362 Angle& theta, Angle& rho,
363 HourAngle& ra, Declination& dec);
391 HourAngle ha, DecAngle declination,
392 bool geocentric=
true,
393 SrcDist type=INF,
double dist=1.0);
405 double X,
double Y,
double Z,
406 double X0,
double Y0,
double Z0,
407 bool doMotionCorrection);
417 double X,
double Y,
double Z);
427 static Vector<double>
getdUvw(HourAngle ha, DecAngle declination,
428 double X,
double Y,
double Z);
433 static Vector<double>
getd2Uvw(HourAngle ha, DecAngle declination,
434 double X,
double Y,
double Z);
445 static const double earthEqRadiusMeters_;
455 static const double lightSpeed_;
480 static Matrix<double> getUenToXyzLonRot(Angle
longitude);
485 static Matrix<double> getUenToXyzLatRot(Angle latitude);
490 static Matrix<double> getXyzToUvwDecRot(DecAngle declination);
495 static Matrix<double> getXyzToUvwHaRot(HourAngle ha);
501 static Matrix<double> getdXyzToUvwHaRot(HourAngle ha);
507 static Matrix<double> getd2XyzToUvwHaRot(HourAngle ha);
515 #endif // End #ifndef SZA_UTIL_COORDINATES_H
static Vector< double > absXyzToLla(double XA, double YA, double ZA)
Given absolute XYZ, convert to LLA.
Vector< Angle > getAzEl(Angle longitude, Angle latitude, double altitude)
Given a LLA coordinate, return its Az, El relative to the position of this object.
static void raDecAndThetaRhoToRaDec(HourAngle &ra0, Declination &dec0, Angle &theta, Angle &rho, HourAngle &ra, Declination &dec)
......................................................................
static Vector< double > haDecAndXyzToUvw(HourAngle ha, DecAngle declination, double X, double Y, double Z)
Return the UVW coordinates, relative to a given XYZ coordinate, for the requested source position...
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.
static Vector< double > llaAndLlaToUen(Angle fiducialLongitude, Angle fiducialLatitude, double fiducialAltitude, Angle longitude, Angle latitude, double altitude)
Return the UEN of an LLA point relative to a fiducial LLA point.
Tagged: Fri Jun 15 16:44:12 PDT 2007.
static Vector< double > llaAndUenToAbsXyz(Angle longitude, Angle latitude, double altitude, double up, double east, double north, bool doTrans=true)
Return absolute XYZ of the point offset by UEN from a given LLA point.
Angle & longitude()
Position return methods.
void setLatitude(Angle latitude)
Set just the latitude.
void setAltitude(double altitude)
Set just the altitude.
void setLla(Angle longitude, Angle latitude, double altitude)
Set methods.
static Vector< double > topoXYZToUen(double X, double Y, double Z, Angle latitude)
Given a topocentric XYZ, return the UEN coordinates at a given latitude.
static Vector< double > lngLatAndAzElToLngLat(Angle &lng, Angle &lat, Angle &az, Angle &el)
Return the LL of the point given by an az/el offset relative to a fiducial LL.
This class performs conversions between several different coordinate systems.
static Vector< double > getd2Uvw(HourAngle ha, DecAngle declination, double X, double Y, double Z)
Second derivatives of the UVW coordinates wrt time.
Vector< double > getLla(double east=0.0, double north=0.0, double up=0.0)
Return LLA of the passed UEN offset point, relative to the LLA coordinates stored in this object...
void add(double up, double east, double north)
Increment the LLA of this object by the specified UEN offset.
static Vector< Angle > uenToAzEl(double U, double E, double N)
Given UEN, return the Azimuth and Elevation.
friend std::ostream & operator<<(std::ostream &os, Coordinates &coords)
Allows cout << coords.
static const double earthRotVelRadPerSec_
Rotational angular velocity of the earth, in radians per second.
static Vector< double > getdUvw(HourAngle ha, DecAngle declination, double X, double Y, double Z)
First derivatives of the UVW coordinates wrt time.
static Vector< double > laAndUenToXyz(Angle latitude, double 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.
virtual ~Coordinates()
Destructor.
static void xyzToDhaDdec(double X, double Y, double Z, HourAngle &dHa, Angle &dDec)
Return the dHa and dDec corresponding to the specified (X, Y, Z) coordinate.
Vector< double > getXyz(double east=0.0, double north=0.0, double up=0.0, bool geocentric=true)
Return XYZ coordinates of the given UEN point, relative to the LLA point of this object.
SrcDist
Enumerate types of distances we might pass to methods.
static Vector< double > haDecToXyz(HourAngle ha, DecAngle declination, bool geocentric=true, SrcDist type=INF, double r=0.0)
Return the XYZ coordinate of a vector at requested (Ha, Dec) direction and of length r...
Vector< double > getUvw(HourAngle ha, DecAngle declination)
Return the UVW coordinates for the current LLA location, of a source at the requested declination and...
void setLongitude(Angle longitude)
Set just the longitude.
static const double earthFlattening_
Flattening of the earth.
static Vector< double > azElToUen(Angle az, Angle el, double r=1.0)
Given Azimuth and Elevation, return the UEN coordinates.
static Vector< double > dHaDdecToXyz(HourAngle dHa, Angle dDec)
Return the (X, Y, Z) coordinates of the specified (Ha, Dec) coordinate.
static Delay getGeometricDelay(HourAngle ha, DecAngle 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< double > getAbsXyz(double east=0.0, double north=0.0, double up=0.0)
Return absolute XYZ coordinates of the given UEN point, relative to the LLA point of this object...
static const double auToMeters_
Conversion between AU and meters.
static Vector< double > llaAndUenToLla(Angle longitude, Angle latitude, double altitude, double up, double east, double north)
Return the LLA of the point given by an UEN offset relative to a fiducial LLA.
static Vector< Angle > laAndHaDecToAzEl(Angle latitude, double altitude, HourAngle ha, DecAngle declination, bool geocentric=true, SrcDist type=INF, double dist=1.0)
Return the Az El of a source at a given HA and Dec.
Vector< double > getUen(Angle longitude, Angle latitude, double altitude)
Return UEN coordinates of the specified LLA point, relative to the coordinates stored in this object...
Coordinates()
Constructor.