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

Namespaces

namespace  constants
 
namespace  detail
 
namespace  format
 
namespace  scale
 

Classes

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

◆ J2000Seconds

Definition at line 14 of file time.hpp.

◆ JulianDate

Definition at line 12 of file time.hpp.

◆ ModifiedJulianDate

Definition at line 13 of file time.hpp.

◆ TTMjdPeriod

◆ UnixTime

◆ UTCPeriod

Definition at line 132 of file period.hpp.

Enumeration Type Documentation

◆ TimeDataSource

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
constexpr tempoch_scale_tag_t scale_tag_v

Definition at line 81 of file eop.hpp.

References check_status(), and tempoch::EopValues::mjd_utc.

◆ 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(), and scale_tag_v.

◆ 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

Definition at line 163 of file period.hpp.

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

◆ normalize_periods()

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

Definition at line 185 of file period.hpp.

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

◆ 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 scale_tag_v.

◆ operator<<() [3/4]

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

Definition at line 194 of file period.hpp.

References scale_tag_v.

◆ 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 scale_tag_v.

◆ Period()

template<typename T >
tempoch::Period ( ,
 
) -> 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(), scale_tag_v, and tempoch::GnssWeek::week.

◆ 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

Definition at line 174 of file period.hpp.

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

◆ validate_periods()

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

Definition at line 157 of file period.hpp.

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

Variable Documentation

◆ format_tag_v

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

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

◆ is_format_v

template<typename T >
constexpr 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 >
constexpr 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 >
constexpr 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 >
constexpr tempoch_scale_tag_t tempoch::scale_tag_v = ScaleTraits<S>::ffi_tag
inlineconstexpr

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

Referenced by tempoch::detail::add_seconds(), tempoch::Period< T >::complement_of(), tempoch::Period< T >::contains(), tempoch::detail::decode_time(), tempoch::detail::difference_seconds(), tempoch::Period< T >::duration(), tempoch::detail::encode_time(), tempoch::detail::ensure_finite_encoded(), tempoch::detail::from_alloc(), tempoch::Period< T >::from_c(), tempoch::Time< S >::from_civil(), tempoch::Time< S >::from_civil(), tempoch::Time< S >::from_encoded(), tempoch::Time< S >::from_encoded_with(), from_gnss_week(), tempoch::EncodedTime< S, F >::from_jd(), tempoch::EncodedTime< S, F >::from_mjd(), tempoch::TimeTraits< Time< S > >::from_mjd_value(), tempoch::TimeTraits< EncodedTime< S, F > >::from_mjd_value(), tempoch::TimeTraits< CivilTime >::from_mjd_value(), tempoch::Time< S >::from_raw_j2000_seconds(), tempoch::Time< S >::from_split_seconds(), tempoch::EncodedTime< S, F >::from_utc(), tempoch::EncodedTime< S, F >::from_utc(), intersect_periods(), tempoch::Period< T >::intersection(), tempoch::EncodedTime< S, F >::J2000(), tempoch::Period< T >::length(), tempoch::detail::make_builtin_eop_context(), tempoch::detail::make_default_context(), tempoch::detail::make_pre_definition_context(), tempoch::detail::make_time(), tempoch::EncodedTime< S, F >::max(), tempoch::EncodedTime< S, F >::mean(), tempoch::EncodedTime< S, F >::min(), normalize_periods(), tempoch::EncodedTime< S, F >::operator!=(), tempoch::Time< S >::operator!=(), tempoch::detail::ContextDeleter::operator()(), tempoch::Time< S >::operator+(), tempoch::EncodedTime< S, F >::operator+(), tempoch::Time< S >::operator+=(), tempoch::EncodedTime< S, F >::operator+=(), tempoch::EncodedTime< S, F >::operator-(), tempoch::Time< S >::operator-(), tempoch::EncodedTime< S, F >::operator-(), tempoch::Time< S >::operator-(), tempoch::Time< S >::operator-=(), tempoch::EncodedTime< S, F >::operator-=(), tempoch::EncodedTime< S, F >::operator<(), tempoch::Time< S >::operator<(), operator<<(), operator<<(), operator<<(), tempoch::EncodedTime< S, F >::operator<=(), tempoch::Time< S >::operator<=(), tempoch::EncodedTime< S, F >::operator==(), tempoch::Time< S >::operator==(), tempoch::EncodedTime< S, F >::operator>(), tempoch::Time< S >::operator>(), tempoch::EncodedTime< S, F >::operator>=(), tempoch::Time< S >::operator>=(), tempoch::Period< T >::Period(), tempoch::detail::scale_convert(), tempoch::detail::time_from_civil(), tempoch::detail::time_to_civil(), tempoch::Time< S >::to(), tempoch::EncodedTime< S, F >::to(), tempoch::Time< S >::to_civil(), to_gnss_week(), tempoch::EncodedTime< S, F >::to_jd(), tempoch::EncodedTime< S, F >::to_mjd(), tempoch::TimeTraits< CivilTime >::to_mjd_value(), tempoch::TimeTraits< EncodedTime< S, F > >::to_mjd_value(), tempoch::TimeTraits< Time< S > >::to_mjd_value(), tempoch::detail::to_raw(), tempoch::EncodedTime< S, F >::to_utc(), tempoch::EncodedTime< S, F >::to_utc(), tempoch::Time< S >::to_with(), tempoch::EncodedTime< S, F >::to_with(), tempoch::Time< S >::try_to(), tempoch::EncodedTime< S, F >::try_to(), union_periods(), tempoch::Period< T >::union_with(), and validate_periods().