Loading...
Searching...
No Matches
supernovas::Observer Class Reference
Observer location

An abstract observer location. More...

`#include <supernovas.h>`

Inheritance diagram for supernovas::Observer:

## Public Member Functions

virtual | ~Observer ()
const observer * | _novas_observer () const
| Returns the underlying NOVAS C observer data structure.
virtual const Observer * | copy () const
| Returns a newly allocated copy of this observer.
virtual bool | equals (const Observer &other) const
| Checks if this observer is essentially the same as the other, within the tolerances associated to their defining components.
Frame | frame_at (const Time &time, enum novas_accuracy accuracy=NOVAS_FULL_ACCURACY) const
| Returns an observing frame for this observer at the specified time and optionally with a specified accuracy.
virtual bool | is_geocentric () const
| Checks if this observer can be cast to a GeocentricObserver.
virtual bool | is_geodetic () const
| Checks if this observer can be cast to a GeodeticObserver.
bool | operator!= (const Observer &other) const
| Checks if two observers differ given standard tolerances associated to their defining components.
bool | operator== (const Observer &other) const
| Checks if two observers are essentially the same within the tolerances associated to their defining components.
Frame | reduced_accuracy_frame_at (const Time &time) const
| Returns a reduced accuracy observing frame for this observer at the specified time.
Interferometric | to_interferometric (const Apparent &phase_center, enum novas_reference_system system=NOVAS_ICRS) const
| Returns projected u,v,w coordinates for an interferometer station.
virtual std::string | to_string () const
| Returns a string representation of this observer.
enum novas_observer_place | type () const
| Returns the observer type.
Public Member Functions inherited from supernovas::Validating
bool | is_valid () const
| Returns the previously set 'valid' state 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 GeocentricObserver | at_geocenter ()
| Returns a fictitious observer placed at the location of the geocenter.
static SolarSystemObserver | at_ssb ()
| Returns a fictitious observer placed at the location of the Solar-System Barycenter (SSB).
static GeocentricObserver | in_earth_orbit (const Position &pos, const Velocity &vel)
| Returns a new observer orbiting the Earth.
static SolarSystemObserver | in_solar_system (const Position &pos, const Velocity &vel)
| Returns a new observer in some Solar-system location.
static GeodeticObserver | moving_on_earth (const Site &site, const EOP &eop, const ScalarVelocity &horizontal, const Angle &direction, const ScalarVelocity &vertical=ScalarVelocity::stationary())
| Instantiates a new observer that is moving relative to Earth's surface, such as an airborne observer.
static GeodeticObserver | moving_on_earth (const Site &site, const Velocity &itrs_vel, const EOP &eop=EOP::undefined())
| Returns a new observer that is moving, at some velocitym relative to Earth's surface, such as an airborne aircraft or balloon based observatory.
static GeodeticObserver | on_earth (const Site &site, const EOP &eop=EOP::undefined())
| Returns a new observer located at a fixed observing site.
static const Observer & | undefined ()
| Returns a reference to a statically defined standard invalid observer.

## Protected Member Functions

| Observer (enum novas_observer_place type, const Site &site=Site::undefined(), const Position &pos=Position::origin(), const Velocity &vel=Velocity::stationary())
virtual Position | gcrs_position_at (const Time &time, enum novas_accuracy accuracy=NOVAS_FULL_ACCURACY) const
| Returns the geocentric geometric position vector for this observer, in the GCRS, at the specified time and accuracy.
virtual Velocity | gcrs_velocity_at (const Time &time, enum novas_accuracy accuracy=NOVAS_FULL_ACCURACY) const
| Returns the geocentric geometric velocity vector for this observer, in the GCRS, at the specified time and accuracy.
Protected Member Functions inherited from supernovas::Validating
| Validating ()
| dummy constructor;

## Protected Attributes

observer | _observer = {}
| stored observer data
Protected Attributes inherited from supernovas::Validating
bool | _valid = false
| the state variable.

## Detailed Description

An abstract observer location.

Both Earth-bound (geodetic sites, airborne, or Earth-orbit) locations, and locations elsewhere in the Solar-system are supported. See the static methods of this class for instantiating different subclasses as appropriate.

Since
  1.6

See also
  Frame

## Constructor & Destructor Documentation

## Observer()

