Skip to main content

sidereon_core/
constants.rs

1//! Shared GNSS constants.
2//!
3//! These are semantic constants used across multiple GNSS modules. A parity
4//! target may still keep a local alias or comment when the operation order of a
5//! formula matters, but the source value lives here so modules do not drift.
6
7pub use crate::astro::constants::astro::{AU_KM, AU_M};
8pub use crate::astro::constants::earth::{
9    MEAN_EARTH_RADIUS_M, OMEGA_E_DOT_RAD_S, WGS84_A_KM, WGS84_A_M, WGS84_E2, WGS84_F,
10};
11pub use crate::astro::constants::time::{J2000_JD, SECONDS_PER_DAY, SECONDS_PER_WEEK};
12pub use crate::astro::constants::units::{
13    DEGREES_PER_CIRCLE, DEGREES_PER_SEMICIRCLE, DEG_TO_RAD, KM_TO_M, MICROSECONDS_PER_SECOND,
14    MM_PER_M, M_PER_KM, RAD_TO_DEG, US_TO_S,
15};
16
17/// Seconds in half a GNSS week, the rollover fold threshold.
18pub const HALF_WEEK_S: f64 = SECONDS_PER_WEEK / 2.0;
19
20/// Speed of light in vacuum (m/s), IS-GPS-200. Re-exported from the canonical
21/// core home so the value is defined once for the whole workspace.
22pub const C_M_S: f64 = crate::astro::constants::physics::SPEED_OF_LIGHT_M_S;
23
24/// GPS L1 carrier frequency (Hz). Galileo E1 shares this frequency.
25pub const F_L1_HZ: f64 = 1_575.42e6;
26
27/// GPS L2 carrier frequency (Hz).
28pub const F_L2_HZ: f64 = 1_227.60e6;
29
30/// Galileo E1 carrier frequency (Hz). GPS L1 shares this frequency.
31pub const F_E1_HZ: f64 = F_L1_HZ;
32
33/// Galileo E5a carrier frequency (Hz).
34pub const F_E5A_HZ: f64 = 1_176.45e6;
35
36/// BeiDou B1I carrier frequency (Hz).
37pub const F_B1I_HZ: f64 = 1_561.098e6;
38
39/// BeiDou B3I carrier frequency (Hz).
40pub const F_B3I_HZ: f64 = 1_268.52e6;
41
42/// Seconds from GPS epoch (1980-01-06 00:00) to J2000 (2000-01-01 12:00).
43pub const GPS_EPOCH_TO_J2000_S: f64 = 630_763_200.0;
44
45/// GPS Time minus BeiDou Time (seconds): BDT = GPST - 14 s.
46pub const GPST_MINUS_BDT_S: f64 = 14.0;
47
48/// GPS/Galileo system time minus TAI, seconds.
49pub const GPST_MINUS_TAI_S: f64 = 19.0;
50
51/// BeiDou time minus TAI, seconds.
52pub const BDT_MINUS_TAI_S: f64 = 33.0;
53
54/// Seconds from the GPS epoch to the BeiDou epoch (2006-01-01).
55pub const BDS_EPOCH_MINUS_GPS_EPOCH_S: f64 = 1356.0 * SECONDS_PER_WEEK;
56
57/// Fixed transmit-time iterations for SPP residuals.
58///
59/// The SPP solver is pinned to two iterations by the SPP trace fixtures. The
60/// observable predictor deliberately uses a separate three-iteration policy
61/// because it mirrors Sidereon `Observables.predict` and its own SP3 oracle.
62pub const SPP_TRANSMIT_TIME_ITERATIONS: usize = 2;
63
64/// Fixed transmit-time iterations for observable prediction.
65///
66/// Kept distinct from [`SPP_TRANSMIT_TIME_ITERATIONS`] after oracle
67/// reconciliation: the public observable predictor performs three light-time
68/// refinement iterations plus the final transmit-epoch evaluation.
69pub const OBSERVABLE_TRANSMIT_TIME_ITERATIONS: usize = 3;
70
71/// Default SP3 provenance comment emitted when a product has no comments.
72pub const SP3_DEFAULT_PROVENANCE_COMMENT: &str = "Generated by sidereon-core";