SuperNOVAS C++ API v1.6
High-precision C/C++ astrometry library
Loading...
Searching...
No Matches
supernovas::Horizontal Class Reference

Horizontal (azimuth, elevation = Az/El) sky coordinates at a geodetic observing location, such as an observatory site, an aircraft, or a balloon. More...

#include <supernovas.h>

Inheritance diagram for supernovas::Horizontal:

Public Member Functions

 Horizontal (const Angle &azimuth, const Angle &elevation)
 Instantiates new horizontal (Az/El) coordinates with the specified components.
 Horizontal (const std::string &az, const std::string &el)
 Instantiates horizontal coordinates with the specified string representations of the azimuth and elevation coordinates, optionally specifying a system and a distance if needed.
 Horizontal (double azimuth, double elevation)
 Instantiates new horizontal (Az/El) coordinates with the specified components.
const Angleazimuth () const
 Returns the azimuth angle.
Angle distance_to (const Horizontal &other) const
 Returns the angular distance of these horizontal coordiantes to/from the specified other horizontal coordinates.
const Angleelevation () const
 Returns the elevation angle.
bool equals (const Horizontal &other, const Angle &precision) const
 Checks if these horizontal coordinates are the same as another, within the specified precision.
bool equals (const Horizontal &other, double precision_rad=1.0 *Unit::uas) const
 Checks if these horizontal coordinates are the same as another, within the specified precision.
bool operator!= (const Horizontal &other) const
 Checks if these horizontal coordinates differ from another, by more than 1 uas.
bool operator== (const Horizontal &other) const
 Checks if these horizontal coordinates are the same as another, within 1 μas.
Apparent to_apparent (const Frame &frame, const ScalarVelocity &rv=ScalarVelocity::stationary(), const Coordinate &distance=Coordinate::at_Gpc()) const
 Converts these horizontal coordinates to an apparent place on the sky for an observer on or near Earth's surface.
Apparent to_apparent (const Frame &frame, double rv=0.0, double distance=Unit::Gpc) const
 Converts these horizontal coordinates to an apparent place on the sky.
Horizontal to_refracted (RefractionModel ref, const Weather &weather=Weather::standard(), const Time &time=Time::undefined())
 Applies atmospheric refraction correction for these coordinates, returning the result.
std::string to_string (enum novas_separator_type separator=NOVAS_SEP_UNITS_AND_SPACES, int decimals=3) const override
 Returns a string representation of these horizontal coordinates, optionally defining the separator type to use for the DMS angle representations, and the number of decimal places to print also.
Horizontal to_unrefracted (RefractionModel ref, const Weather &weather=Weather::standard(), const Time &time=Time::undefined())
 Undoes atmospheric refraction correction for these coordinates, returning the result.
Angle zenith_angle () const
 Returns the zenith distance angle.
Public Member Functions inherited from supernovas::Spherical
 Spherical (const Angle &longitude, const Angle &latitude)
 Instantiates new spherical coordinates with the specified components.
 Spherical (const std::string &longitude, const std::string &latitude)
 Instantiates spherical coordinates with the specified string representations of the longitude and latitude coordinates, optionally specifying a system and a distance if needed.
 Spherical (double longitude_rad, double latitude_rad)
 Instantiates new spherical coordinates with the specified components.
virtual ~Spherical ()
const Anglelatitude () const
 Returns the latitude coordinate as an angle.
const Anglelongitude () const
 Returns the longitude coordinate as an angle.
Position xyz (const Coordinate &distance) const
 Returns the cartesian position vector corresponding to these spherical coordinates.
Public Member Functions inherited from supernovas::Validating
bool is_valid () const
 Returns the previously set 'valid' stae of the implementing instance.
 operator bool () const
 Objects that implement Validating can be used in conditionals directly, without explicitly calling is_valid().

Static Public Member Functions

static const Horizontal & undefined ()
 Returns a reference to a statically defined standard invalid horizontal coordinates.

Additional Inherited Members

Protected Member Functions inherited from supernovas::Spherical
 Spherical ()
 Instantiates invalid spherical coordinates.
Angle distance_to (const Spherical &other) const
 Returns the angular distance of these spherical coordiantes to/from the specified other spherical coordinates.
bool equals (const Spherical &other, double precision) const
Protected Member Functions inherited from supernovas::Validating
 Validating ()
 dummy constructor;
Protected Attributes inherited from supernovas::Validating
bool _valid = false
 the state variable.

Detailed Description

Horizontal (azimuth, elevation = Az/El) sky coordinates at a geodetic observing location, such as an observatory site, an aircraft, or a balloon.

These represent positions relative to the local horizon and meridian, and can be used for both unrefracted (astrometric) or refracted (observed) values or for converting between those two.

See also
Apparent, Site, Weather

Constructor & Destructor Documentation

◆ Horizontal() [1/3]

supernovas::Horizontal::Horizontal ( double azimuth,
double elevation )

Instantiates new horizontal (Az/El) coordinates with the specified components.

Parameters
azimuth[rad] azimuth angle
elevation[rad] elevation angle

References supernovas::Spherical::Spherical(), azimuth(), elevation(), and supernovas::Validating::is_valid().

◆ Horizontal() [2/3]

supernovas::Horizontal::Horizontal ( const Angle & azimuth,
const Angle & elevation )

