My Project
|
#include <Coordinates.h>
Public Types | |
enum | SrcDist { ACTUAL, INF } |
Public Member Functions | |
Coordinates () | |
Coordinates (Angle longitude, Angle latitude, double altitude) | |
Coordinates (Coordinates &coord) | |
virtual | ~Coordinates () |
void | setLla (Angle longitude, Angle latitude, double altitude) |
void | setLongitude (Angle longitude) |
void | setLatitude (Angle latitude) |
void | setAltitude (double altitude) |
Angle & | longitude () |
Angle & | latitude () |
double & | altitude () |
Vector< double > | getAbsXyz (double east=0.0, double north=0.0, double up=0.0) |
Vector< double > | getXyz (double east=0.0, double north=0.0, double up=0.0, bool geocentric=true) |
Vector< double > | getUen (Angle longitude, Angle latitude, double altitude) |
Vector< double > | getUen (Coordinates &coords) |
Vector< double > | getUvw (HourAngle ha, DecAngle declination) |
Vector< double > | getLla (double east=0.0, double north=0.0, double up=0.0) |
Vector< Angle > | getAzEl (Angle longitude, Angle latitude, double altitude) |
Vector< Angle > | getAzEl (Coordinates &coords) |
void | add (double up, double east, double north) |
![]() | |
Vector (unsigned n) | |
Vector (doubleel0, doubleel1, doubleel2) | |
Vector (const Vector< double > &vec) | |
Vector () | |
virtual | ~Vector () |
unsigned | size () |
double | magnitude () |
double & | operator[] (unsigned i) |
const double | operator* (const Vector< double > &vec) |
const Vector< double > | operator* (const doublefactor) |
const Vector< double > | operator+ (const Vector< double > &vec) |
const Vector< double > | operator+ (const doubleoffset) |
const Vector< double > | operator- (const Vector< double > &vec) |
const Vector< double > | operator- (const doubleoffset) |
const Vector< double > | operator/ (const doublefactor) |
void | add (Vector< double > vec) |
void | push_back (doubleel) |
void | resize (unsigned n) |
Static Public Member Functions | |
static Vector< double > | lngLatAndAzElToLngLat (Angle &lng, Angle &lat, Angle &az, Angle &el) |
static Vector< double > | llaAndUenToLla (Angle longitude, Angle latitude, double altitude, double up, double east, double north) |
static Vector< double > | llaAndLlaToUen (Angle fiducialLongitude, Angle fiducialLatitude, double fiducialAltitude, Angle longitude, Angle latitude, double altitude) |
static Vector< double > | llaAndUenToAbsXyz (Angle longitude, Angle latitude, double altitude, double up, double east, double north, bool doTrans=true) |
static Vector< double > | topoXYZToUen (double X, double Y, double Z, Angle latitude) |
static Vector< double > | absXyzToLla (double XA, double YA, double ZA) |
static Vector< double > | absXyzAndUenToLla (double XA, double YA, double ZA, double up=0.0, double east=0.0, double north=0.0) |
static Vector< double > | laAndUenToXyz (Angle latitude, double altitude, double up=0.0, double east=0.0, double north=0.0, bool geocentric=true) |
static Vector< double > | azElToUen (Angle az, Angle el, double r=1.0) |
static Vector< Angle > | uenToAzEl (double U, double E, double N) |
static Vector< Angle > | uenToAzEl (Vector< double > &uen) |
static Vector< double > | haDecAndXyzToUvw (HourAngle ha, DecAngle declination, double X, double Y, double Z) |
static Vector< double > | haDecToXyz (HourAngle ha, DecAngle declination, bool geocentric=true, SrcDist type=INF, double r=0.0) |
static Vector< double > | dHaDdecToXyz (HourAngle dHa, Angle dDec) |
static void | xyzToDhaDdec (double X, double Y, double Z, HourAngle &dHa, Angle &dDec) |
static void | xyzToDhaDdec (Vector< double > &xyzVals, HourAngle &dHa, Angle &dDec) |
static Vector< double > | thetaRhoToXyz (Declination &dec, Angle &theta, Angle &rho) |
static Matrix< double > | getThetaRhoToXyzDecRot (Declination &dec) |
static Matrix< double > | getThetaRhoToXyzThetaRot (Angle &theta) |
static Matrix< double > | getThetaRhoToXyzRhoRot (Angle &rho) |
static void | raDecAndThetaRhoToRaDec (HourAngle &ra0, Declination &dec0, Angle &theta, Angle &rho, HourAngle &ra, Declination &dec) |
static Vector< Angle > | laAndHaDecToAzEl (Angle latitude, double altitude, HourAngle ha, DecAngle declination, bool geocentric=true, SrcDist type=INF, double dist=1.0) |
static Delay | getGeometricDelay (HourAngle ha, DecAngle declination, double X, double Y, double Z, double X0, double Y0, double Z0, bool doMotionCorrection) |
static Delay | getGeometricDelay (Angle latitude, Angle az, Angle el, double X, double Y, double Z) |
static Vector< double > | getdUvw (HourAngle ha, DecAngle declination, double X, double Y, double Z) |
static Vector< double > | getd2Uvw (HourAngle ha, DecAngle declination, double X, double Y, double Z) |
Static Public Attributes | |
static const double | earthEqRadiusMeters_ = 6.378140e6 |
static const double | earthFlattening_ = 1.0/298.257 |
static const double | lightSpeed_ = 2.99792458e8 |
static const double | auToMeters_ = 1.49597870e11 |
static const double | earthRotVelRadPerSec_ = 7.2921151467e-5 |
Friends | |
std::ostream & | operator<< (std::ostream &os, Coordinates &coords) |
Additional Inherited Members | |
![]() | |
std::vector< double > | data_ |
This class performs conversions between several different coordinate systems. These are described below.
(L, L, A): The longiude/latitude/altitude coordinate system. I will refer to this in shorthand as LLA, and coordinates as (L, L, A). Longitude increases from 0 at Greenwich, England in an easterly direction, and decreases in a westerly direction. East longitudes are correctly described as positive sexagesimal numbers, typically between 0 and 180 degrees. West longitudes are often confusingly specified as positive numbers between 0 and 180, with a 'W' appended, e.g., +XXX:XX:XX.XX W, or even more confusingly, the W is simply dropped altogether, creating an ambiguity between E and W longitudes. West longitudes should correctly be described as negative numbers between 0 and -180, or equivalently, as positive numbers between 180 and 360. In this document, no distinction is made between E and W longitudes. Where applicable, W longitudes should be passed as negative numbers.
(X, Y, Z): Thompson, Moran and Swenson (Eq. 4.15, 1st ed.) describe a coordinate system for specifying relative antenna locations: they call it (X, Y, Z). In their system, Z lies along the North Celestial Pole, X lies in the plane passing through an arbitrary longitude/latitude point (at 0 Hour Angle), and Y lies at -6h Hour Angle. Thus to convert from a latitude, longitude point to (X, Y, Z), one has only to perform a translation and a latitude rotation. I interpret their XYZ coordinate system to have as its origin the center of the Earth, but there are differing opinions about this. Some think it should be taken to be fixed to the surface at some fiducial point. The two interpretations are simply related by a translation by the radius of the earth, and the difference is irrelevant when dealing with baseline coordinates, since those are always relative.
(U, V, W) : Coordinates tied to the source reference frame (e.g., TMS, section 4.2). These coordinates are simply related to (X, Y, Z) by a rotation of 90-dec about the X axis, followed by a rotation by 90-H about the Z axis, where dec is the source declination and H the hour angle of the source.
(XA, YA, ZA): Same as the (X, Y, Z) system described by TMS, but with X in the plane of the Greenwich meridian, i.e., it is an absolute geocentric coordinate system. getAbsXYZ() takes a longitude, latitude, altitude, and an east, north, up offset relative to that long/lat/alt point, and converts it to an absolute (XA, YA, ZA) vector, in meters. By comparison with XYZ' XYZ coordinate system, to convert from a lat/long/alt point to (XA, YA, ZA), one has to perform a translation, followed by both a longitude rotation and a latitude rotation.
(E, N, U): This coordinate system is useful for specifying locations relative to a given LLA point. Coordinates are in a tangent plane at the specified LLA point, with N pointing due north, E pointing due east, and U pointing straight up along a radial vector from the center of the earth, and passing through the given LLA point. To perform a conversion from UEN to XYZ for example, one has to perform a translation by the Earth's radius, followed by a longitude rotation and a latitude rotation.
This container will natively store coordinates in LLA, hence the constructors which initialize these parameters.
Enumerate types of distances we might pass to methods
Coordinates::Coordinates | ( | ) |
Constructor.
....................................................................... Constructor.
Coordinates::Coordinates | ( | Coordinates & | coords | ) |
Copy constructor.
....................................................................... Constructor with initialization of lat long and alt
|
virtual |
Destructor.
....................................................................... Destructor.
|
static |
Return the LLA of the point given by the specified absolute XYZ and UEN offset.
....................................................................... Given a fiducial absolute XYZ and an UEN offset relative to it, return the latitude, longitude, and altitude.
XA (m) YA (m) ZA (m)
And optionally:
east (m) north (m) up (m)
|
static |
Given absolute XYZ, convert to LLA
....................................................................... Given absolute XYZ, convert to LLA
void Coordinates::add | ( | double | up, |
double | east, | ||
double | north | ||
) |
Increment the LLA of this object by the specified UEN offset
....................................................................... Given NEU and the LLA of this object, return the latitude, longitude, and altitude.
east (m) north (m) up (m)
Given Azimuth and Elevation, return the UEN coordinates. Note that with r==1.0, this function returns the direction cosines of the position specified by az/el.
....................................................................... Given Azimuth and Elevation, return the UEN coordinates. Note that with r==1.0, this function returns the direction cosines of the position specified by az/el.
Return the (X, Y, Z) coordinates of the specified (Ha, Dec) coordinate. This function returns the direction cosines only.
....................................................................... Return the (X, Y, Z) coordinates of the point offset by the specified dHa and dDec
Vector< double > Coordinates::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.
....................................................................... Return the (X, Y, Z) interferometry coordinates of a point specified in (E, N, U) coordinates, relative to the latitude and longitude of this object.
Optional arguments:
east (m) north (m) up (m)
Given a LLA coordinate, return its Az, El relative to the position of this object.
....................................................................... Given a (L, L, A) coordinate, return its Az, El relative to the position of this object
Vector< Angle > Coordinates::getAzEl | ( | Coordinates & | coords | ) |
....................................................................... Given a (L, L, A) coordinate, return its Az, El relative to the position of this object
|
static |
Second derivatives of the UVW coordinates wrt time. (X/s^2)
....................................................................... Return the second derivative of the (U, V, W) coordinates of the specified XYZ point.
Optional arguments:
longitude (rad) latitude (rad) altitude (m)
|
static |
First derivatives of the UVW coordinates wrt time. (X/s)
....................................................................... Return the first derivative of the (U, V, W) coordinates of the specified XYZ point.
Optional arguments:
longitude (rad) latitude (rad) altitude (m)
|
static |
Get the delay for the Ha and Dec of a source, given XYZ coordinates of a baseline.
Note input coordinates should be TMS XYZ, not absolute XYZ.
Note also that the antenna positions should be earth-centered if you want to apply the correction for the earth's motion.
....................................................................... Calculate the physical delay between light striking the origin of a baseline (X0, Y0, Z0) and light striking the end of the baseline (X, Y, Z). If you are not applying the motion correction (retarded baseline correction, in VLBI jargon), your coordinates can be either surface-relative or earth-centered. If applying the motion correction, coordinates MUST be earth-centered, as it is these coordinates, and not some relative XYZ, which are needed to correctly calculate the derivative of the w coordinate of the baseline endpoint.
|
static |
Calculate the delay, in NanoSeconds, for the specified XYZ point, for a source direction given by az/el.
Note: input coordinates should be TMS XYZ, not absolute XYZ
....................................................................... Calculate the physical delay, in meters, for the specified XYZ point, for a source direction given by az/el.
Vector< double > Coordinates::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.
....................................................................... Given N, E, U relative to the coordinates in this object, return the latitude, longitude, and altitude.
Optionally:
east (m) north (m) up (m)
Return UEN coordinates of the specified LLA point, relative to the coordinates stored in this object
....................................................................... Return the (E, N, U) coordinates of a point specified in (L, L, A) coordinates, relative to the latitude and longitude of this object.
Optional arguments:
longitude (rad) latitude (rad) altitude (m)
Vector< double > Coordinates::getUen | ( | Coordinates & | coords | ) |
....................................................................... Return (E, N, U) coordinates of the specified LLA point, relative to the coordinates stored in this object.
Return the UVW coordinates for the current LLA location, of a source at the requested declination and hour angle. Note that the coordinates in this container refer to an absolute position, or effectively, to a baseline stretching from the origin of the XYZ coordinate system to the location stored in this container, which is the center of the earth.
....................................................................... Return the (U, V, W) coordinates of requested source position, relative to the position in this object.
Optional arguments:
longitude (rad) latitude (rad) altitude (m)
Vector< double > Coordinates::getXyz | ( | double | up = 0.0 , |
double | east = 0.0 , |
||
double | north = 0.0 , |
||
bool | geocentric = true |
||
) |
Return XYZ coordinates of the given UEN point, relative to the LLA point of this object.
....................................................................... Return the XYZ interferometry coordinates of a point specified in UEN coordinates, relative to the LLA of this object.
Optional arguments:
east (m) north (m) up (m) geocentric – If true, return geocentric (earth-centered) coordinates, if false, return topocentric (surface-relative) coords. 2
|
static |
Return the UVW coordinates, relative to a given XYZ coordinate, for the requested source position. Note that if the passed XYZ coordinates are the (relative) coordinates of a baseline, you will get the UVW coordinates relative to the origin of your baseline. If the passed XYZ coordinates are actual antenna coordinates, you will get the UVW coordinates relative to the origin of the XYZ coordinate system.
....................................................................... Return the (U, V, W) coordinates of the specified (X, Y, Z) point.
Optional arguments:
longitude (rad) latitude (rad) altitude (m)
|
static |
Return the XYZ coordinate of a vector at requested (Ha, Dec) direction and of length r.
geocentric | If true, return geocentric (X, Y, Z). If false, returned coordinates will be topocentric. |
type | If ACTUAL, interpret r to mean an actual distance (in AU). If INF, ignore r and return the source direction only. |
....................................................................... Return the (X, Y, Z) coordinates of the specified (R, Ha, Dec) coordinate.
|
static |
Return the Az El of a source at a given HA and Dec.
latitude | The latitude wrt to which the coordinates are desired |
altitude | The altitude wrt to which the coordinates are desired |
ha | The HA of the source, wrt the point of observation |
declination | The declination of the source. |
geocentric | If true, the Az, El returned will be geocentric. If false, the Az, El returned will be topocentric. Note that if you request topocentric Az/El, you do not need to correct the returned values for horizontal parallax. Horizontal parallax is the correction between geocentric and topocentric Az/El. |
type | If ACTUAL, interpret r to mean an actual distance (in AU). If INF, ignore r and return the source direction only. |
....................................................................... Return the (Az, El) coordinates of the specified (HA, Dec) point.
|
static |
Return the XYZ coordinates of an UEN point relative to a fiducial LA. Note that no longitude is required, as the X-Z plane of the XYZ coordinate system always lies in the local meridian.
If geocentric==true, the origin of the returned XYZ coordinates will be the center of the earth. If false, the origin will be at the fiducial point on the surface. Use whichever definition pleases you – you'd better get identical results for a baseline specified in either system, since those coordinates are always relative.
....................................................................... Return TMS XYZ interferometry coordinates, given:
latitude (rad) altitude (m)
And optionally:
east (m) north (m) – An offset relative to the fiducial LLA point. up (m)
geocentric – True if the coordinates returned should be relative to the center of the earth (geocentric). Use 'false' if you want XYZ coordinates relative to the surface of the earth (topocentric)
|
static |
Return the UEN of an LLA point relative to a fiducial LLA point.
....................................................................... Return the UEN coordinates of a LLA point, relative to a fiducial LLA point
|
static |
Return absolute XYZ of the point offset by UEN from a given LLA point.
....................................................................... Return absolute X, Y, Z interferometry coordinates, given:
latitude (rad) east longitude (rad) altitude (m)
And optionally:
east (m) north (m) up (m)
|
static |
Return the LLA of the point given by an UEN offset relative to a fiducial LLA.
....................................................................... Given a fiducial LLA and an UEN offset relative to it, return the latitude, longitude, and altitude.
latitude (rad) east longitude (rad) altitude (m)
And optionally:
east (m) north (m) up (m)
|
static |
Return the LL of the point given by an az/el offset relative to a fiducial LL
....................................................................... Given a fiducial LL and an AZ/EL offset relative to it, return the latitude and longitude of the offset direction
latitude (rad) east longitude (rad) az (rad) el (rad)
|
inline |
Position return methods
|
static |
....................................................................... Given fiducial position on the sky (assumed to be at 0h), and a polar offset (theta, rho) from it (where theta is measured clockwise looking out on the sky), return the ra, dec coordinates of the new location.
void Coordinates::setAltitude | ( | double | altitude | ) |
Set just the altitude
void Coordinates::setLatitude | ( | Angle | latitude | ) |
Set just the latitude
Set methods
....................................................................... Set methods
void Coordinates::setLongitude | ( | Angle | longitude | ) |
Set just the longitude
|
static |
....................................................................... Given polar offsets on the sky from a given dec position (assumed to be at HA=0h), theta (azimuthal) and rho (radial), return the XYZ direction cosines.
Given a topocentric XYZ, return the UEN coordinates at a given latitude
....................................................................... Given a topocentric XYZ, return the UEN coordinates at a given latitude
Given UEN, return the Azimuth and Elevation
....................................................................... Given UEN, return the Azimuth and Elevation
....................................................................... Given UEN, return the Azimuth and Elevation
|
static |
Return the dHa and dDec corresponding to the specified (X, Y, Z) coordinate.
....................................................................... Return the dHa and dDec corresponding to the specified (X, Y, Z) coordinate
Return the dHa and dDec corresponding to the specified (X, Y, Z) coordinate.
....................................................................... Return the dHa and dDec (from pi/2) corresponding to the specified (X, Y, Z) coordinate
|
friend |
Allows cout << coords
|
static |
Conversion between AU and meters
|
static |
Flattening of the earth
|
static |
Rotational angular velocity of the earth, in radians per second