|
Vulcan
Aerospace Engineering Utilities Built on Janus
|
Classes | |
| class | Epoch |
| struct | LeapSecondEntry |
| Leap second entry: date and cumulative offset. More... | |
Typedefs | |
| using | NumericEpoch = Epoch<double> |
| Numeric epoch (double-precision). | |
| using | SymbolicEpoch = Epoch<janus::SymbolicScalar> |
| Symbolic epoch (CasADi MX). | |
Enumerations | |
| enum class | GpsDayOfWeek { Sunday = 0 , Monday = 1 , Tuesday = 2 , Wednesday = 3 , Thursday = 4 , Friday = 5 , Saturday = 6 } |
| GPS day of week enumeration. More... | |
| enum class | TimeScale { UTC , TAI , TT , TDB , GPS , UT1 } |
Functions | |
| constexpr int | full_gps_week (int week_mod, int rollover_count=GPS_CURRENT_ROLLOVER) |
| Calculate full GPS week number from a potentially rolled-over week. | |
| template<typename Scalar> | |
| Scalar | gps_week_to_utc_jd (int week, const Scalar &seconds_of_week, int delta_at=37) |
| Convert GPS week/seconds to UTC Julian Date. | |
| template<typename Scalar> | |
| Scalar | gps_week_to_tai_jd (int week, const Scalar &seconds_of_week) |
| Convert GPS week/seconds to TAI Julian Date. | |
| std::pair< int, double > | utc_jd_to_gps_week (double utc_jd, int delta_at) |
| Convert UTC Julian Date to GPS week and seconds. | |
| std::pair< int, double > | utc_jd_to_gps_week_auto (double utc_jd) |
| Convert UTC Julian Date to GPS week and seconds (auto leap second lookup). | |
| int | gps_utc_offset (double utc_jd) |
| Get GPS - UTC offset for a given UTC Julian Date. | |
| constexpr int | gps_utc_offset (int delta_at) |
| Get GPS - UTC offset (templated with explicit delta_at). | |
| GpsDayOfWeek | gps_day_of_week (double seconds_of_week) |
| Get GPS day of week from seconds into the week. | |
| double | gps_time_of_day (double seconds_of_week) |
| Get time of day from GPS seconds of week. | |
| double | calendar_to_jd (int year, int month, int day, int hour=0, int min=0, double sec=0.0) |
| Convert calendar date/time to Julian Date. | |
| std::tuple< int, int, int, int, int, double > | jd_to_calendar (double jd) |
| Convert Julian Date to calendar date/time (numeric only). | |
| template<typename Scalar> | |
| constexpr Scalar | jd_to_mjd (const Scalar &jd) |
| Convert Julian Date to Modified Julian Date. | |
| template<typename Scalar> | |
| constexpr Scalar | mjd_to_jd (const Scalar &mjd) |
| Convert Modified Julian Date to Julian Date. | |
| template<typename Scalar> | |
| constexpr Scalar | jd_to_j2000_seconds (const Scalar &jd) |
| Convert Julian Date to seconds since J2000.0. | |
| template<typename Scalar> | |
| constexpr Scalar | j2000_seconds_to_jd (const Scalar &sec) |
| Convert seconds since J2000.0 to Julian Date. | |
| template<typename Scalar> | |
| constexpr Scalar | jd_to_j2000_centuries (const Scalar &jd) |
| Convert Julian Date to Julian centuries since J2000.0. | |
| template<typename Scalar> | |
| constexpr Scalar | j2000_centuries_to_jd (const Scalar &T) |
| Convert Julian centuries since J2000.0 to Julian Date. | |
| constexpr bool | is_leap_year (int year) |
| int | day_of_year (int year, int month, int day) |
| std::tuple< int, int > | doy_to_month_day (int year, int doy) |
| int | leap_seconds_at_tai (double tai_jd) |
| Get TAI - UTC offset (leap seconds) for a given TAI Julian Date. | |
| int | leap_seconds_at_utc (double utc_jd) |
| Get TAI - UTC offset for a given UTC Julian Date. | |
| bool | is_leap_second (int year, int month, int day, int hour, int min, double sec) |
| Check if a given UTC date/time is during a leap second. | |
| double | next_leap_second (double utc_jd) |
| Get the date of the next leap second after a given date. | |
| const janus::Interpolator & | leap_second_interpolator () |
| Get a symbolic-compatible leap second interpolator. | |
| template<typename Scalar> | |
| Scalar | leap_seconds_symbolic (const Scalar &utc_jd) |
| Symbolic leap second lookup (smooth approximation). | |
| template<typename Scalar> | |
| constexpr Scalar | tai_to_tt (const Scalar &tai_jd) |
| Convert TAI Julian Date to TT Julian Date. | |
| template<typename Scalar> | |
| constexpr Scalar | tt_to_tai (const Scalar &tt_jd) |
| Convert TT Julian Date to TAI Julian Date. | |
| template<typename Scalar> | |
| constexpr Scalar | tai_to_gps (const Scalar &tai_jd) |
| Convert TAI Julian Date to GPS Julian Date. | |
| template<typename Scalar> | |
| constexpr Scalar | gps_to_tai (const Scalar &gps_jd) |
| Convert GPS Julian Date to TAI Julian Date. | |
| template<typename Scalar> | |
| constexpr Scalar | utc_to_tai (const Scalar &utc_jd, int delta_at) |
| Convert UTC Julian Date to TAI Julian Date (templated). | |
| template<typename Scalar> | |
| constexpr Scalar | tai_to_utc (const Scalar &tai_jd, int delta_at) |
| Convert TAI Julian Date to UTC Julian Date (templated). | |
| double | utc_to_tai (double utc_jd) |
| Convert UTC Julian Date to TAI Julian Date (numeric, auto lookup). | |
| double | tai_to_utc (double tai_jd) |
| Convert TAI Julian Date to UTC Julian Date (numeric, auto lookup). | |
| template<typename Scalar> | |
| constexpr Scalar | utc_to_gps (const Scalar &utc_jd, int delta_at) |
| Convert UTC Julian Date to GPS Julian Date (templated). | |
| template<typename Scalar> | |
| constexpr Scalar | gps_to_utc (const Scalar &gps_jd, int delta_at) |
| Convert GPS Julian Date to UTC Julian Date (templated). | |
| double | utc_to_gps (double utc_jd) |
| Convert UTC Julian Date to GPS Julian Date (numeric, auto lookup). | |
| double | gps_to_utc (double gps_jd) |
| Convert GPS Julian Date to UTC Julian Date (numeric, auto lookup). | |
| template<typename Scalar> | |
| Scalar | tt_to_tdb (const Scalar &tt_jd) |
| Convert TT Julian Date to TDB Julian Date. | |
| template<typename Scalar> | |
| Scalar | tdb_to_tt (const Scalar &tdb_jd) |
| Convert TDB Julian Date to TT Julian Date. | |
| template<typename Scalar> | |
| Scalar | utc_to_tai_symbolic (const Scalar &utc_jd) |
| Convert UTC Julian Date to TAI Julian Date (fully symbolic). | |
| template<typename Scalar> | |
| Scalar | tai_to_utc_symbolic (const Scalar &tai_jd) |
| Convert TAI Julian Date to UTC Julian Date (fully symbolic). | |
Variables | |
| constexpr int | GPS_WEEK_ROLLOVER = 1024 |
| GPS week number rollover constant. | |
| constexpr int | GPS_CURRENT_ROLLOVER = 2 |
| Current GPS week rollover count (post-April 2019). | |
| constexpr std::array< LeapSecondEntry, 28 > | LEAP_SECOND_TABLE |
| Complete leap second table from 1972 to present. | |
| using vulcan::time::NumericEpoch = Epoch<double> |
Numeric epoch (double-precision).
| using vulcan::time::SymbolicEpoch = Epoch<janus::SymbolicScalar> |
Symbolic epoch (CasADi MX).
|
strong |
|
strong |
|
inlinenodiscard |
Convert calendar date/time to Julian Date.
Uses the algorithm from Vallado's "Fundamentals of Astrodynamics and Applications" Valid for dates from 4713 BCE to far future.
|
inlinenodiscard |
|
inlinenodiscard |
|
inlinenodiscardconstexpr |
Calculate full GPS week number from a potentially rolled-over week.
GPS receivers may report week numbers modulo 1024. This function recovers the full week number based on expected rollover.
| week_mod | Week number modulo 1024 (from receiver) |
| rollover_count | Which rollover epoch (0, 1, 2, ...) |
|
inlinenodiscard |
Get GPS day of week from seconds into the week.
|
inlinenodiscard |
Get time of day from GPS seconds of week.
| seconds_of_week | Seconds into GPS week |
|
nodiscardconstexpr |
Convert GPS Julian Date to TAI Julian Date.
|
nodiscardconstexpr |
Convert GPS Julian Date to UTC Julian Date (templated).
|
inlinenodiscard |
Convert GPS Julian Date to UTC Julian Date (numeric, auto lookup).
|
inlinenodiscard |
Get GPS - UTC offset for a given UTC Julian Date.
GPS tracks TAI with a fixed 19-second offset, while UTC has leap seconds. GPS - UTC = (TAI - UTC) - 19 = delta_at - 19
| utc_jd | Julian Date in UTC scale |
|
inlinenodiscardconstexpr |
Get GPS - UTC offset (templated with explicit delta_at).
|
nodiscard |
Convert GPS week/seconds to TAI Julian Date.
|
nodiscard |
Convert GPS week/seconds to UTC Julian Date.
| week | Full GPS week number |
| seconds_of_week | Seconds into the week (0 to 604799.999...) |
| delta_at | TAI - UTC offset (default: 37 for post-2017) |
|
inlinenodiscard |
Check if a given UTC date/time is during a leap second.
Leap seconds occur at 23:59:60 UTC on June 30 or December 31.
| year | Year |
| month | Month (1-12) |
| day | Day of month |
| hour | Hour (0-23) |
| min | Minute (0-59) |
| sec | Second (0-60) |
|
inlinenodiscardconstexpr |
|
nodiscardconstexpr |
Convert Julian centuries since J2000.0 to Julian Date.
|
nodiscardconstexpr |
Convert seconds since J2000.0 to Julian Date.
|
inlinenodiscard |
Convert Julian Date to calendar date/time (numeric only).
|
nodiscardconstexpr |
Convert Julian Date to Julian centuries since J2000.0.
|
nodiscardconstexpr |
Convert Julian Date to seconds since J2000.0.
| Scalar | Numeric or symbolic type |
|
nodiscardconstexpr |
Convert Julian Date to Modified Julian Date.
| Scalar | Numeric or symbolic type |
|
inlinenodiscard |
Get a symbolic-compatible leap second interpolator.
Returns a cached Interpolator that maps UTC JD to TAI-UTC offset. Uses linear interpolation for smooth (differentiable) approximation.
|
inlinenodiscard |
Get TAI - UTC offset (leap seconds) for a given TAI Julian Date.
| tai_jd | Julian Date in TAI scale |
|
inlinenodiscard |
Get TAI - UTC offset for a given UTC Julian Date.
| utc_jd | Julian Date in UTC scale |
|
nodiscard |
Symbolic leap second lookup (smooth approximation).
Uses janus::Interpolator for symbolic-compatible table lookup. Linear interpolation provides smooth transitions at leap second boundaries.
| Scalar | Numeric or symbolic type |
| utc_jd | Julian Date in UTC scale |
|
nodiscardconstexpr |
Convert Modified Julian Date to Julian Date.
|
inlinenodiscard |
Get the date of the next leap second after a given date.
| utc_jd | Julian Date in UTC scale |
|
nodiscardconstexpr |
Convert TAI Julian Date to GPS Julian Date.
GPS = TAI - 19 seconds (exact, GPS was synchronized with TAI at epoch)
|
nodiscardconstexpr |
Convert TAI Julian Date to TT Julian Date.
TT = TAI + 32.184 seconds (exact, by definition)
| Scalar | Numeric or symbolic type |
|
nodiscardconstexpr |
Convert TAI Julian Date to UTC Julian Date (templated).
| Scalar | Numeric or symbolic type |
| tai_jd | Julian Date in TAI scale |
| delta_at | TAI - UTC offset in seconds |
|
inlinenodiscard |
Convert TAI Julian Date to UTC Julian Date (numeric, auto lookup).
|
nodiscard |
Convert TAI Julian Date to UTC Julian Date (fully symbolic).
Uses janus::Interpolator for smooth leap second lookup. Note: For TAI→UTC, we approximate by using the TAI JD directly in the interpolator (small error during leap second transitions).
|
nodiscard |
Convert TDB Julian Date to TT Julian Date.
Inverse of tt_to_tdb. Since the correction is small (~1.7 ms max), a single iteration is sufficient.
|
nodiscardconstexpr |
Convert TT Julian Date to TAI Julian Date.
|
nodiscard |
Convert TT Julian Date to TDB Julian Date.
TDB = TT + periodic terms due to Earth's orbital eccentricity. Uses the simplified formula from Fairhead & Bretagnon (1990): TDB - TT ≈ 0.001657 * sin(g) + 0.000022 * sin(L - D)
where g is the mean anomaly of Earth's orbit. Accuracy: ~2 ms (sufficient for most applications)
| Scalar | Numeric or symbolic type |
|
inlinenodiscard |
Convert UTC Julian Date to GPS week and seconds.
| utc_jd | Julian Date in UTC scale |
| delta_at | TAI - UTC offset |
|
inlinenodiscard |
Convert UTC Julian Date to GPS week and seconds (auto leap second lookup).
|
nodiscardconstexpr |
Convert UTC Julian Date to GPS Julian Date (templated).
GPS = TAI - 19s, so GPS = UTC + (delta_at - 19)
|
inlinenodiscard |
Convert UTC Julian Date to GPS Julian Date (numeric, auto lookup).
|
nodiscardconstexpr |
Convert UTC Julian Date to TAI Julian Date (templated).
| Scalar | Numeric or symbolic type |
| utc_jd | Julian Date in UTC scale |
| delta_at | TAI - UTC offset in seconds (from leap second table) |
|
inlinenodiscard |
Convert UTC Julian Date to TAI Julian Date (numeric, auto lookup).
Automatically looks up leap seconds from the table.
|
nodiscard |
Convert UTC Julian Date to TAI Julian Date (fully symbolic).
Uses janus::Interpolator for smooth leap second lookup. Suitable for optimization problems spanning leap second boundaries.
| Scalar | Numeric or symbolic type |
| utc_jd | Julian Date in UTC scale |
|
inlineconstexpr |
Current GPS week rollover count (post-April 2019).
|
inlineconstexpr |
GPS week number rollover constant.
GPS week numbers roll over every 1024 weeks (~19.7 years). First rollover: August 22, 1999 Second rollover: April 6, 2019
|
inlineconstexpr |
Complete leap second table from 1972 to present.
Source: IERS Bulletin C (https://hpiers.obspm.fr/iers/bul/bulc/bulletinc.dat) Last updated: Bulletin C 69 (July 2024) - no leap second through June 2025