Skip to main content

Crate spacelab_frames

Crate spacelab_frames 

Source
Expand description

Reference frames, in the type system.

Every existing implementation of this — SOFA, ERFA, sofars, and the rest — hands you a bare 3×3 matrix and trusts you to remember what it connects. The two most expensive bug classes in the field follow directly: composing a chain in the wrong order, and applying a transform to the wrong frame’s vector.

Both are compile-time preventable, and here they are prevented:

ⓘ
let a: Rotation<Teme, Itrf> = get();
let b: Rotation<Gcrf, Itrf> = get();
let _ = a * b; // the chain does not join: Itrf is not Gcrf

All of it erases at monomorphization. A Rotation is a Mat3 and nothing more.

§Velocity is not a vector you rotate

A Rotation applies to a Position. Only a Transform applies to a StateVector, because moving a velocity between rotating frames requires the ω × r term. Forgetting it costs 465 m/s at the equator, looks plausible, and is among the most repeated mistakes in the field. Here the type system will not let you forget: there is no Mul<StateVector<A>> for Rotation<A, B>.

§Batch shape

Precession, nutation, Earth rotation and polar motion are functions of the epoch alone — not of the satellite. Over 10⁴ satellites and 10⁵ epochs the frame chain is evaluated 10⁵ times, not 10⁹, provided it is hoisted. teme_to_itrf_into writes into a caller-provided slice for exactly that reason: the four orders of magnitude are won by a Vec, before any thread or lane is considered.

Structs§

CioInterpolator
A GCRF→ITRF transform provider that interpolates the slow precession-nutation geometry from a grid precomputed over the propagation span, applying the exact Earth Rotation Angle per query.
Cirs
Celestial Intermediate Reference System. GCRF, with precession and nutation applied.
Gcrf
Geocentric Celestial Reference Frame. Quasi-inertial, the IAU’s answer to “what does not rotate”.
Itrf
International Terrestrial Reference Frame. Bolted to the crust.
Orientation
Earth orientation at one epoch: everything teme_to_itrf needs.
Pef
Pseudo-Earth-Fixed. The classical equinox-based counterpart of Tirs: what you get after rotating by sidereal time, before polar motion.
Position
A position, in a known frame.
Rotation
A rotation from one frame to another.
StateVector
Position and velocity, in a known frame, at an implied instant.
Teme
True Equator, Mean Equinox. What SGP4 emits, and what no standard defines precisely. Neither SOFA nor ERFA offers it.
Tirs
Terrestrial Intermediate Reference System. CIRS, spun by the Earth Rotation Angle. Differs from Pef only by the TIO locator, some tens of microarcseconds.
Transform
A rotation between frames that turn relative to one another.
Velocity
A velocity, in a known frame.

Constants§

EARTH_ROTATION_RATE
Nominal mean angular velocity of the Earth, rad/s.

Traits§

Frame
A reference frame.

Functions§

cirs_to_tirs
CIRS to TIRS: Earth rotation about the Celestial Intermediate Pole, by the Earth Rotation Angle. A single rotation about the pole, R₃(ERA).
gcrf_to_cirs
GCRS to CIRS: the precession-nutation rotation Q(t) from the CIP coordinates X, Y and the CIO locator s.
gcrf_to_itrf
The full GCRF to ITRF transform, IAU 2006/2000A, rotation and angular velocity.
gcrf_to_itrf_into
Build a GCRF→ITRF transform for each epoch, writing into a caller-provided slice.
pef_to_itrf
The polar-motion matrix, taking a pseudo-Earth-fixed vector into the ITRF.
teme_to_itrf
The full TEME to ITRF transform, rotation and angular velocity together.
teme_to_itrf_into
Build a transform for each epoch, writing into a caller-provided slice.
teme_to_pef
Sidereal rotation from TEME into the pseudo-Earth-fixed frame.
tio_locator
The TIO locator s', the tiny angle positioning the Terrestrial Intermediate Origin on the equator of the Celestial Intermediate Pole.
tirs_to_itrf
TIRS to ITRF: polar motion, W(t)ᵀ = R₁(−y_p)·R₂(−x_p)·R₃(s′).