supernovas::Observer::Observer | ( | enum novas_observer_place | type,
|  | const Site & | site = Site::undefined(),
|  | const Position & | pos = Position::origin(),
|  | const Velocity & | vel = Velocity::stationary() )

explicit protected

References _observer, supernovas::Site::_on_surface(), supernovas::Unit::AU, supernovas::Unit::AU_per_day, supernovas::Unit::km, supernovas::Unit::km_per_s, NOVAS_SOLAR_SYSTEM_OBSERVER, and type().

## ~Observer()

virtual supernovas::Observer::~Observer | ( |  | ) |

inline virtual

## Member Function Documentation

## _novas_observer()

const observer * supernovas::Observer::_novas_observer | ( |  | ) | const

Returns the underlying NOVAS C observer data structure.

Returns
  pointer to the underlying C observer data structure.

Since
  1.6

References _novas_observer(), and _observer.

Referenced by supernovas::Frame::Frame(), and _novas_observer().

## at_geocenter()

GeocentricObserver supernovas::Observer::at_geocenter | ( |  | ) |

static

Returns a fictitious observer placed at the location of the geocenter.

Returns
  a new fictitious observer located at the geocenter.

Since
  1.6

See also
  on_earth(), in_earth_orbit(), in_solar_system(), at_ssb()

References at_geocenter().

Referenced by at_geocenter().

## at_ssb()

SolarSystemObserver supernovas::Observer::at_ssb | ( |  | ) |

static

Returns a fictitious observer placed at the location of the Solar-System Barycenter (SSB).

Returns
  a new fictitious observer located at the Solar-System Barycenter (SSB).

Since
  1.6

See also
  in_solar_system(), at_geocenter(), on_earth(), in_earth_orbit()

References at_ssb().

Referenced by at_ssb(), and supernovas::SolarSystemSource::barycentric_at().

## copy()

const Observer * supernovas::Observer::copy | ( |  | ) | const

virtual

Returns a newly allocated copy of this observer.

The default implementation returns an invalid observer, but concrete subclasses should override that to return their onw copies.

Returns
  a copy of this observer class, which may be an invalid observer (default).

Since
  1.6

Reimplemented in supernovas::GeocentricObserver, supernovas::GeodeticObserver, and supernovas::SolarSystemObserver.

References copy().

Referenced by copy(), and supernovas::Frame::operator=().

## equals()

bool supernovas::Observer::equals | ( | const Observer & | other | ) | const

virtual

Checks if this observer is essentially the same as the other, within the tolerances associated to their defining components.

Note, that an observer may not equal itself if it contains NAN or infinite components.

Parameters

  other | the other observer

Returns
  true if both observers effectively describe the same observing location, within tolerances, or else false.

Since
  1.7

See also
  operator==(), operator!=()

Reimplemented in supernovas::GeodeticObserver.

References _observer, equals(), and novas_equals_observer().

Referenced by supernovas::GeodeticObserver::equals(), equals(), operator!=(), and operator==().

## gcrs_position_at()

Position supernovas::Observer::gcrs_position_at | ( | const Time & | time,
|  | enum novas_accuracy | accuracy = NOVAS_FULL_ACCURACY ) const

protected virtual

Returns the geocentric geometric position vector for this observer, in the GCRS, at the specified time and accuracy.

Parameters

  time | Astrometric time of observation
  accuracy | (optional) NOVAS_FULL_ACCURACY (default) or NOVAS_REDUCED_ACCURACY.

Returns
  The ICRS geometric geocentric position vector of this observer at the specified time.

Since
  1.6

See also
  gcrs_velocity_at()

Reimplemented in supernovas::GeodeticObserver.

References supernovas::Time::_novas_timespec(), _observer, supernovas::Unit::AU, gcrs_position_at(), geo_posvel(), supernovas::Time::jd(), supernovas::Position::undefined(), and novas_timespec::ut1_to_tt.

Referenced by gcrs_position_at(), and to_interferometric().

## gcrs_velocity_at()

Velocity supernovas::Observer::gcrs_velocity_at | ( | const Time & | time,
|  | enum novas_accuracy | accuracy = NOVAS_FULL_ACCURACY ) const

protected virtual

Returns the geocentric geometric velocity vector for this observer, in the GCRS, at the specified time and accuracy.

