tempoch-cpp 0.5.5
Header-only C++ wrapper for tempoch
Loading...
Searching...
No Matches
tempoch Namespace Reference

Namespaces

namespace  constants
namespace  format
namespace  detail
namespace  scale

Classes

struct  CivilTime
 UTC date-time breakdown. More...
struct  DataHorizons
struct  TimeDataStatus
struct  EopValues
 Interpolated IERS Earth Orientation Parameter values. More...
class  TempochException
 Base exception for all tempoch errors. More...
class  NullPointerError
 A required output pointer was null. More...
class  UtcConversionError
 UTC conversion failed (date out of range or invalid). More...
class  InvalidPeriodError
 The period is invalid (start > end). More...
class  NoIntersectionError
 The two periods do not intersect. More...
class  InvalidScaleIdError
 The supplied raw scale identifier is invalid. More...
class  InvalidDurationUnitError
 The supplied quantity does not represent a time duration. More...
class  ConversionFailedError
 A generic scale/format conversion failed. More...
class  InvalidFormatIdError
 The supplied raw format identifier is invalid. More...
class  InternalPanicError
 Rust caught a panic before unwinding across the FFI boundary. More...
class  Ut1HorizonExceededError
 A UT1 conversion requested data beyond the compiled ΔT/EOP horizon. More...
class  PeriodListUnsortedError
 The period list is not sorted by start time. More...
class  PeriodListOverlappingError
 The period list contains overlapping intervals. More...
struct  is_format
struct  FormatTraits
struct  is_format< format::GPS >
struct  FormatTraits< format::GPS >
struct  is_format< format::J2000s >
struct  FormatTraits< format::J2000s >
struct  is_format< format::JD >
struct  FormatTraits< format::JD >
struct  is_format< format::MJD >
struct  FormatTraits< format::MJD >
struct  is_format< format::Unix >
struct  FormatTraits< format::Unix >
struct  is_gnss_scale
 Trait marking the GNSS coordinate scales that support week decomposition. More...
struct  is_gnss_scale< scale::GPST >
struct  is_gnss_scale< scale::GST >
struct  is_gnss_scale< scale::BDT >
struct  is_gnss_scale< scale::QZSST >
struct  GnssWeek
struct  TimeTraits< Time< S > >
struct  TimeTraits< EncodedTime< S, F > >
struct  TimeTraits< CivilTime >
class  Period
struct  is_scale
struct  ScaleTraits
struct  is_scale< scale::BDT >
struct  ScaleTraits< scale::BDT >
struct  is_scale< scale::ET >
struct  ScaleTraits< scale::ET >
struct  is_scale< scale::GPST >
struct  ScaleTraits< scale::GPST >
struct  is_scale< scale::GST >
struct  ScaleTraits< scale::GST >
struct  is_scale< scale::QZSST >
struct  ScaleTraits< scale::QZSST >
struct  is_scale< scale::TAI >
struct  ScaleTraits< scale::TAI >
struct  is_scale< scale::TCB >
struct  ScaleTraits< scale::TCB >
struct  is_scale< scale::TCG >
struct  ScaleTraits< scale::TCG >
struct  is_scale< scale::TDB >
struct  ScaleTraits< scale::TDB >
struct  is_scale< scale::TT >
struct  ScaleTraits< scale::TT >
struct  is_scale< scale::UT1 >
struct  ScaleTraits< scale::UT1 >
struct  is_scale< scale::UTC >
struct  ScaleTraits< scale::UTC >
class  Time
 A point in time on scale S, stored as a split J2000-second pair. More...
class  EncodedTime
 A typed external encoding of a time instant on scale S. More...
struct  TimeTraits
class  TimeContext
 Immutable conversion context for UT1 and historical UTC routes. More...

Typedefs

using TTMjdPeriod = Period<ModifiedJulianDate<scale::TT>>
using UTCPeriod = Period<CivilTime>
template<typename S>
using JulianDate = EncodedTime<S, format::JD>
template<typename S>
using ModifiedJulianDate = EncodedTime<S, format::MJD>
template<typename S>
using J2000Seconds = EncodedTime<S, format::J2000s>
using UnixTime = EncodedTime<scale::UTC, format::Unix>
using GpsTime = EncodedTime<scale::TAI, format::GPS>

Enumerations

enum class  TimeDataSource : int { Bundled = 0 , RuntimeCache = 1 , Override = 2 }

Functions

std::ostream & operator<< (std::ostream &os, const CivilTime &u)
 Stream CivilTime as YYYY-MM-DD HH:MM:SS[.nnnnnnnnn].
