Skip to main content

satellite_datetime/
constants.rs

1//! IAU and CCSDS constants.
2
3use crate::duration::Duration;
4
5/// Nanoseconds in one SI second.
6pub const NS_PER_SEC: i128 = 1_000_000_000;
7/// Nanoseconds in a 86400-second nominal day.
8pub const NS_PER_DAY: i128 = 86_400 * NS_PER_SEC;
9
10/// Julian Date of 1958-01-01 00:00:00 (TAI epoch, CCSDS).
11pub const TAI_EPOCH_JD: f64 = 2_436_204.5;
12/// Modified Julian Date of the TAI epoch.
13pub const TAI_EPOCH_MJD: i64 = 36_204;
14/// Unix day number of the TAI epoch (days since 1970-01-01).
15pub const TAI_EPOCH_UNIX_DAYS: i64 = -4_383;
16
17/// 1977-01-01 00:00:00 TAI = JD 2443144.5. IAU origin of TT/TCG/TCB relations.
18pub const IAU_1977_JD: f64 = 2_443_144.5;
19/// TAI nanoseconds from 1958-01-01 to 1977-01-01 00:00:00 TAI.
20/// 19 y including leap days 1960,1964,1968,1972,1976 = 19*365+5 = 6940 days.
21pub const TAI_1977_NS: i128 = 6_940 * NS_PER_DAY;
22
23/// J2000.0 TT = 2000-01-01 12:00:00 TT = JD 2451545.0.
24pub const J2000_JD: f64 = 2_451_545.0;
25
26/// IAU 2000 L_G: TCG − TT rate.
27pub const L_G: f64 = 6.969_290_134e-10;
28/// IAU 2006 L_B: TCB − TDB rate.
29pub const L_B: f64 = 1.550_519_768e-8;
30/// IAU TDB offset constant (seconds).
31pub const TDB0: f64 = -6.55e-5;
32/// JD_TDB of the TCB/TDB origin (2443144.5003725).
33pub const TDB_EPOCH_JD: f64 = 2_443_144.500_372_5;
34
35/// GPS − TAI = −19 s.
36pub const GPS_MINUS_TAI: Duration = Duration::from_seconds(-19);
37/// BDT − TAI = −33 s.
38pub const BDT_MINUS_TAI: Duration = Duration::from_seconds(-33);
39
40/// Mean lunar surface proper time minus TT (Ashby & Patla 2024 class result).
41/// Clocks on the Moon run faster than TT by about 56.02 µs per terrestrial day.
42pub const LUNAR_SURFACE_MINUS_TT_PER_DAY: Duration = Duration::from_nanos(56_020);
43
44/// IAU 2024: at the defining event, TCL = TCB = 1977-01-01 00:00:32.184.
45/// That TCB reading is TT at the 1977 TAI midnight plus 32.184 s = TAI 1977 + 32.184 s.
46pub const LTC_DEFINITION_STATUS: &str =
47    "provisional-2026: LTC is realized as TCL pending CGPM/BIPM operational offset";