Parameters

  time | Astrometric time of observation
  accuracy | (optional) NOVAS_FULL_ACCURACY (default) or NOVAS_REDUCED_ACCURACY.

Returns
  The ICRS geometric geocentric velocity vector of this observer at the specified time.

Since
  1.6

See also
  gcrs_position_at()

Reimplemented in supernovas::GeodeticObserver.

References supernovas::Time::_novas_timespec(), _observer, supernovas::Unit::AU, gcrs_velocity_at(), geo_posvel(), supernovas::Time::jd(), supernovas::Velocity::undefined(), and novas_timespec::ut1_to_tt.

Referenced by gcrs_velocity_at(), and to_interferometric().

## in_earth_orbit()

GeocentricObserver supernovas::Observer::in_earth_orbit | ( | const Position & | pos,
|  | const Velocity & | vel )

static

Returns a new observer orbiting the Earth.

Parameters

  pos | momentary position of the observer relative to the geocenter.
  vel | momentary velocity of the observer relative to the geocenter.

Returns
  a new observer instance for the observer in Earth orbit.

Since
  1.6

See also
  on_earth(), in_solar_system(), at_geocenter(), at_ssb()

References in_earth_orbit(), and supernovas::Validating::is_valid().

Referenced by in_earth_orbit().

## in_solar_system()

SolarSystemObserver supernovas::Observer::in_solar_system | ( | const Position & | pos,
|  | const Velocity & | vel )

static

Returns a new observer in some Solar-system location.

Parameters

  pos | momentary position of the observer relative to the Solar-system Barycenter (SSB).
  vel | momentary velocity of the observer relative to the Solar-system Barycenter (SSB).

Returns
  a new observer instance for the given Solar-system location.

Since
  1.6

See also
  at_ssb(), at_geocenter(), on_earth(), in_earth_orbit()

References in_solar_system(), and supernovas::Validating::is_valid().

Referenced by in_solar_system().

## is_geocentric()

bool supernovas::Observer::is_geocentric | ( |  | ) | const

virtual

Checks if this observer can be cast to a GeocentricObserver.

Returns
  true if this observer is an instance of GeocentricObserver, otherwise false.

Since
  1.6

See also
  GeocentricObserver, is_geodetic()

Reimplemented in supernovas::GeocentricObserver.

References is_geocentric().

Referenced by is_geocentric().

## is_geodetic()

bool supernovas::Observer::is_geodetic | ( |  | ) | const

virtual

Checks if this observer can be cast to a GeodeticObserver.

Returns
  true is this observer is an instance of GeodeticObserver, otherwise false.

Since
  1.6

See also
  GeodeticObserver, is_geocentric()

Reimplemented in supernovas::GeodeticObserver.

References is_geodetic().

Referenced by supernovas::Frame::Frame(), supernovas::GeodeticObserver::equals(), supernovas::Source::horizontal_track(), and is_geodetic().

## moving_on_earth() [1/2]

GeodeticObserver supernovas::Observer::moving_on_earth | ( | const Site & | site,
|  | const EOP & | eop,
|  | const ScalarVelocity & | horizontal,
|  | const Angle & | direction,
|  | const ScalarVelocity & | vertical = ScalarVelocity::stationary() )

static

Instantiates a new observer that is moving relative to Earth's surface, such as an airborne observer.

Parameters

  site | the momentary geodetic location of the observer.
  eop | Mean (preferably interpolated) Earth Orientation Parameters (EOP) appropriate around the time of observation, such as obtained from the IERS bulletins or data service, or EOP::undefined() to let Frame fetch polar offsets from IERS as needed
  horizontal | momentary horizontal speed of moving observer.
  direction | azimuthal direction of motion (from North, measured to the East).
  vertical | (optional) momentary vertical speed of observer (default: 0).

Since
  1.6

See also
  Site::enu_to_itrf()

References supernovas::Validating::is_valid(), and moving_on_earth().

## moving_on_earth() [2/2]

GeodeticObserver supernovas::Observer::moving_on_earth | ( | const Site & | geodetic,
|  | const Velocity & | itrs_vel,
|  | const EOP & | eop = EOP::undefined() )

static

Returns a new observer that is moving, at some velocitym relative to Earth's surface, such as an airborne aircraft or balloon based observatory.