double delta_t_seconds (double jd_ut1) noexcept
double delta_t_seconds_extrapolated (double jd_ut1) noexcept
TimeDataStatus time_data_status ()
bool eop_covers (double mjd_utc) noexcept
 Check whether EOP data is available for mjd_utc.
std::optional< EopValues > eop_at (double mjd_utc)
 Interpolate IERS EOP values at mjd_utc.
void check_status (tempoch_status_t status, const char *operation)
 Check a tempoch_status_t and throw the appropriate exception on error.
template<typename S, std::enable_if_t< is_gnss_scale_v< S >, int > = 0>
GnssWeek to_gnss_week (const Time< S > &time)
 Decompose a GNSS-scale instant into its week-number form.
template<typename S, std::enable_if_t< is_gnss_scale_v< S >, int > = 0>
Time< S > from_gnss_week (const GnssWeek &gw)
 Build a GNSS-scale instant from a week-number decomposition.
template<typename T>
 Period (T, T) -> Period< T >
template<typename T>
void validate_periods (const std::vector< Period< T > > &periods)
template<typename T>
std::vector< Period< T > > intersect_periods (const std::vector< Period< T > > &a, const std::vector< Period< T > > &b)
template<typename T>
std::vector< Period< T > > union_periods (const std::vector< Period< T > > &a, const std::vector< Period< T > > &b)
template<typename T>
std::vector< Period< T > > normalize_periods (const std::vector< Period< T > > &periods)
template<typename T>
std::ostream & operator<< (std::ostream &os, const Period< T > &period)
template<typename S>
std::ostream & operator<< (std::ostream &os, const Time< S > &time)
template<typename S, typename F>
std::ostream & operator<< (std::ostream &os, const EncodedTime< S, F > &time)

Variables

template<typename T>
constexpr bool is_format_v = is_format<T>::value
template<typename F>
constexpr tempoch_format_tag_t format_tag_v = FormatTraits<F>::ffi_tag
template<typename S>
constexpr bool is_gnss_scale_v = is_gnss_scale<S>::value
template<typename T>
constexpr bool is_scale_v = is_scale<T>::value
template<typename S>
constexpr tempoch_scale_tag_t scale_tag_v = ScaleTraits<S>::ffi_tag

Typedef Documentation

◆ GpsTime

Definition at line 17 of file time.hpp.

◆ J2000Seconds

template<typename S>
using tempoch::J2000Seconds = EncodedTime<S, format::J2000s>

Definition at line 14 of file time.hpp.

◆ JulianDate

template<typename S>
using tempoch::JulianDate = EncodedTime<S, format::JD>

Definition at line 12 of file time.hpp.

◆ ModifiedJulianDate

template<typename S>
using tempoch::ModifiedJulianDate = EncodedTime<S, format::MJD>

Definition at line 13 of file time.hpp.

◆ TTMjdPeriod

Definition at line 198 of file period.hpp.

◆ UnixTime

Definition at line 16 of file time.hpp.

◆ UTCPeriod

Definition at line 199 of file period.hpp.

Enumeration Type Documentation

◆ TimeDataSource

enum class tempoch::TimeDataSource : int
strong

Origin of the currently active time-data bundle.

Mirrors tempoch::ActiveTimeDataSource.

Enumerator
Bundled 

Compiled archive snapshot bundled at build time.

RuntimeCache 

Bundle loaded through the runtime fetch/cache path.

Override 

Test or caller-provided override is active.

Definition at line 23 of file data_status.hpp.

Function Documentation

◆ check_status()

◆ delta_t_seconds()

double tempoch::delta_t_seconds ( double jd_ut1)
inlinenoexcept

ΔT = TT − UT1 in seconds for a UT1 Julian Day, using the compiled USNO model. Returns NaN when the requested epoch is outside the model domain.

Definition at line 87 of file constants.hpp.

◆ delta_t_seconds_extrapolated()

double tempoch::delta_t_seconds_extrapolated ( double jd_ut1)
inlinenoexcept

ΔT = TT − UT1 in seconds for a UT1 Julian Day, extrapolating beyond the tabulated range with the long-term parabola (always finite).

Definition at line 91 of file constants.hpp.

◆ eop_at()

std::optional< EopValues > tempoch::eop_at ( double mjd_utc)
inline

Interpolate IERS EOP values at mjd_utc.