Instantiates new horizontal (Az/El) coordinates with the specified components.

Parameters
azimuthazimuth angle
elevationelevation angle

References supernovas::Spherical::Spherical(), azimuth(), and elevation().

◆ Horizontal() [3/3]

supernovas::Horizontal::Horizontal ( const std::string & azimuth,
const std::string & elevation )

Instantiates horizontal coordinates with the specified string representations of the azimuth and elevation coordinates, optionally specifying a system and a distance if needed.

After instantiation, you should check that the resulting coordinates are valid, e.g. as:

Horizontal coords = Horizontal(..., ...);
if(!coords.is_valid()) {
// oops, looks like the angles could not be parsed...
return;
}
bool is_valid() const
Returns the previously set 'valid' stae of the implementing instance.
Definition supernovas.h:247
Parameters
azimuthstring representation of the azimuth coordinate in DMS or a decimnal degrees.
elevationstring representation of the elevation coordinate as DMS or decimal degrees.
See also
novas_str_degrees() for details on string representation that can be parsed.
novas_parse_degrees() for more managed parsing from strings.

References azimuth(), and elevation().

Member Function Documentation

◆ azimuth()

const Angle & supernovas::Horizontal::azimuth ( ) const

Returns the azimuth angle.

Same as Spherical::longitude().

Returns
the reference to the azimuth angle stored internally.
See also
longitude(), elevation(), zenith_angle()

References supernovas::Spherical::longitude().

Referenced by Horizontal(), Horizontal(), and Horizontal().

◆ distance_to()

Angle supernovas::Horizontal::distance_to ( const Horizontal & other) const

Returns the angular distance of these horizontal coordiantes to/from the specified other horizontal coordinates.

Parameters
otherthe reference horizontal coordinates
Returns
the angular distance of these coordinates to/from the argument.

References supernovas::Spherical::distance_to(), and supernovas::Validating::is_valid().

◆ elevation()

const Angle & supernovas::Horizontal::elevation ( ) const

Returns the elevation angle.

Same as Spherical::latitude().

Returns
the reference to the elevation angle stored internally.
See also
latitude(), zenith_angle(), azimuth()

References supernovas::Spherical::latitude().

Referenced by Horizontal(), Horizontal(), Horizontal(), to_refracted(), and to_unrefracted().

◆ equals() [1/2]

bool supernovas::Horizontal::equals ( const Horizontal & other,
const Angle & precision ) const

Checks if these horizontal coordinates are the same as another, within the specified precision.

Parameters
otherthe reference horizontal coordinates
precision(optional) precision for equality test (default: 1 μas).
Returns
true if these coordinates are the same as the reference within the precision, or else false.
See also
operator==()

References equals(), and supernovas::Angle::rad().

◆ equals() [2/2]

bool supernovas::Horizontal::equals ( const Horizontal & other,
double precision_rad = 1.0 * Unit::uas ) const

Checks if these horizontal coordinates are the same as another, within the specified precision.

Parameters
otherthe reference horizontal coordinates
precision_rad[rad] (optional) precision for equality test (default: 1 μas).
Returns
true if these coordinates are the same as the reference within the precision, or else false.
See also
operator==()

References supernovas::Spherical::equals().

Referenced by equals(), operator!=(), and operator==().

◆ operator!=()

bool supernovas::Horizontal::operator!= ( const Horizontal & other) const

Checks if these horizontal coordinates differ from another, by more than 1 uas.

Parameters
otherthe reference horizontal coordinates
Returns
true if these coordinates differ from the reference, by more than 1 μas, or else false.
See also
operator==()

References equals().

◆ operator==()

bool supernovas::Horizontal::operator== ( const Horizontal & other) const

Checks if these horizontal coordinates are the same as another, within 1 μas.

Parameters
otherthe reference horizontal coordinates
Returns
true if these coordinates are the same as the reference within 1 μas, or else false.
See also
operator!=()

References equals().

◆ to_string()

std::string supernovas::Horizontal::to_string ( enum novas_separator_type separator = NOVAS_SEP_UNITS_AND_SPACES,
int decimals = 3 ) const
overridevirtual

Returns a string representation of these horizontal coordinates, optionally defining the separator type to use for the DMS angle representations, and the number of decimal places to print also.

Parameters
separatorthe DMS separator type (default: units and spaces).
decimalsthe number of decimal places to print for the seconds (default: 3).
Returns
a new string with the human-readable representation of these horizontal coordinates.

Reimplemented from supernovas::Spherical.

References supernovas::Spherical::to_string().

◆ undefined()

const Horizontal & supernovas::Horizontal::undefined ( )
static

Returns a reference to a statically defined standard invalid horizontal coordinates.

These invalid coordinates may be used inside any object that is invalid itself.

Returns
a reference to the static standard invalid coordinates.

Referenced by supernovas::HorizontalTrack::projected_at(), and supernovas::Apparent::to_horizontal().

◆ zenith_angle()

Angle supernovas::Horizontal::zenith_angle ( ) const

Returns the zenith distance angle.

It is 90° - elevation.

Returns
the zenith angle.
See also
elevation(), azimuth()

References supernovas::Constant::half_pi, supernovas::Validating::is_valid(), and supernovas::Spherical::latitude().