Skip to main content

sidereon_core/
lib.rs

1//! # sidereon-core
2//!
3//! The complete Sidereon engine in one crate. It folds the numerical
4//! astrodynamics core (orbit propagation, force models, frames, time, SGP4)
5//! together with the GNSS domain layer (SP3, broadcast ephemeris, multi-GNSS
6//! positioning, RTK/PPP, ionosphere/troposphere, DOP).
7//!
8//! - The propagation/astro layer is always present under the [`astro`] module.
9//! - The GNSS layer lives behind the default-on `gnss` cargo feature, so a
10//!   propagation-only consumer can build with `--no-default-features` (plus
11//!   any astro features it wants) and never compile the IONEX/SP3 parsers.
12//!
13//! The GNSS façade is organized by user-facing tasks:
14//!
15//! - [`ephemeris`] - precise SP3 and broadcast ephemeris products,
16//! - [`rinex`] - RINEX navigation/observation parsing and CRINEX decoding,
17//! - [`antex`] - ANTEX receiver and satellite antenna calibration parsing,
18//! - [`combinations`] - observable linear combinations such as ionosphere-free,
19//! - [`observables`] - forward range, Doppler, and azimuth/elevation prediction,
20//! - [`velocity`] - receiver velocity and clock-drift solve from range-rate data,
21//! - [`positioning`] - single-point positioning and DOP diagnostics,
22//! - [`dgnss`] - code-differential pseudorange correction and rover pairing,
23//! - [`quality`] - pseudorange weighting, RAIM, and FDE integrity checks,
24//! - [`signal`] - GPS C/A code generation, correlation, and acquisition,
25//! - [`ppp_corrections`] - static-arc PPP correction precomputation,
26//! - [`atmosphere`] - ionosphere and troposphere corrections,
27//! - [`orbit`] - compact reduced-orbit fitting/evaluation.
28//!
29//! Implementation modules (`sp3`, `rinex_nav`, `spp`, etc.) are crate-private.
30//! This is a clean public surface rather than a compatibility shim around the
31//! original implementation-shaped module layout.
32//!
33//! ## Units policy (internal representation)
34//!
35//! All quantities are stored and computed in **SI base units**, with the frame
36//! and datum encoded in the type name (per the spec's frames-in-the-type-system
37//! rule), never hidden behind a bare `position_m`:
38//!
39//! - **Length / position:** meters (`_m`). SP3 positions are ITRF/IGS-frame
40//!   ECEF meters; SPP receiver positions are WGS84/ITRF-compatible ECEF meters.
41//!   (The [`astro`] state layer works in kilometers; conversions happen
42//!   explicitly at the boundary, never implicitly.)
43//! - **Time / clock:** seconds (`_s`). Epochs are represented by the [`astro`]
44//!   time family (`Instant`/`TimeScale`), always scale-tagged; there is no bare
45//!   ambiguous epoch.
46//! - **Velocity:** meters per second (`_m_s`).
47//! - **Angles:** radians (`_rad`) internally. Degrees appear only at I/O edges
48//!   and are named `_deg`.
49//! - **Frequency:** hertz (`_hz`).
50//!
51//! Field and parameter names carry the unit suffix so the unit is visible at
52//! every call site. Matrix/vector linear algebra uses `nalgebra`
53//! (`DMatrix`/`DVector`) per the spec.
54
55// ---------------------------------------------------------------------------
56// Astro / propagation layer. Always present. The GNSS layer below depends on
57// it via `crate::astro::*`.
58// ---------------------------------------------------------------------------
59
60mod validate;
61
62#[cfg(all(test, sidereon_repo_tests))]
63mod test_parity;
64
65pub mod astro;
66
67// ---------------------------------------------------------------------------
68// GNSS domain layer. Behind the default-on `gnss` feature so a propagation-only
69// consumer can opt out. Additional product modules are added as each lands.
70// ---------------------------------------------------------------------------
71
72#[cfg(feature = "gnss")]
73mod ambiguity; // shared RTK/PPP cycle-slip policy + wide-lane/narrow-lane prep
74#[cfg(feature = "gnss")]
75mod antenna; // shared ANTEX PCV/PCO zenith/azimuth interpolation kernels
76#[cfg(feature = "gnss")]
77pub mod antex; // ANTEX receiver/satellite antenna parser + PCO/PCV lookup
78#[cfg(feature = "gnss")]
79mod broadcast; // broadcast-ephemeris (GPS LNAV / Galileo I/NAV) orbit + clock
80#[cfg(feature = "gnss")]
81pub mod broadcast_comparison; // broadcast-vs-precise (SISRE orbit/clock) accuracy
82#[cfg(feature = "gnss")]
83pub mod carrier_phase; // carrier-phase combinations, cycle-slip detection, Hatch smoothing
84#[cfg(feature = "gnss")]
85pub mod constants; // shared GNSS physical/time constants
86#[cfg(feature = "gnss")]
87pub mod constellation; // GNSS constellation identity catalog (CelesTrak/NAVCEN)
88#[cfg(feature = "gnss")]
89mod crinex; // Hatanaka (CRINEX) observation-file decoder
90#[cfg(feature = "gnss")]
91mod dop; // dilution-of-precision geometry (GDOP/PDOP/HDOP/VDOP/TDOP)
92#[cfg(feature = "gnss")]
93pub mod frequencies; // canonical GNSS carrier-frequency table
94#[cfg(feature = "gnss")]
95mod glonass; // GLONASS PZ-90.11 state-vector RK4 propagation
96#[cfg(feature = "gnss")]
97mod ionex; // Klobuchar broadcast model + IONEX ionospheric maps
98#[cfg(feature = "gnss")]
99pub mod navigation; // navigation-message bit-level codecs (GPS LNAV)
100#[cfg(feature = "gnss")]
101pub mod observables; // forward GNSS observable prediction
102#[cfg(feature = "gnss")]
103pub mod ppp_corrections; // static-arc PPP correction tables
104#[cfg(feature = "gnss")]
105pub mod precise_positioning; // static multi-epoch PPP float solve
106#[cfg(feature = "gnss")]
107mod reduced_orbit; // compact mean-element orbit approximation (fitted)
108#[cfg(feature = "gnss")]
109mod rinex_clock; // RINEX clock satellite-bias parsing and interpolation
110#[cfg(feature = "gnss")]
111mod rinex_nav; // RINEX 3 navigation-message parsing (GPS/Galileo broadcast)
112#[cfg(feature = "gnss")]
113mod rinex_obs; // RINEX 3 observation parsing + single-frequency pseudoranges
114#[cfg(feature = "gnss")]
115pub mod rtk; // RTK double-difference construction
116#[cfg(feature = "gnss")]
117pub mod signal; // GPS C/A code, coherent correlation, and acquisition
118#[cfg(feature = "gnss")]
119mod sp3; // SP3-c / SP3-d parser + arbitrary-epoch interpolation
120#[cfg(feature = "gnss")]
121mod spp; // single-point positioning (least-squares PVT)
122#[cfg(feature = "gnss")]
123pub mod staleness; // product-staleness graceful degradation for time-varying products
124#[cfg(feature = "gnss")]
125mod tropo; // Saastamoinen zenith + Niell (NMF) mapping troposphere
126#[cfg(feature = "gnss")]
127pub mod velocity; // receiver velocity / clock-drift least-squares solve
128
129#[cfg(feature = "gnss")]
130mod error;
131#[cfg(feature = "gnss")]
132pub mod frame;
133#[cfg(feature = "gnss")]
134mod id;
135#[cfg(feature = "gnss")]
136mod parse;
137
138#[cfg(feature = "gnss")]
139pub mod atmosphere;
140#[cfg(feature = "gnss")]
141pub mod combinations;
142#[cfg(feature = "gnss")]
143pub mod dgnss;
144#[cfg(feature = "gnss")]
145pub mod ephemeris;
146#[cfg(feature = "gnss")]
147pub mod estimation; // Phase-2 estimation substrate: named operation-order recipes
148#[cfg(feature = "gnss")]
149pub mod geometry;
150#[cfg(feature = "gnss")]
151pub mod ils; // integer least squares ambiguity-resolution kernels
152#[cfg(feature = "gnss")]
153pub mod orbit;
154#[cfg(feature = "gnss")]
155pub mod positioning;
156#[cfg(feature = "gnss")]
157pub mod prelude;
158#[cfg(feature = "gnss")]
159pub mod quality; // measurement weighting, RAIM, and FDE integrity checks
160#[cfg(feature = "gnss")]
161pub mod rinex;
162#[cfg(feature = "gnss")]
163pub mod rtk_filter; // sequential RTK baseline filter - serializable state ABI (kernel migration)
164#[cfg(feature = "gnss")]
165pub mod terrain;
166#[cfg(feature = "gnss")]
167pub mod tides;
168#[cfg(feature = "gnss")]
169pub mod tolerances;
170
171#[cfg(feature = "gnss")]
172pub use error::{Error, Result};
173#[cfg(feature = "gnss")]
174pub use frame::{FrameValueError, ItrfPositionM, ItrfVelocityMS, Wgs84Geodetic};
175#[cfg(feature = "gnss")]
176pub use id::{GnssSatelliteId, GnssSystem, SatelliteIdError};