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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
//! TEME to ITRF: the transform SGP4 forces on us, and nobody standardises.
//!
//! What checks it: `derivations/frame_transform.mac` proves the algebra — that `rot3` fixes `ẑ`, so
//! the single `ω·ẑ` this module attaches to a two-rotation chain is exact for the sidereal half —
//! and `derivations/polar_motion_rate.py` measures the half it is not, against the whole IERS
//! series. See [`teme_to_itrf`]'s "What is neglected".
use ;
use gmst82;
use crate;
use crate;
/// Nominal mean angular velocity of the Earth, rad/s.
///
/// The IERS conventional value. The instantaneous rate differs by the excess length
/// of day: `ω = ω₀·(1 − LOD/86400)`, and LOD reaches a couple of milliseconds, so
/// the correction is order `2×10⁻⁸` relative — a few micrometres per second at the
/// equator. [`teme_to_itrf`] applies it from the `lod_seconds` the caller supplies;
/// passing `0` recovers the nominal rate.
pub const EARTH_ROTATION_RATE: f64 = 7.292_115_146_706_979e-5;
/// Sidereal rotation from TEME into the pseudo-Earth-fixed frame.
///
/// A single rotation about the pole, by Greenwich Mean Sidereal Time. TEME is not
/// defined by any standards body — it is whatever SGP4 emits — and this is the
/// transform the literature attaches to it.
/// The full TEME to ITRF transform, rotation and angular velocity together.
///
/// ```text
/// TEME ──GMST82──▶ PEF ──polar motion──▶ ITRF
/// ```
///
/// The angular velocity is `ω·ẑ` expressed in TEME. Because the first rotation is
/// about `ẑ`, that vector is carried unchanged into PEF, which is what makes the
/// velocity transform in [`Transform::state`] correct there.
///
/// The rate is the instantaneous one, `ω₀·(1 − LOD/86400)`, from the excess length of
/// day `lod_seconds`. Pass `0` for the nominal rate.
///
/// # What is neglected
///
/// The rate of polar motion, and that is the *only* kinematic term dropped:
/// `derivations/frame_transform.mac` proves `rot3` fixes `ẑ`, so the sidereal axis
/// survives the first rotation unchanged and `ω·ẑ` in TEME is exact for it. What is
/// left over is the second rotation's own rate.
///
/// Its size is measured against the IERS series rather than inferred from the
/// wobble's amplitude — `derivations/polar_motion_rate.py`, 19 976 daily rows over
/// 54.7 years: the pole's angular rate is **1.3×10⁻¹³ rad/s** in the median and
/// **3.1×10⁻¹³** at its worst, so **2 µm/s** at the equator against the sidereal
/// term's 465 m/s. `ω` is 2.3×10⁸ times the worst of it. The wobble itself is
/// 0.57 arcsec peak to peak with a secular drift of 0.003 arcsec a year, and it is
/// the 433-day Chandler beat that keeps the *rate* this small. Vallado's reduction
/// neglects it too.
/// Earth orientation at one epoch: everything [`teme_to_itrf`] needs.
/// Build a transform for each epoch, writing into a caller-provided slice.
///
/// # Why this signature
///
/// The frame chain is a function of the epoch alone — not of any satellite. In a
/// coverage run over 10⁴ objects and 10⁵ epochs it must be evaluated 10⁵ times,
/// not 10⁹. Hoisting it into a slice, once, wins four orders of magnitude before a
/// single thread or SIMD lane is considered, and no amount of GPU offload would
/// have recovered them.
///
/// Writing into `&mut [Transform<..>]` rather than returning a `Vec` keeps the
/// allocation with the caller and lets Rust's non-aliasing guarantee stand in for
/// C's `restrict`. When a parallel backend arrives it will split this slice; the
/// kernel does not change.
///
/// # Panics
///
/// If `out` is shorter than `epochs`.