Skip to main content

tempoch

Actiu

Typed astronomical time primitives for Rust: Julian Date, MJD, TAI, GPS, UT, and UTC conversions with automatic ΔT handling.

2 estrelles
0 forks
Rust
AGPL-3.0
Actualitzat avui

Per què existeix

tempoch provides strongly typed time instants parameterized by time-scale markers (JD, MJD, TT, UT, TAI, GPS, UnixTime, …) so you can never accidentally mix incompatible time representations. It powers the time layer used across all Siderust crates.

Funcionalitats clau

  • Generic Time<S> instants by time-scale
  • Built-in UTC ↔ TT/MJD conversion via chrono
  • Automatic ΔT = TT − UT handling
  • Period intervals with intersection / complement
  • No-std compatible

Primers passos

# Add to your Cargo.toml
[dependencies]
tempoch = "0.3"

# Convert UTC to Julian Date
use chrono::Utc;
use tempoch::{JulianDate, MJD, Time};

let now_jd = JulianDate::from_utc(Utc::now());
let now_mjd: Time<MJD> = now_jd.to::<MJD>();
println!("JD(TT): {now_jd}");
println!("MJD(TT): {now_mjd}");

Contribuir

Donem la benvinguda a les contribucions! Aquí tens com pots ajudar:

  • 1 Fes un fork del repositori i crea la teva branca des de main
  • 2 Fes els teus canvis i afegeix tests si s'escau
  • 3 Assegura't que tots els tests passen amb cargo test
  • 4 Envia un pull request amb una descripció clara

Llicència

Aquest projecte està llicenciat sota la llicència AGPL-3.0. Consulta el fitxer LICENSE per a més detalls.

Etiquetes

time astronomy julian-date utc rust