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

An abstract astronomical source, or target of observation. More...

#include <supernovas.h>

Inheritance diagram for supernovas::Source:

Public Member Functions

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.
virtual const Sourcecopy () const =0
 Returns a pointer to a newly allocated copy of this instance.
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.
virtual std::string to_string () const =0
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().

Static Public Member Functions

static void set_case_sensitive (bool value)
 Enables or disabled case-sensitive treatment of source names.

Protected Member Functions

 Source ()
 stored data on source
Protected Member Functions inherited from supernovas::Validating
 Validating ()
 dummy constructor;

Protected Attributes

struct novas_object _object = {}
Protected Attributes inherited from supernovas::Validating
bool _valid = false
 the state variable.

Detailed Description

An abstract astronomical source, or target of observation.

See also
CatalogSource, Planet, EphemerisSource, OrbitalSource

Constructor & Destructor Documentation

◆ Source()

supernovas::Source::Source ( )
inlineprotected

◆ ~Source()

virtual supernovas::Source::~Source ( )
inlinevirtual

Member Function Documentation

◆ _novas_object()

const struct novas_object * supernovas::Source::_novas_object ( ) const

Returns a pointer to the NOVAS C novas_object data structure that stores data internally.

Returns
a pointer to the underlying NOVAS C novas_object data structure.

References _object.

Referenced by equatorial_track(), and horizontal_track().

◆ copy()

virtual const Source * supernovas::Source::copy ( ) const
pure virtual

Returns a pointer to a newly allocated copy of this instance.

Returns
pointer to a newly allocated copy.

Implemented in supernovas::CatalogSource, supernovas::EphemerisSource, supernovas::OrbitalSource, and supernovas::Planet.

References Source(), supernovas::Unit::hour, NOVAS_TOD, and supernovas::Weather::standard().

◆ name()

std::string supernovas::Source::name ( ) const

Returns the name given to this source at instantiation.

It may be lower-case unless the set_case_sensitive(true) was called before instantiating the source.

Returns
the given source name.
See also
set_case_sensitive()

References _object.

Referenced by supernovas::EphemerisSource::EphemerisSource(), supernovas::OrbitalSource::OrbitalSource(), supernovas::Planet::for_name(), supernovas::EphemerisSource::to_string(), supernovas::OrbitalSource::to_string(), supernovas::OrbitalSystem::to_string(), and supernovas::Planet::to_string().

◆ set_case_sensitive()

void supernovas::Source::set_case_sensitive ( bool value)
static

Enables or disabled case-sensitive treatment of source names.

It only affect sources that are instantiated after the change has been made.

Parameters
valuetrue to enable case sensitive processing of name for newly defined sources or else false to convert all future source names to lower-case for case-insensitive processing.

References novas_case_sensitive().

◆ to_string()

virtual std::string supernovas::Source::to_string ( ) const
pure virtual

◆ type()

enum novas_object_type supernovas::Source::type ( ) const

Returns the type of this source.

Returns
the source type constant

References _object.

Member Data Documentation

◆ _object