Parameters

  geodetic | the momentary geodetic location of the observer.
  itrs_vel | the momentary velocity of the observer with respect to the surface (in ITRS).
  eop | (optional) Mean (preferably interpolated) Earth Orientation Parameters (EOP) appropriate around the time of observation, such as obtained from the IERS bulletins or data service, or EOP::undefined() to let Frame fetch polar offsets from IERS as needed (default: undefined).

Returns
  a new observer instance for the given moving observer.

Since
  1.6

See also
  on_earth(), in_earth_orbit(), in_solar_system(), at_geocenter(), at_ssb()

References supernovas::Validating::is_valid(), and moving_on_earth().

Referenced by moving_on_earth(), and moving_on_earth().

## on_earth()

GeodeticObserver supernovas::Observer::on_earth | ( | const Site & | site,
|  | const EOP & | eop = EOP::undefined() )

static

Returns a new observer located at a fixed observing site.

Parameters

  site | the observing site
  eop | (optional) Mean (preferably interpolated) Earth Orientation Parameters (EOP) appropriate around the time of observation, such as obtained from the IERS bulletins or data service, or EOP::undefined() to let Frame fetch polar offsets from IERS as needed (default: undefined).

Returns
  a new observer instance for the given observing site.

Since
  1.6

See also
  moving_on_earth(), in_earth_orbit(), in_solar_system(), at_geocenter(), at_ssb()

References supernovas::Validating::is_valid(), and on_earth().

Referenced by on_earth(), and supernovas::Site::to_observer().

## operator!=()

bool supernovas::Observer::operator!= | ( | const Observer & | other | ) | const

Checks if two observers differ given standard tolerances associated to their defining components.

Same as !equals().

Parameters

  other | the other observer

Returns
  true if this and the argument describe distinct observing locations, or else false.

Since
  1.7

See also
  equals(), operator==()

References equals(), and operator!=().

Referenced by operator!=().

## operator==()

bool supernovas::Observer::operator== | ( | const Observer & | other | ) | const

Checks if two observers are essentially the same within the tolerances associated to their defining components.

Same as equals().

Parameters

  other | the other observer

Returns
  true if both observers effectively describe the same observing location, within tolerances, or else false.

Since
  1.7

See also
  equals(), operator!=()

References equals(), and operator==().

Referenced by operator==().

## to_string()

std::string supernovas::Observer::to_string | ( |  | ) | const

virtual

Returns a string representation of this observer.

Returns
  a new string with a brief description of this observer.

Since
  1.6

Reimplemented in supernovas::GeocentricObserver, supernovas::GeodeticObserver, and supernovas::SolarSystemObserver.

References _observer, and to_string().

Referenced by to_string().

## type()

enum novas_observer_place supernovas::Observer::type | ( |  | ) | const

Returns the observer type.

Returns
  the observer type constant for this observer

Since
  1.6

References _observer, and type().

Referenced by Observer(), and type().

## undefined()

const Observer & supernovas::Observer::undefined | ( |  | ) |

static

Returns a reference to a statically defined standard invalid observer.

This invalid observer may be used inside any object that is invalid itself.

Since
  1.6

Returns
  a reference to a static standard invalid observer.

References undefined().

Referenced by supernovas::GeocentricObserver::GeocentricObserver(), supernovas::SolarSystemObserver::SolarSystemObserver(), and undefined().

## Member Data Documentation

## _observer

observer supernovas::Observer::_observer = {}

protected

stored observer data

Referenced by supernovas::GeodeticObserver::GeodeticObserver(), supernovas::GeodeticObserver::GeodeticObserver(), Observer(), supernovas::SolarSystemObserver::SolarSystemObserver(), supernovas::SolarSystemObserver::SolarSystemObserver(), _novas_observer(), supernovas::GeodeticObserver::enu_velocity(), equals(), supernovas::GeocentricObserver::gcrs_position(), supernovas::GeodeticObserver::gcrs_position_at(), gcrs_position_at(), supernovas::GeocentricObserver::gcrs_velocity(), supernovas::GeodeticObserver::gcrs_velocity_at(), gcrs_velocity_at(), supernovas::GeodeticObserver::itrs_velocity(), supernovas::GeodeticObserver::site(), supernovas::SolarSystemObserver::ssb_position(), supernovas::SolarSystemObserver::ssb_velocity(), to_string(), and type().