CARMA C++
carma::services::Location Class Reference

Location specifies a location (observatory if you wish) on planet earth, as longitude, latitude, and altitude above sea-level. More...

#include <carma/services/Location.h>

Public Member Functions

Length getAltitude () const
 
Angle getLatitude () const
 
Angle getLongitude () const
 
std::string getName () const
 
 Location ()
 default constructor, longitude = 0, latitude = 0, altitude = 0. More...
 
 Location (const Angle &longitude, const Angle &latitude, const Length &altitude)
 Full constructor where longitude, latitude and altitude are specified. More...
 
 Location (const std::string &observatory, const std::string &position=REFERENCE)
 Constructor using a name from the Observatory.cat catalog that should live in CARMA/conf/catalogs/Observatory.cat Examples are "carma", "ovro", "wsrt" etc.etc. More...
 
void setAltitude (Length altitude)
 Specify the altitude above sea level. More...
 
void setAltitude (double value, const std::string &units)
 Specify the altitude above sea level, as value and units which will be used to construct a Length internally. More...
 
void setLatitude (Angle latitude)
 Specify the latitude. More...
 
void setLatitude (double value, const std::string &units)
 Specify the latitude, as value and units which will be used to construct an Angle internally. More...
 
void setLongitude (Angle longitude)
 Specify the longitude. More...
 
void setLongitude (double value, const std::string &units)
 Specify the longitude, as value and units which will be used to construct an Angle internally. More...
 
carma::services::Vector< double > vector ()
 the longitude, latitude and altitude (in that order!!!) as a carma:services::Vector. More...
 

Detailed Description

Location specifies a location (observatory if you wish) on planet earth, as longitude, latitude, and altitude above sea-level.

Longitude increases from 0 at Greenwich, England in an easterly direction, and decreases in a westerly direction. East longitudes are positive numbers, between 0 and 180 degrees. West longitudes are negative numbers, between 0 and -180 degrees.

Definition at line 32 of file Location.h.

Constructor & Destructor Documentation

carma::services::Location::Location ( )

default constructor, longitude = 0, latitude = 0, altitude = 0.

carma::services::Location::Location ( const Angle longitude,
const Angle latitude,
const Length altitude 
)

Full constructor where longitude, latitude and altitude are specified.

Recall west (e.g. CARMA) has longitude < 0

Parameters
longitudeLongitude of the observatory. (<0 means west)
latitudeLatitude
altitudeAltitude
carma::services::Location::Location ( const std::string &  observatory,
const std::string &  position = REFERENCE 
)
explicit

Constructor using a name from the Observatory.cat catalog that should live in CARMA/conf/catalogs/Observatory.cat Examples are "carma", "ovro", "wsrt" etc.etc.

The match is case-insensitive. If this constructor were not explicit, Ephemeris(string) constructor could be ambiguously interpreted as meaning a Location or a Source.

Parameters
observatoryName of the observatory
positionName of the station/pad position for this location, defaults to "reference" meaning the array reference position
See Also
carma:services::Observatory

Member Function Documentation

Length carma::services::Location::getAltitude ( ) const
Returns
The altitude, as a Length
Angle carma::services::Location::getLatitude ( ) const
Returns
The latitude, as an Angle
Angle carma::services::Location::getLongitude ( ) const
Returns
The longitude, as an Angle
std::string carma::services::Location::getName ( ) const
Returns
the name of this location, "unnamed" if it has no name
void carma::services::Location::setAltitude ( Length  altitude)

Specify the altitude above sea level.

Parameters
altitudeThe altitude above sea level represented as a carma::services::Length (may be negative)
void carma::services::Location::setAltitude ( double  value,
const std::string &  units 
)

Specify the altitude above sea level, as value and units which will be used to construct a Length internally.

Parameters
valueThe altitude value
unitsThe altitude units
void carma::services::Location::setLatitude ( Angle  latitude)

Specify the latitude.

Parameters
latitudeThe latitude represented as a carma::services::Angle
void carma::services::Location::setLatitude ( double  value,
const std::string &  units 
)

Specify the latitude, as value and units which will be used to construct an Angle internally.

Parameters
valueThe latitude value
unitsThe latitude units
void carma::services::Location::setLongitude ( Angle  longitude)

Specify the longitude.

Parameters
longitudeThe longitude represented as a carma::services::Angle
void carma::services::Location::setLongitude ( double  value,
const std::string &  units 
)

Specify the longitude, as value and units which will be used to construct an Angle internally.

Parameters
valueThe longitude value
unitsThe longitude units
carma::services::Vector<double> carma::services::Location::vector ( )

the longitude, latitude and altitude (in that order!!!) as a carma:services::Vector.

Note the units will be standard CARMA units, i.e., radians for the two angles, and meters for altitude.


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