![]() |
SuperNOVAS C++ API v1.6
High-precision C/C++ astrometry library
|
Precise astronomical time specification, supporting all relevant astronomical timescales (UT1, UTC, TAI, GPS, TT, TDB, TCG, and TCB). More...
#include <supernovas.h>
Public Member Functions | |
| Time (const novas_timespec *t) | |
| Instantiates an astrometric time instance with the specified SuperNOVAS C astrometric time specification data structure. | |
| Time (const std::string ×tamp, const EOP &eop, enum novas_timescale timescale=NOVAS_UTC) | |
| Instantiates an astrometric time instance with the specified time parameters. | |
| Time (const std::string ×tamp, int leap_seconds, double dUT1, enum novas_timescale timescale=NOVAS_UTC) | |
| Instantiates an astrometric time instance with the specified time parameters. | |
| Time (const struct timespec *t, const EOP &eop) | |
| Instantiates an astrometric time instance with the specified time parameters. | |
| Time (const struct timespec *t, int leap_seconds, double dUT1) | |
| Instantiates an astrometric time instance with the specified time parameters. | |
| Time (double jd, const EOP &eop, enum novas_timescale timescale=NOVAS_TT) | |
| Instantiates an astrometric time instance with the specified time parameters. | |
| Time (double jd, int leap_seconds, double dUT1, enum novas_timescale timescale=NOVAS_TT) | |
| Instantiates an astrometric time instance with the specified time parameters. | |
| Time (long ijd, double fjd, const EOP &eop, enum novas_timescale timescale=NOVAS_TT) | |
| Instantiates an astrometric time instance with the specified time parameters. | |
| Time (long ijd, double fjd, int leap_seconds, double dUT1, enum novas_timescale timescale=NOVAS_TT) | |
| Instantiates an astrometric time instance with the specified time parameters. | |
| const novas_timespec * | _novas_timespec () const |
| Returns the underlying C astrometric time specification data structure. | |
| int | day_of_week (enum novas_timescale timescale=NOVAS_UTC) const |
| Returns the day of week index (1..7) for this time instance. | |
| Interval | dUT1 () const |
| Returns the UT1 - UTC time difference for this time instance, as was provided during instantiation. | |
| double | epoch () const |
| Returns the Julian coordinate epoch year of this time instance. | |
| bool | equals (const Time &time, const Interval &precision) const |
| Checks if this time instance is the same as another time within the specified precision. | |
| bool | equals (const Time &time, double seconds=Unit::us) const |
| Checks if this time instance is the same as another time within the specified precision. | |
| TimeAngle | era () const |
| Returns the Earth Rotation Angle (ERA), which measures the angle between the Terrestrial Intermediate Origin (TIO) and the Celestial Intermediate Origin (CIO) in the IAU 2000 convention. | |
| TimeAngle | gmst () const |
| Returns the Greenwich Mean Sidereal Time (GMST) for this time instance. | |
| TimeAngle | gst (enum novas_accuracy accuracy=NOVAS_FULL_ACCURACY) const |
| Returns the Greenwich (Apparent) Sidereal Time (GST / GaST) for this time instance. | |
| double | jd (enum novas_timescale timescale=NOVAS_TT) const |
| Returns the precise Julian Date of this time instance, in the specific timescale of choice. | |
| long | jd_day (enum novas_timescale timescale=NOVAS_TT) const |
| Returns the integer Julian day of this time instance, in the specific timescale of choice. | |
| double | jd_frac (enum novas_timescale timescale=NOVAS_TT) const |
| Returns the factional Julian Day (MJD) of this time instance, in the specific timescale of choice. | |
| int | leap_seconds () const |
| Returns the leap seconds for this time instance, as was provided during instantiation. | |
| TimeAngle | lst (const Site &site, enum novas_accuracy accuracy=NOVAS_FULL_ACCURACY) const |
| Returns the Local (Apparent) Sidereal Time for this time instance. | |
| double | mjd (enum novas_timescale timescale=NOVAS_TT) const |
| Returns the precise Modified Julian Date (MJD) this time instance, in the specific timescale of choice. | |
| long | mjd_day (enum novas_timescale timescale=NOVAS_TT) const |
| Returns the integer Modified Julian Day (MJD) of this time instance, in the specific timescale of choice. | |
| double | mjd_frac (enum novas_timescale timescale=NOVAS_TT) const |
| Returns the integer Modified Julian Day (MJD) of this time instance, in the specific timescale of choice. | |
| Angle | moon_phase () const |
| Returns the phase of the Moon at this time instance. | |
| Time | next_moon_phase (const Angle &phase) const |
| Returns the next time, after this time instance, when the Moon will be in the specified phase. | |
| Interval | offset_from (const Time &time, enum novas_timescale timescale=NOVAS_TT) const |
| Returns the difference of this time from the specified other time, in the specified timescale. | |
| bool | operator!= (const Time &time) const |
| Checks if this time instance differs from another time by more than 1 μs. | |
| Time | operator+ (const Interval &delta) const |
| Returns an offset time in the backward direction. | |
| Time | operator+ (double seconds) const |
| Returns an offset time. | |
| Interval | operator- (const CalendarDate &other) const |
| Time | operator- (const Interval &delta) const |
| Returns an offset time. | |
| Interval | operator- (const Time &other) const |
| Returns the difference of this time from the specified other time, in regular Earth-based time measures (GPS, TAI, TT – and also UTC assuming no change in leap seconds). | |
| Time | operator- (double seconds) const |
| Returns an offset time in the backwards direction. | |
| bool | operator< (const Time &other) const |
| Checks if this time is prior to the specified other time, at the full precision of the representation. | |
| bool | operator<= (const Time &other) const |
| Checks if this time is the same as or before the specified other time, at 1 μs resolution. | |
| bool | operator== (const Time &time) const |
| Checks if this time instance is the same as another time within 1 μs. | |
| bool | operator> (const Time &other) const |
| Checks if this time is after to the specified other time, at the full precision of the representation. | |
| bool | operator>= (const Time &other) const |
| Checks if this time is the same as or after the specified other time, at 1 μs resolution. | |
| Time | shifted (const Interval &offset, enum novas_timescale timescale=NOVAS_TT) const |
| Returns an offset time. | |
| Time | shifted (double seconds, enum novas_timescale timescale=NOVAS_TT) const |
| Returns an offset time. | |
| TimeAngle | time_of_day (enum novas_timescale timescale=NOVAS_TT) const |
| Returns the time of (calendar) day of this time instance in the timescale of choice. | |
| CalendarDate | to_calendar_date (const Calendar &calendar=Calendar::astronomical(), enum novas_timescale timescale=NOVAS_UTC) const |
| Returns a calendar date, in the calendar of choice, and in the timescale of choice, for time instance. | |
| CalendarDate | to_calendar_date (enum novas_timescale timescale) const |
| Returns the astronomical calendar date instance for this astrometric time. | |
| std::string | to_epoch_string (int decimals=2) const |
| Returns the string representation of the Julian coordinate epoch corresponding to this timestamp. | |
| std::string | to_iso_string () const |
| Returns an ISO 8601 timestamp for this time instance. | |
| std::string | to_string (enum novas_timescale timescale=NOVAS_UTC) const |
| Returns a string representation (a timestamp) of this time instance. | |
| time_t | unix_time (long *nanos=NULL) const |
| Returns the precise UNIX time (UTC) corresponding to this time instance. | |
| 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 Time & | b1900 () |
| Returns the astrometric time for the B1900 epoch. | |
| static const Time & | b1950 () |
| Returns the astrometric time for the B1950 epoch. | |
| static Time | from_mjd (double mjd, const EOP &eop, enum novas_timescale timescale=NOVAS_TT) |
| Returns a new astrometric time instance for a given Modified Julian Date (MJD), specified in the timescale of choice. | |
| static Time | from_mjd (double mjd, int leap_seconds, double dUT1, enum novas_timescale timescale=NOVAS_TT) |
| Returns a new astrometric time instance for a given Modified Julian Date (MJD), specified in the timescale of choice. | |
| static const Time & | hip () |
| Returns the astrometric time for the Hipparcos catalog epoch (which is J1991.25). | |
| static const Time & | j2000 () |
| Returns the astrometric time for the J2000 epoch. | |
| static Time | now (const EOP &eop) |
| Resturns a new astrometric time instance for the current time. | |
| static const Time & | undefined () |
| Returns a reference to a statically defined standard invalid astrometric time. | |
Additional Inherited Members | |
| Protected Member Functions inherited from supernovas::Validating | |
| Validating () | |
| dummy constructor; | |
| Protected Attributes inherited from supernovas::Validating | |
| bool | _valid = false |
| the state variable. | |
Precise astronomical time specification, supporting all relevant astronomical timescales (UT1, UTC, TAI, GPS, TT, TDB, TCG, and TCB).
| supernovas::Time::Time | ( | double | jd, |
| int | leap_seconds, | ||
| double | dUT1, | ||
| enum novas_timescale | timescale = NOVAS_TT ) |
Instantiates an astrometric time instance with the specified time parameters.
| jd | [day] Julian date (in the selected timescale) |
| leap_seconds | [s] leap seconds, that is TAI - UTC (default: 0) |
| dUT1 | [s] UT1 - UTC time difference, e.g. from the IERS Bulletins or service (default: 0.0). |
| timescale | (optional) Astronomical timescale (default: TT). |
References supernovas::Validating::_valid, dUT1(), jd(), leap_seconds(), and novas_set_time().
| supernovas::Time::Time | ( | double | jd, |
| const EOP & | eop, | ||
| enum novas_timescale | timescale = NOVAS_TT ) |
Instantiates an astrometric time instance with the specified time parameters.
| jd | [day] Julian date (in the selected timescale) |
| eop | Earth Orientation Parameters (EOP) values, e.g. obtained from IERS. |
| timescale | (optional) Astronomical timescale (default: TT). |
References dUT1(), jd(), and leap_seconds().
| supernovas::Time::Time | ( | long | ijd, |
| double | fjd, | ||
| int | leap_seconds, | ||
| double | dUT1, | ||
| enum novas_timescale | timescale = NOVAS_TT ) |
Instantiates an astrometric time instance with the specified time parameters.
| ijd | [day] integer part of Julian date (in the selected timescale) |
| fjd | [day] fractional part of Julian date (in the selected timescale) |
| leap_seconds | [s] leap seconds, that is TAI - UTC (default: 0) |
| dUT1 | [s] UT1 - UTC time difference, e.g. from the IERS Bulletins or service (default: 0.0). |
| timescale | (optional) Astronomical timescale (default: TT). |
References supernovas::Validating::_valid, dUT1(), leap_seconds(), and novas_set_split_time().
| supernovas::Time::Time | ( | long | ijd, |
| double | fjd, | ||
| const EOP & | eop, | ||
| enum novas_timescale | timescale = NOVAS_TT ) |
Instantiates an astrometric time instance with the specified time parameters.
| ijd | [day] integer part of Julian date (in the selected timescale) |
| fjd | [day] fractional part of Julian date (in the selected timescale) |
| eop | Earth Orientation Parameters (EOP) values, e.g. obtained from IERS. |
| timescale | (optional) Astronomical timescale (default: TT). |
References dUT1(), and leap_seconds().
| supernovas::Time::Time | ( | const std::string & | timestamp, |
| int | leap_seconds, | ||
| double | dUT1, | ||
| enum novas_timescale | timescale = NOVAS_UTC ) |
Instantiates an astrometric time instance with the specified time parameters.
| timestamp | A precision timestamp, such as an ISO 8601 timestamp. |
| leap_seconds | [s] leap seconds, that is TAI - UTC (default: 0) |
| dUT1 | [s] UT1 - UTC time difference, e.g. from the IERS Bulletins or service (default: 0.0). |
| timescale | (optional) Astronomical timescale (default: TT). |
References supernovas::Validating::_valid, dUT1(), leap_seconds(), and novas_set_str_time().
| supernovas::Time::Time | ( | const std::string & | timestamp, |
| const EOP & | eop, | ||
| enum novas_timescale | timescale = NOVAS_UTC ) |
Instantiates an astrometric time instance with the specified time parameters.
| timestamp | A precision timestamp, such as an ISO 8601 timestamp. |
| eop | Earth Orientation Parameters (EOP) values, e.g. obtained from IERS. |
| timescale | (optional) Astronomical timescale (default: TT). |
References dUT1(), and leap_seconds().
| supernovas::Time::Time | ( | const struct timespec * | t, |
| int | leap_seconds, | ||
| double | dUT1 ) |
Instantiates an astrometric time instance with the specified time parameters.
| t | A precision POSIX standard UTC timestamp. |
| leap_seconds | [s] leap seconds, that is TAI - UTC (default: 0) |
| dUT1 | [s] UT1 - UTC time difference, e.g. from the IERS Bulletins or service (default: 0.0). |
References supernovas::Validating::_valid, dUT1(), leap_seconds(), novas_set_unix_time(), and NOVAS_UTC.
| supernovas::Time::Time | ( | const struct timespec * | t, |
| const EOP & | eop ) |
Instantiates an astrometric time instance with the specified time parameters.
| t | A precision POSIX standard UTC timestamp. |
| eop | Earth Orientation Parameters (EOP) values, e.g. obtained from IERS. |
References dUT1(), and leap_seconds().
|
explicit |
Instantiates an astrometric time instance with the specified SuperNOVAS C astrometric time specification data structure.
| t | pointer to the SuperNOVAS C astrometric time specification data structure. |
References supernovas::Validating::_valid, novas_timespec::fjd_tt, novas_timespec::tt2tdb, and novas_timespec::ut1_to_tt.
| const novas_timespec * supernovas::Time::_novas_timespec | ( | ) | const |
Returns the underlying C astrometric time specification data structure.
|
static |
Returns the astrometric time for the B1900 epoch.
References NOVAS_JD_B1900, and NOVAS_TT.
|
static |
Returns the astrometric time for the B1950 epoch.
References NOVAS_JD_B1950, and NOVAS_TT.
| int supernovas::Time::day_of_week | ( | enum novas_timescale | timescale = NOVAS_UTC | ) | const |
Returns the day of week index (1..7) for this time instance.
| timescale | (optional) the timescale in which to return the result (default: UTC). |
References jd(), and novas_day_of_week().
| Interval supernovas::Time::dUT1 | ( | ) | const |
Returns the UT1 - UTC time difference for this time instance, as was provided during instantiation.
References supernovas::Validating::is_valid().
Referenced by Time(), Time(), Time(), Time(), Time(), Time(), Time(), Time(), from_mjd(), next_moon_phase(), operator-(), and shifted().
| double supernovas::Time::epoch | ( | ) | const |
Returns the Julian coordinate epoch year of this time instance.
References jd(), NOVAS_JD_J2000, and NOVAS_JULIAN_YEAR_DAYS.
Referenced by to_epoch_string().
| bool supernovas::Time::equals | ( | const Time & | time, |
| const Interval & | precision ) const |
Checks if this time instance is the same as another time within the specified precision.
| Time of observation and astronomical timescales | the other time |
| precision | (optional) The precision for the comparison (default: 1 μs). |
References equals(), and supernovas::Interval::seconds().
| bool supernovas::Time::equals | ( | const Time & | time, |
| double | precision = Unit::us ) const |
Checks if this time instance is the same as another time within the specified precision.
| Time of observation and astronomical timescales | the other time |
| precision | [s] (optional) The precision for the comparison (default: 1 &mus) |
References novas_diff_time().
Referenced by equals(), operator!=(), and operator==().
| TimeAngle supernovas::Time::era | ( | ) | const |
Returns the Earth Rotation Angle (ERA), which measures the angle between the Terrestrial Intermediate Origin (TIO) and the Celestial Intermediate Origin (CIO) in the IAU 2000 convention.
References supernovas::Unit::deg, and supernovas::Validating::is_valid().
|
static |
Returns a new astrometric time instance for a given Modified Julian Date (MJD), specified in the timescale of choice.
| mjd | [day] Modified Julian Date, in the timescale of choice |
| eop | Earth Orientation Parameters (EOP) values, e.g. obtained from IERS. |
| timescale | (optional) timescale in which MJD was specified (default: TT) |
References supernovas::EOP::dUT1(), from_mjd(), supernovas::EOP::leap_seconds(), mjd(), and supernovas::Interval::seconds().
|
static |
Returns a new astrometric time instance for a given Modified Julian Date (MJD), specified in the timescale of choice.
| mjd | [day] Modified Julian Date, in the timescale of choice |
| leap_seconds | [s] leap seconds, that is TAI - UTC (default: 0) |
| dUT1 | [s] UT1 - UTC time difference, e.g. from the IERS Bulletins or service (default: 0.0). |
| timescale | (optional) timescale in which MJD was specified (default: TT) |
References dUT1(), supernovas::Validating::is_valid(), leap_seconds(), mjd(), and NOVAS_JD_MJD0.
Referenced by from_mjd().
| TimeAngle supernovas::Time::gmst | ( | ) | const |
Returns the Greenwich Mean Sidereal Time (GMST) for this time instance.
References supernovas::Unit::hour_angle, supernovas::Validating::is_valid(), novas_get_time(), novas_gmst(), and NOVAS_UT1.
| TimeAngle supernovas::Time::gst | ( | enum novas_accuracy | accuracy = NOVAS_FULL_ACCURACY | ) | const |
Returns the Greenwich (Apparent) Sidereal Time (GST / GaST) for this time instance.
| accuracy | NOVAS_FULL_ACCURACY (0) for μs-level precision or NOVAS_REDUCED_ACCURACY (1) for &ms-level precison. |
References supernovas::Unit::hour_angle, supernovas::Validating::is_valid(), and novas_time_gst().
|
static |
Returns the astrometric time for the Hipparcos catalog epoch (which is J1991.25).
References NOVAS_JD_HIP, and NOVAS_TT.
|
static |
Returns the astrometric time for the J2000 epoch.
References NOVAS_JD_J2000, and NOVAS_TT.
Referenced by supernovas::Ecliptic::to_mod().
| double supernovas::Time::jd | ( | enum novas_timescale | timescale = NOVAS_TT | ) | const |
Returns the precise Julian Date of this time instance, in the specific timescale of choice.
| timescale | (optional) the timescale in which to return the result (default: TT). |
References novas_get_time().
Referenced by Time(), Time(), supernovas::Equinox::cirs(), day_of_week(), epoch(), supernovas::Orbital::from_mean_motion(), supernovas::SolarSystemSource::helio_distance(), supernovas::SolarSystemSource::helio_rate(), supernovas::Equinox::mod(), supernovas::Orbital::moon_mean_orbit_at(), supernovas::Orbital::moon_orbit_at(), moon_phase(), next_moon_phase(), supernovas::OrbitalSystem::orbit(), supernovas::Planet::orbit(), supernovas::Orbital::position(), supernovas::SolarSystemSource::solar_power(), to_calendar_date(), supernovas::Ecliptic::to_mod(), supernovas::Horizontal::to_refracted(), supernovas::Ecliptic::to_tod(), supernovas::Horizontal::to_unrefracted(), supernovas::Equinox::tod(), and supernovas::Orbital::velocity().
| long supernovas::Time::jd_day | ( | enum novas_timescale | timescale = NOVAS_TT | ) | const |
Returns the integer Julian day of this time instance, in the specific timescale of choice.
| timescale | (optional) the timescale in which to return the result (default: TT). |
References novas_get_split_time(), and NOVAS_TIMESCALES.
| double supernovas::Time::jd_frac | ( | enum novas_timescale | timescale = NOVAS_TT | ) | const |
Returns the factional Julian Day (MJD) of this time instance, in the specific timescale of choice.
0h in Julian dates is at noon.
| timescale | (optional) the timescale in which to return the result (default: TT). |
References novas_get_split_time(), and NOVAS_TIMESCALES.
Referenced by mjd_frac().
| int supernovas::Time::leap_seconds | ( | ) | const |
Returns the leap seconds for this time instance, as was provided during instantiation.
References novas_time_leap().
Referenced by Time(), Time(), Time(), Time(), Time(), Time(), Time(), Time(), from_mjd(), next_moon_phase(), operator-(), and shifted().
| TimeAngle supernovas::Time::lst | ( | const Site & | site, |
| enum novas_accuracy | accuracy = NOVAS_FULL_ACCURACY ) const |
Returns the Local (Apparent) Sidereal Time for this time instance.
| site | observing site |
| accuracy | (optional) NOVAS_FULL_ACCURACY (0; default) for μs-level precision or NOVAS_REDUCED_ACCURACY (1) for &ms-level precison. |
References supernovas::Angle::deg(), supernovas::Unit::hour_angle, supernovas::Validating::is_valid(), supernovas::Site::longitude(), and novas_time_lst().
| double supernovas::Time::mjd | ( | enum novas_timescale | timescale = NOVAS_TT | ) | const |
Returns the precise Modified Julian Date (MJD) this time instance, in the specific timescale of choice.
| timescale | (optional) the timescale in which to return the result (default: TT). |
References novas_get_split_time(), NOVAS_JD_MJD0, and NOVAS_TIMESCALES.
Referenced by from_mjd(), from_mjd(), and operator-().
| long supernovas::Time::mjd_day | ( | enum novas_timescale | timescale = NOVAS_TT | ) | const |
Returns the integer Modified Julian Day (MJD) of this time instance, in the specific timescale of choice.
| timescale | (optional) the timescale in which to return the result (default: TT). |
References novas_get_split_time(), and NOVAS_TIMESCALES.
| double supernovas::Time::mjd_frac | ( | enum novas_timescale | timescale = NOVAS_TT | ) | const |
Returns the integer Modified Julian Day (MJD) of this time instance, in the specific timescale of choice.
0h in MJD is at midnight.
| timescale | (optional) the timescale in which to return the result (default: TT). |
References jd_frac(), and NOVAS_TIMESCALES.
Referenced by time_of_day().
| Angle supernovas::Time::moon_phase | ( | ) | const |
Returns the phase of the Moon at this time instance.
References supernovas::Unit::deg, supernovas::Validating::is_valid(), jd(), novas_moon_phase(), and NOVAS_TDB.
| Time supernovas::Time::next_moon_phase | ( | const Angle & | phase | ) | const |
Returns the next time, after this time instance, when the Moon will be in the specified phase.
| phase | The Moon's phase. 0°: New Moon, 90°: 1st quarter, +/- 180° Full Moon, -90°: 3rd quarter. |
References supernovas::Angle::deg(), dUT1(), supernovas::Validating::is_valid(), jd(), leap_seconds(), novas_next_moon_phase(), and NOVAS_TDB.
|
static |
Resturns a new astrometric time instance for the current time.
It is only as accurate as the system clock, and its precision may be limited by the resolution of the system clock also. Be sure that your computer is well synchronized to a trustworthy time server, preferably on a local network, such as an ntp server with a GPS receiver.
| eop | Earth Orientation Parameters (EOP) values, e.g. obtained from IERS. |
References supernovas::EOP::dUT1(), supernovas::Validating::is_valid(), supernovas::EOP::leap_seconds(), novas_set_current_time(), and supernovas::Interval::seconds().
| Interval supernovas::Time::offset_from | ( | const Time & | time, |
| enum novas_timescale | timescale = NOVAS_TT ) const |
Returns the difference of this time from the specified other time, in the specified timescale.
All timescales are supported.
| Time of observation and astronomical timescales | the other time |
| timescale | (optional) the timescale in which to return the result (default: TT). |
References supernovas::Validating::is_valid(), and novas_diff_time_scale().
Referenced by operator-().
| bool supernovas::Time::operator!= | ( | const Time & | time | ) | const |
Checks if this time instance differs from another time by more than 1 μs.
| Time of observation and astronomical timescales | the other time |
References equals().
| Time supernovas::Time::operator+ | ( | const Interval & | offset | ) | const |
Returns an offset time in the backward direction.
It assumes that the leap seconds and UT1 - UTC time difference of this time instance is also valid for the offset time, which should be true typically for reasonably small time offsets.
| offset | the offset interval (in backwards direction). |
References supernovas::Interval::seconds().
| Time supernovas::Time::operator+ | ( | double | seconds | ) | const |
Returns an offset time.
It assumes that the leap seconds and UT1 - UTC time difference of this time instance is also valid for the offset time, which should be true typically for reasonably small time offsets.
| seconds | [s] the offset interval |
References shifted().
| Interval supernovas::Time::operator- | ( | const CalendarDate & | other | ) | const |
References supernovas::Calendar::astronomical(), dUT1(), leap_seconds(), mjd(), NOVAS_FULL_ACCURACY, NOVAS_TT, NOVAS_UTC, and supernovas::Unit::us.
| Time supernovas::Time::operator- | ( | const Interval & | offset | ) | const |
Returns an offset time.
It assumes that the leap seconds and UT1 - UTC time difference of this time instance is also valid for the offset time, which should be true typically for reasonably small time offsets.
| offset | the offset interval |
References supernovas::Interval::seconds().
| Interval supernovas::Time::operator- | ( | const Time & | r | ) | const |
Returns the difference of this time from the specified other time, in regular Earth-based time measures (GPS, TAI, TT – and also UTC assuming no change in leap seconds).
| r | the other time |
References supernovas::Validating::is_valid(), and offset_from().
| Time supernovas::Time::operator- | ( | double | seconds | ) | const |
Returns an offset time in the backwards direction.
It assumes that the leap seconds and UT1 - UTC time difference of this time instance is also valid for the offset time, which should be true typically for reasonably small time offsets.
| seconds | [s] the offset interval (backwards direction). |
References shifted().
| bool supernovas::Time::operator< | ( | const Time & | r | ) | const |
Checks if this time is prior to the specified other time, at the full precision of the representation.
| r | the other time |
References novas_diff_time().
| bool supernovas::Time::operator<= | ( | const Time & | r | ) | const |
Checks if this time is the same as or before the specified other time, at 1 μs resolution.
| r | the other time |
References novas_diff_time(), and supernovas::Unit::us.
| bool supernovas::Time::operator== | ( | const Time & | time | ) | const |
Checks if this time instance is the same as another time within 1 μs.
| Time of observation and astronomical timescales | the other time |
References equals().
| bool supernovas::Time::operator> | ( | const Time & | r | ) | const |
Checks if this time is after to the specified other time, at the full precision of the representation.
| r | the other time |
| bool supernovas::Time::operator>= | ( | const Time & | r | ) | const |
Checks if this time is the same as or after the specified other time, at 1 μs resolution.
| r | the other time |
| Time supernovas::Time::shifted | ( | const Interval & | offset, |
| enum novas_timescale | timescale = NOVAS_TT ) const |
Returns an offset time.
It assumes that the leap seconds and UT1 - UTC time difference of this time instance is also valid for the offset time, which should be true typically for reasonably small time offsets.
| offset | the offset interval in a regular Earth-based timescale (GPS, TAI, TT – or UTC assuming no change in leap seconds). |
| timescale | (optional) timescale in which offset time is given (default: TT / TAI / GPS). |
References supernovas::Interval::seconds(), and shifted().
| Time supernovas::Time::shifted | ( | double | seconds, |
| enum novas_timescale | timescale = NOVAS_TT ) const |
Returns an offset time.
It assumes that the leap seconds and UT1 - UTC time difference of this time instance is also valid for the offset time, which should be true typically for reasonably small time offsets.
| seconds | [s] the offset interval in a regular Earth-based timescale (GPS, TAI, TT – or UTC assuming no change in leap seconds). |
| timescale | (optional) timescale in which offset time is given (default: TT / TAI / GPS). |
References supernovas::Unit::day, dUT1(), supernovas::Validating::is_valid(), leap_seconds(), novas_get_split_time(), novas_set_split_time(), and undefined().
Referenced by operator+(), operator-(), and shifted().
| TimeAngle supernovas::Time::time_of_day | ( | enum novas_timescale | timescale = NOVAS_TT | ) | const |
Returns the time of (calendar) day of this time instance in the timescale of choice.
| timescale | (optional) the timescale in which to return the result (default: TT). |
References supernovas::Validating::is_valid(), mjd_frac(), and TWOPI.
| CalendarDate supernovas::Time::to_calendar_date | ( | const Calendar & | calendar = Calendar::astronomical(), |
| enum novas_timescale | timescale = NOVAS_UTC ) const |
Returns a calendar date, in the calendar of choice, and in the timescale of choice, for time instance.
| calendar | (optional) Calendar in which to represent this time instance (default: astronomical) |
| timescale | (optional) timescale in which MJD was specified (default: TT) |
References supernovas::Calendar::date(), supernovas::Validating::is_valid(), and jd().
Referenced by to_calendar_date().
| CalendarDate supernovas::Time::to_calendar_date | ( | enum novas_timescale | timescale | ) | const |
Returns the astronomical calendar date instance for this astrometric time.
The astronomical calendar is the conventional calendar of date, which is the Gregorian calendar after the Gregorian calendar reform if 1582, and the Roman calendar prior to that.
| timescale | timescale in which MJD was specified (default: TT) |
References supernovas::Calendar::astronomical(), and to_calendar_date().
| std::string supernovas::Time::to_epoch_string | ( | int | decimals = 2 | ) | const |
Returns the string representation of the Julian coordinate epoch corresponding to this timestamp.
| decimals | (optional) number of decimal places to show on the year (default: 2). |
References epoch(), and supernovas::Validating::is_valid().
| std::string supernovas::Time::to_iso_string | ( | ) | const |
Returns an ISO 8601 timestamp for this time instance.
References supernovas::Validating::is_valid(), and novas_iso_timestamp().
| std::string supernovas::Time::to_string | ( | enum novas_timescale | timescale = NOVAS_UTC | ) | const |
Returns a string representation (a timestamp) of this time instance.
| timescale | (optional) the timescale in which to represent time (default: UTC). |
References supernovas::Validating::is_valid(), and novas_timestamp().
|
static |
Returns a reference to a statically defined standard invalid astrometric time.
This invalid time may be used inside any object that is invalid itself.
Referenced by shifted().
| time_t supernovas::Time::unix_time | ( | long * | nanos = NULL | ) | const |
Returns the precise UNIX time (UTC) corresponding to this time instance.
| [out] | nanos | [ns] (optional) pointer to value in which to return the sub-second component, or NULL if not required. |
References novas_get_unix_time().