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

A Solar-system source, whose positions / velocities are provided from ephemeris data. More...

#include <supernovas.h>

Inheritance diagram for supernovas::EphemerisSource:

Public Member Functions

 EphemerisSource (const std::string &name, long number=-1)
 Instantiates a new Solar-system body whose positions are provided by ephemeris lookup.
const Sourcecopy () const override
 Returns a pointer to a newly allocated copy of this Solar-system ephemeris source instance.
long number () const
 Returns the number designation of this ephemeris.
std::string to_string () const override
 Returns a simple string representation of this ephemeris source, with the name and number designations.
Public Member Functions inherited from supernovas::SolarSystemSource
Geometric geometric_at (const Time &time, enum novas_accuracy accuracy=NOVAS_FULL_ACCURACY) const
Coordinate helio_distance (const Time &time) const
 Returns the heliocentric distance of a Solar-system source at the specified time of observation.
ScalarVelocity helio_rate (const Time &time) const
 Returns the heliocentric rate of recession of a Solar-system source at the specified time of observation.
double solar_illumination (const Frame &frame) const
 Returns the fraction [0.0:1.0] of the Solar-system source that appears illuminated by the Sun when viewed from a given observing frame, assuming that the source has a spheroidal shape.
double solar_power (const Time &time) const
 Returns the typical incident Solar power on the illuminated side of this Solar-system object.
Public Member Functions inherited from supernovas::Source
virtual ~Source ()
const struct novas_object_novas_object () const
 Returns a pointer to the NOVAS C novas_object data structure that stores data internally.
Angle angle_to (const Source &source, const Frame &frame) const
 Returns the angular separation of this source from another source, for the given observer location and time of observation.
Apparent apparent_in (const Frame &frame) const
 Returns the apparent position of a source (if possible), or else an invalid position.
EquatorialTrack equatorial_track (const Frame &frame, const Interval &range) const
 Returns the short-term equatorial trajectory of this source on the observer's sky, which can be used for extrapolating its apparent position in the near-term to avoid the repeated full-fledged position calculation, which may be expensive.
EquatorialTrack equatorial_track (const Frame &frame, double range_seconds=Unit::hour) const
 Returns the short-term equatorial trajectory of this source on the observer's sky, which can be used for extrapolating its apparent position in the near-term to avoid the repeated full-fledged position calculation, which may be expensive.
Geometric geometric_in (const Frame &frame, enum novas_reference_system system=NOVAS_TOD) const
 Returns the geometric position of a source (if possible), or else an invalid position.
HorizontalTrack horizontal_track (const Frame &frame, RefractionModel ref=NULL, const Weather &weather=Weather::standard()) const
 Returns the short-term horizontal trajectory of this source on the observer's sky, which can be used for extrapolating its apparent position in the near-term to avoid the repeated full-fledged position calculation, which may be expensive.
Angle moon_angle (const Frame &frame) const
 Returns the angular separation of this source from the Moon, for the given observer location and time of observation.
std::string name () const
 Returns the name given to this source at instantiation.
Time rises_above (const Angle &el, const Frame &frame, RefractionModel ref=NULL, const Weather &weather=Weather::standard()) const
 Returns the time when the source rises above the specified elevation next for an observer located on or near Earth's surface, or else std::nullopt if the observer is not near Earth's surface.
Time sets_below (const Angle &el, const Frame &frame, RefractionModel ref=NULL, const Weather &weather=Weather::standard()) const
 Returns the time when the source sets below the specified elevation next for an observer located on or near Earth's surface, or else std::nullopt if the observer is not near Earth's surface.
Angle sun_angle (const Frame &frame) const
 Returns the angular separation of this source from the Sun, for the given observer location and time of observation.
Time transits_in (const Frame &frame) const
 Returns the time when the source transits for an observer located on or near Earth's surface, or else std::nullopt if the observer is not near Earth's surface.
enum novas_object_type type () const
 Returns the type of this source.
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().

Additional Inherited Members

Static Public Member Functions inherited from supernovas::Source
static void set_case_sensitive (bool value)
 Enables or disabled case-sensitive treatment of source names.
Protected Member Functions inherited from supernovas::SolarSystemSource
 SolarSystemSource ()
Protected Member Functions inherited from supernovas::Source
 Source ()
 stored data on source
Protected Member Functions inherited from supernovas::Validating
 Validating ()
 dummy constructor;
Protected Attributes inherited from supernovas::Source
struct novas_object _object = {}
Protected Attributes inherited from supernovas::Validating
bool _valid = false
 the state variable.

Detailed Description

A Solar-system source, whose positions / velocities are provided from ephemeris data.

SuperNOVAS does not support ephemeris data by itself, but can interface to other libraries (e.g. CALCEPH or CSPICE), or provide them via user-selected function(s). Depending on the external implementation that provides ephemeris data, sources may be looked up by name or ID number. Name-based lookup may be case-sensitive (in which case you may want to use novas_case_sensitive() to enable case-sensitive source names in SuperNOVAS). ID-based lookup may use NAIF IDs, or else some other numbering convention. In any case, you should construct your ephemeris source to match the lookup method used by the ephemeris provider function(s) or library you will be using.

See also
Planet, OrbitalSource, novas_use_calceph(), novas_use_cspice(), novas_case_sensitive()

Constructor & Destructor Documentation

◆ EphemerisSource()

supernovas::EphemerisSource::EphemerisSource ( const std::string & name,
long number = -1 )
explicit

Instantiates a new Solar-system body whose positions are provided by ephemeris lookup.

Parameters
namesource name as defined in the ephemeris data (for name-based lookup).
number(optional) source ID number in the ephemeris data (for id-based lookup; default: -1).

References supernovas::SolarSystemSource::SolarSystemSource(), supernovas::Source::_object, supernovas::Validating::_valid, make_ephem_object(), supernovas::Source::name(), NOVAS_EPHEM_OBJECT, and number().

Referenced by copy().

Member Function Documentation

◆ copy()

const Source * supernovas::EphemerisSource::copy ( ) const
overridevirtual

Returns a pointer to a newly allocated copy of this Solar-system ephemeris source instance.

Returns
pointer to new copy of this Solar-system ephemeris source instance.

Implements supernovas::Source.

References EphemerisSource().

◆ number()

long supernovas::EphemerisSource::number ( ) const

Returns the number designation of this ephemeris.

Returns
the source ID number (for number ID based lookup).
See also
name()

References supernovas::Source::_object.

Referenced by EphemerisSource(), and to_string().

◆ to_string()

std::string supernovas::EphemerisSource::to_string ( ) const
overridevirtual

Returns a simple string representation of this ephemeris source, with the name and number designations.

Returns
a string containing the name and number designations for this source.

Implements supernovas::Source.

References supernovas::Source::name(), and number().