Parameters
mjd_utcUTC Modified Julian Date of the desired epoch.
Returns
std::optional<EopValues> containing the result, or std::nullopt when the epoch is outside the compiled data range.
if (auto eop = tempoch::eop_at(51544.5)) {
std::cout << "DUT1 = " << eop->ut1_minus_utc << " s\n";
}
std::optional< EopValues > eop_at(double mjd_utc)
Interpolate IERS EOP values at mjd_utc.
Definition eop.hpp:81

Definition at line 81 of file eop.hpp.

References check_status().

◆ eop_covers()

bool tempoch::eop_covers ( double mjd_utc)
inlinenoexcept

Check whether EOP data is available for mjd_utc.

Parameters
mjd_utcUTC Modified Julian Date to query.
Returns
true if eop_at(mjd_utc) would succeed.

Definition at line 66 of file eop.hpp.

◆ from_gnss_week()

template<typename S, std::enable_if_t< is_gnss_scale_v< S >, int > = 0>
Time< S > tempoch::from_gnss_week ( const GnssWeek & gw)
inline

Build a GNSS-scale instant from a week-number decomposition.

Definition at line 56 of file gnss_week.hpp.

References check_status(), tempoch::Time< S >::from_split_seconds(), scale_tag_v, tempoch::GnssWeek::seconds_of_week, tempoch::GnssWeek::subsecond_nanos, and tempoch::GnssWeek::week.

◆ intersect_periods()

template<typename T>
std::vector< Period< T > > tempoch::intersect_periods ( const std::vector< Period< T > > & a,
const std::vector< Period< T > > & b )
inline

◆ normalize_periods()

template<typename T>
std::vector< Period< T > > tempoch::normalize_periods ( const std::vector< Period< T > > & periods)
inline

◆ operator<<() [1/4]

std::ostream & tempoch::operator<< ( std::ostream & os,
const CivilTime & u )
inline

◆ operator<<() [2/4]

template<typename S, typename F>
std::ostream & tempoch::operator<< ( std::ostream & os,
const EncodedTime< S, F > & time )
inline

Definition at line 506 of file time_base.hpp.

References tempoch::EncodedTime< S, F >::raw().

◆ operator<<() [3/4]

template<typename T>
std::ostream & tempoch::operator<< ( std::ostream & os,
const Period< T > & period )
inline

Definition at line 261 of file period.hpp.

References tempoch::Period< T >::end(), and tempoch::Period< T >::start().

◆ operator<<() [4/4]

template<typename S>
std::ostream & tempoch::operator<< ( std::ostream & os,
const Time< S > & time )
inline

Definition at line 305 of file time_base.hpp.

References tempoch::Time< S >::total_seconds().

◆ Period()

template<typename T>
tempoch::Period ( T ,
T  )->Period< T >

◆ time_data_status()

◆ to_gnss_week()

template<typename S, std::enable_if_t< is_gnss_scale_v< S >, int > = 0>
GnssWeek tempoch::to_gnss_week ( const Time< S > & time)
inline

Decompose a GNSS-scale instant into its week-number form.

Definition at line 46 of file gnss_week.hpp.

References tempoch::Time< S >::c_inner(), check_status(), and scale_tag_v.

◆ union_periods()

template<typename T>
std::vector< Period< T > > tempoch::union_periods ( const std::vector< Period< T > > & a,
const std::vector< Period< T > > & b )
inline

◆ validate_periods()

template<typename T>
void tempoch::validate_periods ( const std::vector< Period< T > > & periods)
inline

Definition at line 224 of file period.hpp.

References check_status(), and tempoch::detail::to_raw().

Variable Documentation

◆ format_tag_v

template<typename F>
tempoch_format_tag_t tempoch::format_tag_v = FormatTraits<F>::ffi_tag
inlineconstexpr

Definition at line 13 of file formats/base.hpp.

Referenced by tempoch::detail::decode_time(), and tempoch::detail::encode_time().

◆ is_format_v

template<typename T>
bool tempoch::is_format_v = is_format<T>::value
inlineconstexpr

Definition at line 10 of file formats/base.hpp.

◆ is_gnss_scale_v

template<typename S>
bool tempoch::is_gnss_scale_v = is_gnss_scale<S>::value
inlineconstexpr

Definition at line 28 of file gnss_week.hpp.

◆ is_scale_v

template<typename T>
bool tempoch::is_scale_v = is_scale<T>::value
inlineconstexpr

Definition at line 9 of file scales/base.hpp.

◆ scale_tag_v

template<typename S>
tempoch_scale_tag_t tempoch::scale_tag_v = ScaleTraits<S>::ffi_tag
inlineconstexpr