Skip to main content

Module conversions

Module conversions 

Source
Expand description

Time scale conversions between astronomical time systems.

This module provides traits and implementations for converting between the eight major astronomical time scales: GPS, TAI, TT, TCG, TCB, TDB, UT1, and UTC.

§Time Scale Overview

ScaleFull NameBasisPrimary Use
UTCCoordinated Universal TimeAtomic + leap secondsCivil timekeeping
TAIInternational Atomic TimeAtomic clocksReference for other scales
TTTerrestrial TimeTAI + 32.184sGeocentric ephemerides
UT1Universal Time 1Earth rotationSidereal time, telescope pointing
GPSGPS TimeAtomic (no leap seconds)Satellite navigation
TCGGeocentric Coordinate TimeRelativistic (Earth center)Precise geocentric dynamics
TCBBarycentric Coordinate TimeRelativistic (solar system)Solar system dynamics
TDBBarycentric Dynamical TimeTCB rescaledSolar system ephemerides

§Fixed vs Variable Offsets

Some conversions use constant offsets:

  • TAI <-> TT: Fixed 32.184 seconds
  • TAI <-> GPS: Fixed 19.0 seconds
  • TT <-> TCG: Secular rate 6.969290134e-10 (IAU 2000)
  • TCG <-> TCB: Secular rate 1.550519768e-8 (IAU 2006)

Others require external data that changes over time:

  • UTC <-> TAI: Leap second table (currently 37 seconds as of 2017)
  • UT1 <-> TAI: IERS Earth Orientation Parameters (changes daily)
  • UT1 <-> TT: Delta-T from historical tables or predictions
  • TT <-> TDB: Location-dependent, ~1.66ms annual oscillation

§Trait Pattern

Each target scale has a conversion trait:

  • ToTAI: Convert to International Atomic Time
  • ToTT: Convert to Terrestrial Time
  • ToGPS: Convert to GPS Time
  • ToUTC: Convert to Coordinated Universal Time
  • ToUT1: Convert to Universal Time 1
  • ToTCG: Convert to Geocentric Coordinate Time

Additional traits handle conversions requiring parameters:

§Usage

Simple fixed-offset conversions work directly:

use celestial_time::scales::{TAI, TT, GPS};
use celestial_time::scales::conversions::{ToTAI, ToTT};
use celestial_time::julian::JulianDate;

let tai = TAI::from_julian_date(JulianDate::new(2451545.0, 0.0));
let tt = tai.to_tt().unwrap();   // TAI + 32.184s

Conversions requiring external data take parameters:

use celestial_time::scales::{TAI, UT1};
use celestial_time::scales::conversions::{ToUT1WithOffset, ToTAIWithOffset};
use celestial_time::julian::JulianDate;

// UT1-TAI offset from IERS Bulletin A
let ut1_tai_offset = -37.0;  // seconds

let tai = TAI::from_julian_date(JulianDate::new(2451545.0, 0.0));
let ut1 = tai.to_ut1_with_offset(ut1_tai_offset).unwrap();
let back = ut1.to_tai_with_offset(ut1_tai_offset).unwrap();

§Precision Notes

All conversions preserve precision by applying offsets to the smaller-magnitude component of the two-part Julian Date. Round-trip conversions maintain sub-nanosecond accuracy for fixed-offset scales.

Re-exports§

pub use tcb_tdb::*;
pub use tcg_tcb::*;
pub use tt_tdb::*;
pub use ut1_tai::*;
pub use utc_tai::*;
pub use utc_ut1::*;

Modules§

gps_tai
GPS and TAI time scale conversions.
tai_tt
Conversions between TAI, TT, and TCG time scales.
tcb_tdb
Conversions between Barycentric Coordinate Time (TCB) and Barycentric Dynamical Time (TDB).
tcg_tcb
Conversions between Geocentric Coordinate Time (TCG) and Barycentric Coordinate Time (TCB).
tt_tcg
Conversions between Terrestrial Time (TT) and Geocentric Coordinate Time (TCG).
tt_tdb
TT (Terrestrial Time) and TDB (Barycentric Dynamical Time) conversions.
ut1_tai
Conversions between UT1, TAI, and TT time scales.
utc_tai
Conversions between Coordinated Universal Time (UTC) and International Atomic Time (TAI).
utc_ut1
Conversions between Coordinated Universal Time (UTC) and Universal Time (UT1).

Traits§

ToGPS
Convert a time scale to GPS Time.
ToTAI
Convert a time scale to International Atomic Time (TAI).
ToTCG
Convert a time scale to Geocentric Coordinate Time (TCG).
ToTT
Convert a time scale to Terrestrial Time (TT).
ToUT1
Convert a time scale to Universal Time 1 (UT1).
ToUTC
Convert a time scale to Coordinated Universal Time (UTC).