CARMA C++
|
This class performs conversions between several different antenna coordinate systems. More...
#include <carma/services/AntennaCoordinates.h>
Public Member Functions | |
void | add (double up, double east, double north) |
Increment the LLA of this object by the specified UEN offset. More... | |
const Length & | altitude () const |
Get the altitude of these coordinates. More... | |
AntennaCoordinates () | |
Default constructor, uses CARMA reference position. More... | |
AntennaCoordinates (Angle longitude, Angle latitude, Length altitude) | |
Constructor with initialization of LLA. More... | |
AntennaCoordinates (const carma::services::Location &location) | |
Constructor with initialization of LLA via Location object. More... | |
AntennaCoordinates (const AntennaCoordinates &rhs) | |
Copy constructor. More... | |
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. More... | |
Vector< Angle > | getAzEl (Angle longitude, Angle latitude, Length altitude) |
Given a LLA coordinate, return its Az, El relative to the position of this object. More... | |
Vector< Angle > | getAzEl (AntennaCoordinates &coords) |
Given an AntennaCoordinate, return its Az, El relative to the position of this object. More... | |
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. More... | |
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,. More... | |
Vector< double > | getUen (AntennaCoordinates &coords) |
Return UEN coordinates of the specified LLA point, relative to the coordinates stored in this object,. More... | |
Vector< double > | getUvw (HourAngle ha, Angle declination) |
Return the UVW coordinates for the current LLA location, of a source at the requested declination and hour angle. More... | |
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. More... | |
const Angle & | latitude () const |
const Angle & | longitude () const |
Get the longitude of these coordinates. More... | |
AntennaCoordinates & | operator= (const AntennaCoordinates &rhs) |
Assignment operator to go along with the copy constructor. More... | |
void | setAltitude (Length altitude) |
Set just the altitude. More... | |
void | setLatitude (Angle latitude) |
Set just the latitude. More... | |
void | setLla (Angle longitude, Angle latitude, Length altitude) |
Set all coordinate parameters. More... | |
void | setLongitude (Angle longitude) |
Set just the longitude. More... | |
virtual | ~AntennaCoordinates () |
Destructor. More... | |
![]() | |
const Vector< type > | cross (const Vector< type > &vec) |
Assignment void operator=(const Vector<type>& vec);. More... | |
double | magnitude () |
Get the magnitude of a vector. More... | |
const type | operator* (const Vector< type > &vec) |
Vector multiplication, aka dot product. More... | |
const Vector< type > | operator* (const type factor) |
...................................................................... More... | |
const Vector< type > | operator+ (const Vector< type > &vec) |
Vector addition. More... | |
const Vector< type > | operator+ (const type offset) |
...................................................................... More... | |
const Vector< type > | operator- (const Vector< type > &vec) |
...................................................................... More... | |
const Vector< type > | operator- (const type offset) |
...................................................................... More... | |
const Vector< type > | operator/ (const type factor) |
...................................................................... More... | |
type & | operator[] (unsigned i) |
Define an operator for accessing elements of the vector. More... | |
type | operator[] (unsigned i) const |
void | resize (unsigned n) |
Private resize operator. More... | |
unsigned | size () const |
Query the size of the vector. More... | |
Vector (unsigned n) | |
Constructor. More... | |
Vector (unsigned n, type initializer) | |
Constructor for class types without default constructor. More... | |
Vector (type el0, type el1, type el2) | |
Constructor. More... | |
Vector (const Vector< type > &vec) | |
Copy constructor. More... | |
Vector () | |
Private constructor with no arguments. More... | |
virtual | ~Vector () |
Destructor. More... | |
Static Public Member Functions | |
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. More... | |
static Vector< double > | absXyzToLla (double XA, double YA, double ZA) |
Given absolute XYZ, convert to LLA. More... | |
static Vector< double > | azElToUen (Angle az, Angle el, double r=1.0) |
Given Azimuth and Elevation, return the UEN coordinates. More... | |
static Vector< double > | getd2Uvw (HourAngle ha, Angle declination, double X, double Y, double Z) |
Second derivatives of the UVW coordinates wrt time. More... | |
static Vector< double > | getdUvw (HourAngle ha, Angle declination, double X, double Y, double Z) |
First derivatives of the UVW coordinates wrt time. More... | |
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. More... | |
static Delay | getGeometricDelay (Angle latitude, Length altitude, Angle az, Angle el, double X, double Y, double Z) |
Calculate the delay for the specified XYZ point, for a source direction given by az/el, with respect to the reference point of this AntennaCoordinates object. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
static Vector< double > | topoXYZToUen (double X, double Y, double Z, Angle latitude) |
Given a topocentric XYZ, return the UEN coordinates at a given latitude. More... | |
static Vector< Angle > | uenToAzEl (double U, double E, double N) |
Given UEN, return the Azimuth and Elevation. More... | |
static Vector< Angle > | uenToAzEl (Vector< double > &uen) |
Given UEN, return the Azimuth and Elevation. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &os, const AntennaCoordinates &coords) |
Allows cout << coords. More... | |
Additional Inherited Members | |
![]() | |
std::vector< type > | data_ |
unsigned | nEl_ |
Store the length. More... | |
This class performs conversions between several different antenna coordinate systems.
These are described below.
(L, L, A): The longitude/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. The XYZ coordinate system can have as its origin the center of the Earth (geocentric) or be fixed to the surface at some fiducial point (topocentric). 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. This coordinate system is typically used for VLBI. In GPS lingo, this is known as Earth Center Earth Fixed (ECEF) coordinates. The method 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 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 convert 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.
Definition at line 90 of file AntennaCoordinates.h.
carma::services::AntennaCoordinates::AntennaCoordinates | ( | ) |
Default constructor, uses CARMA reference position.
carma::services::AntennaCoordinates::AntennaCoordinates | ( | Angle | longitude, |
Angle | latitude, | ||
Length | altitude | ||
) |
Constructor with initialization of LLA.
longitude | carma::services::Angle representing the longitude |
latitude | carma::services::Angle representing the latitude |
altitude | carma::services::Length representing the Altitude |
carma::services::AntennaCoordinates::AntennaCoordinates | ( | const carma::services::Location & | location | ) |
Constructor with initialization of LLA via Location object.
location | The specified Location |
carma::services::AntennaCoordinates::AntennaCoordinates | ( | const AntennaCoordinates & | rhs | ) |
Copy constructor.
rhs | the AntennaCordinates object to copy |
|
virtual |
Destructor.
|
static |
Return the LLA of the point given by the specified absolute XYZ and UEN offset.
XA | the absolute X value in meters |
YA | the absolute Y value in meters |
ZA | the absolute Z value in meters |
up | The Up coordinate in meters |
east | The East coordinate in meters |
north | The North coordinate in meters |
|
static |
Given absolute XYZ, convert to LLA.
XA | the absolute X value in meters |
YA | the absolute Y value in meters |
ZA | the absolute Z value in meters |
void carma::services::AntennaCoordinates::add | ( | double | up, |
double | east, | ||
double | north | ||
) |
Increment the LLA of this object by the specified UEN offset.
up | The Up coordinate in meters |
east | The East coordinate in meters |
north | The North coordinate in meters |
const Length& carma::services::AntennaCoordinates::altitude | ( | ) | const |
Get the altitude of these coordinates.
Definition at line 175 of file AntennaCoordinates.h.
|
static |
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.
az | an Angle representing the azimuth |
el | an Angle representing the elevation |
r | the direction vector length |
Vector<double> carma::services::AntennaCoordinates::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.
up | The Up coordinate in meters |
east | The East coordinate in meters |
north | The North coordinate in meters |
Vector<Angle> carma::services::AntennaCoordinates::getAzEl | ( | Angle | longitude, |
Angle | latitude, | ||
Length | altitude | ||
) |
Given a LLA coordinate, return its Az, El relative to the position of this object.
longitude | carma::services::Angle representing the longitude |
latitude | carma::services::Angle representing the latitude |
altitude | carma::services::Length representing the Altitude |
Vector<Angle> carma::services::AntennaCoordinates::getAzEl | ( | AntennaCoordinates & | coords | ) |
Given an AntennaCoordinate, return its Az, El relative to the position of this object.
coords | the AntennaCordinates object in question |
|
static |
Second derivatives of the UVW coordinates wrt time.
(X/s^2)
|
static |
First derivatives of the UVW coordinates wrt time.
(X/s)
|
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.
|
static |
Calculate the delay for the specified XYZ point, for a source direction given by az/el, with respect to the reference point of this AntennaCoordinates object.
the | latitude of the station. |
the | altitude of the station |
the | azimuth of the source w.r.t. the station location |
the | elevation of the source w.r.t. the station location |
the | elevation of the source w.r.t. the station location |
the | X coordinate of the station, in meters |
the | Y coordinate of the station, in meters |
the | Z coordinate of the station, in meters Note: input coordinates should be TMS XYZ, not absolute XYZ |
Vector<double> carma::services::AntennaCoordinates::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.
up | The Up coordinate in meters |
east | The East coordinate in meters |
north | The North coordinate in meters |
Vector<double> carma::services::AntennaCoordinates::getUen | ( | Angle | longitude, |
Angle | latitude, | ||
Length | altitude | ||
) |
Return UEN coordinates of the specified LLA point, relative to the coordinates stored in this object,.
longitude | An Angle representing the longitude for which UEN should be computed. |
latitude | An Angle representing the longitude for which UEN should be computed. |
altitude | A Length representing the longitude for which UEN should be computed. |
Vector<double> carma::services::AntennaCoordinates::getUen | ( | AntennaCoordinates & | coords | ) |
Return UEN coordinates of the specified LLA point, relative to the coordinates stored in this object,.
coords | An AntennaCoordinates object containing the LLA for which UEN should be computed. |
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.
ha | An HourAngle representing the hour angle of the source |
declination | An Angle representing the declination of the source |
Vector<double> carma::services::AntennaCoordinates::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.
up | The Up coordinate in meters |
east | The East coordinate in meters |
north | The North coordinate in meters |
|
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.
|
static |
Return the XYZ coordinate of a vector at requested (Ha, Dec) direction and of length r.
ha | An HourAngle representing the hour angle of the source |
declination | An Angle representing the declination of the source |
distance | the distance to the source, represented as a carma::services::Distance |
geocentric | If true, return geocentric (X, Y, Z). If false, returned coordinates will be topocentric. |
|
static |
Return the Az El of a source at a given HA and Dec.
latitude | The latitude wrt to which the coordinates are desired, represented by a carma::services::Angle |
altitude | The altitude wrt to which the coordinates are desired, represented by a carma::services::Angle |
ha | An HourAngle representing the hour angle of the source |
declination | An Angle representing the declination of the source |
distance | the distance to the source, represented as a carma::services::DIstance |
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. |
|
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.
latitude | The fiducial latitude |
altitude | The fiducial altitude |
up | The Up coordinate in meters |
east | The East coordinate in meters |
north | The North coordinate in meters |
|
static |
Return the UEN of an LLA point relative to a fiducial LLA point.
longitude | The fiducial longitude |
latitude | The fiducial latitude |
altitude | The fiducial altitude |
longitude | carma::services::Angle representing the longitude |
latitude | carma::services::Angle representing the latitude |
altitude | carma::services::Length representing the altitude |
|
static |
Return absolute XYZ of the point offset by UEN from a given LLA point.
longitude | carma::services::Angle representing the longitude |
latitude | carma::services::Angle representing the latitude |
altitude | carma::services::Length representing the altitude |
up | The Up coordinate in meters |
east | The East coordinate in meters |
north | The North coordinate in meters |
|
static |
Return the LLA of the point given by an UEN offset relative to a fiducial LLA.
longitude | The fiducial longitude |
latitude | The fiducial latitude |
altitude | The fiducial altitude |
up | The Up coordinate in meters |
east | The East coordinate in meters |
north | The North coordinate in meters |
const Angle& carma::services::AntennaCoordinates::longitude | ( | ) | const |
Get the longitude of these coordinates.
Definition at line 159 of file AntennaCoordinates.h.
AntennaCoordinates& carma::services::AntennaCoordinates::operator= | ( | const AntennaCoordinates & | rhs | ) |
Assignment operator to go along with the copy constructor.
rhs | the AntennaCordinates object to copy |
void carma::services::AntennaCoordinates::setAltitude | ( | Length | altitude | ) |
Set just the altitude.
altitude | carma::services::Length representing the Altitude |
void carma::services::AntennaCoordinates::setLatitude | ( | Angle | latitude | ) |
Set just the latitude.
latitude | carma::services::Angle representing the latitude |
void carma::services::AntennaCoordinates::setLla | ( | Angle | longitude, |
Angle | latitude, | ||
Length | altitude | ||
) |
Set all coordinate parameters.
longitude | carma::services::Angle representing the longitude |
latitude | carma::services::Angle representing the latitude |
altitude | carma::services::Length representing the Altitude |
void carma::services::AntennaCoordinates::setLongitude | ( | Angle | longitude | ) |
Set just the longitude.
longitude | carma::services::Angle representing the longitude |
|
static |
Given a topocentric XYZ, return the UEN coordinates at a given latitude.
X | the topocentric X value in meters |
Y | the topocentric Y value in meters |
Z | the topocentric Z value in meters |
latitude | carma::services::Angle representing the latitude |
|
static |
Given UEN, return the Azimuth and Elevation.
up | The Up coordinate in meters |
east | The East coordinate in meters |
north | The North coordinate in meters |
|
static |
Given UEN, return the Azimuth and Elevation.
a | carma::services::Vector containing up, east, and north in meters. uen[0] = up, uen[1]=east, uen[2] = north. |
|
friend |
Allows cout << coords.