#[non_exhaustive]#[repr(u8)]pub enum Scale {
Show 17 variants
TAI = 0,
TT = 1,
ET = 2,
TDB = 3,
UTC = 4,
UT1 = 5,
UTCSpice = 6,
UTCSofa = 7,
GPS = 8,
GST = 9,
BDT = 10,
QZSS = 11,
TCG = 12,
TCB = 13,
LTC = 14,
TCL = 15,
Custom = 16,
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
TAI = 0
TAI is the representation of an Epoch internally.
TT = 1
Terrestrial Time (TT) (previously called Terrestrial Dynamical Time (TDT)).
ET = 2
Ephemeris Time as defined by NASA/NAIF SPICE (identical to TDB).
TDB = 3
Barycentric Dynamical Time (TDB) — SPICE ephemeris time (ET is an alias for this).
UTC = 4
Universal Coordinated Time using modern IERS leap second rules.
UT1 = 5
UT1
UTCSpice = 6
Universal Coordinated Time using the SPICE historical model (fixed +9 s offset against TAI for all dates before 1972-01-01).
UTCSofa = 7
Universal Coordinated Time using the full SOFA historical model (varying fractional “rubber second” offsets from 1960–1971).
GPS = 8
GPS Time scale whose reference epoch is UTC midnight between 05 January and 06 January 1980.
GST = 9
Galileo Time scale.
BDT = 10
BeiDou Time scale.
QZSS = 11
QZSS Time scale has the same properties as GPS but with dedicated clocks.
TCG = 12
Geocentric Coordinate Time (TCG) – relativistic coordinate time in the Geocentric Celestial Reference System (GCRS).
TCB = 13
Barycentric Coordinate Time (TCB) – relativistic coordinate time in the Barycentric Celestial Reference System (BCRS).
LTC = 14
Coordinated Lunar Time (LTC) – NASA’s official lunar coordinate time scale (analogous to TCG). Defined from the NIST/Ashby & Patla (2024) relativistic framework adopted for Artemis and cislunar operations.
Lunar clocks on the selenoid run faster than terrestrial clocks by a
constant secular rate of +56.02 µs per Earth day (L_M = 6.48378 × 10^{-10}).
A small additional periodic variation exists due to lunar orbital eccentricity
(±0.108 µs/day in instantaneous rate, ~±0.75 µs accumulated over one orbit).
The periodic term is not part of the defining LTC conversion; it is
handled via ClockModel / Drift when utmost precision is required.
TCL = 15
Custom = 16
Custom / user-defined type – for experimental or mission-specific timescales.
Most powerful when paired with ClockModel (self-describing polynomial).
Implementations§
Source§impl Scale
impl Scale
pub const fn to_ut(&self) -> Self
Sourcepub const fn uses_leap_seconds(&self) -> bool
pub const fn uses_leap_seconds(&self) -> bool
Returns true if this scale accounts for leap seconds
(or historical UTC civil time rules).
Sourcepub const fn is_gnss(&self) -> bool
pub const fn is_gnss(&self) -> bool
Returns true if this scale is based off a GNSS constellation.
Sourcepub fn from_abbrev(s: &str) -> Option<Self>
pub fn from_abbrev(s: &str) -> Option<Self>
Parse scale from abbreviation.
Returns None for any non-ASCII input.
Sourcepub const fn abbrev(&self) -> &'static str
pub const fn abbrev(&self) -> &'static str
Short abbreviation used for formatting / display (e.g. “TAI”, “UTC”, “UTCSpice”).
Sourcepub const fn from_u8(v: u8) -> Self
pub const fn from_u8(v: u8) -> Self
Attempts to reconstruct a Scale from its wire byte representation.
Returns None for any value that does not correspond to a known variant.
This provides safe deserialization from untrusted sources.
Sourcepub const fn to_wire_byte(self) -> u8
pub const fn to_wire_byte(self) -> u8
Returns the wire representation of this Scale as a single byte.
The returned byte is the repr(u8) discriminant of the enum.
This is the canonical on-wire form used by [Dt] and [ClockModel].