1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//! Compact two-term approximation to geocentric TDB.
//!
//! NAIF's `ET` uses the one-term approximation documented in the LSK:
//!
//! ```text
//! TDB - TT = K * sin(E)
//! ```
//!
//! which NAIF states is accurate to about 30 microseconds. NASA HEASARC
//! publishes this approximate relation in The ABC of XTE: A Time Tutorial:
//! <https://heasarc.gsfc.nasa.gov/docs/xte/abc/time_tutorial.html>.
//!
//! ```text
//! TDB - TT = 0.001658 * sin(g) + 0.000014 * sin(2g)
//! g = 357.53 deg + 0.9856003 deg * (JD_TT - 2451545.0)
//! ```
//!
//! The two models are **not interchangeable**. Use [`crate::convert::tai_to_et`]
//! for NAIF/SPICE interoperability. This compact approximation is not a
//! guaranteed accuracy improvement: a daily 1950-2050 comparison with
//! geocentric ERFA `dtdb` has a maximum residual of about 36.5 us. For the
//! 787-term geocentric model use [`crate::dtdb`]. Observer-dependent
//! topocentric and spacecraft proper-time terms are not implemented here.
use crate;
use crateEpoch;
use crateLeapSecondTable;
use cratemath;
/// `TDB - TT` in seconds using the HEASARC two-term approximation.
/// Converts a TAI epoch to TDB seconds past J2000 TDB using the compact model.
/// Converts TDB seconds past J2000 TDB to a TAI epoch using the compact model.