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::{
8    AU_KM, AU_M, GM_MOON_KM3_S2, GM_SUN_KM3_S2, SOLAR_RADIATION_PRESSURE_N_M2,
9};
10pub use crate::astro::constants::earth::{
11    J2_EARTH, J3_EARTH, J4_EARTH, J5_EARTH, J6_EARTH, MEAN_EARTH_RADIUS_KM, MEAN_EARTH_RADIUS_M,
12    OMEGA_E_DOT_RAD_S, WGS84_A_KM, WGS84_A_M, WGS84_E2, WGS84_F,
13};
14pub use crate::astro::constants::geometry::AZIMUTH_ZENITH_EPS;
15pub use crate::astro::constants::time::{
16    DAYS_PER_JULIAN_YEAR, J2000_JD, SECONDS_PER_DAY, SECONDS_PER_HOUR, SECONDS_PER_MINUTE,
17    SECONDS_PER_WEEK,
18};
19pub use crate::astro::constants::units::{
20    DEGREES_PER_CIRCLE, DEGREES_PER_SEMICIRCLE, DEG_TO_RAD, KM_TO_M, MICROSECONDS_PER_SECOND,
21    MM_PER_M, M_PER_KM, NS_TO_S, RAD_TO_DEG, US_TO_S,
22};
23
24/// Seconds in half a GNSS week, the rollover fold threshold.
25pub const HALF_WEEK_S: f64 = SECONDS_PER_WEEK / 2.0;
26
27/// Speed of light in vacuum (m/s), IS-GPS-200. Re-exported from the canonical
28/// core home so the value is defined once for the whole workspace.
29pub const C_M_S: f64 = crate::astro::constants::physics::SPEED_OF_LIGHT_M_S;
30
31/// Speed of light in vacuum (km/s), exact SI value converted to kilometers.
32pub const C_KM_S: f64 = crate::astro::constants::physics::SPEED_OF_LIGHT_KM_S;
33
34/// GPS L1 carrier frequency (Hz). Galileo E1 shares this frequency.
35pub const F_L1_HZ: f64 = 1_575.42e6;
36
37/// GPS L2 carrier frequency (Hz).
38pub const F_L2_HZ: f64 = 1_227.60e6;
39
40/// Galileo E1 carrier frequency (Hz). GPS L1 shares this frequency.
41pub const F_E1_HZ: f64 = F_L1_HZ;
42
43/// Galileo E5a carrier frequency (Hz).
44pub const F_E5A_HZ: f64 = 1_176.45e6;
45
46/// BeiDou B1I carrier frequency (Hz).
47pub const F_B1I_HZ: f64 = 1_561.098e6;
48
49/// BeiDou B3I carrier frequency (Hz).
50pub const F_B3I_HZ: f64 = 1_268.52e6;
51
52/// Seconds from GPS epoch (1980-01-06 00:00) to J2000 (2000-01-01 12:00).
53pub const GPS_EPOCH_TO_J2000_S: f64 = 630_763_200.0;
54
55/// GPS Time minus BeiDou Time (seconds): BDT = GPST - 14 s.
56pub const GPST_MINUS_BDT_S: f64 = 14.0;
57
58/// GPS/Galileo/QZSS and BeiDou system-time-minus-TAI offsets. Canonically
59/// defined in the always-on astro time-constants module (the always-present
60/// `astro::time` scale layer needs them); re-exported here for GNSS consumers.
61pub use crate::astro::constants::time::{BDT_MINUS_TAI_S, GPST_MINUS_TAI_S};
62
63/// Seconds from the GPS epoch to the BeiDou epoch (2006-01-01).
64pub const BDS_EPOCH_MINUS_GPS_EPOCH_S: f64 = 1356.0 * SECONDS_PER_WEEK;
65
66/// Fixed transmit-time iterations for SPP residuals.
67///
68/// The SPP solver is pinned to two iterations by the SPP trace fixtures. The
69/// observable predictor deliberately uses a separate three-iteration policy
70/// because it mirrors Sidereon `Observables.predict` and its own SP3 oracle.
71pub const SPP_TRANSMIT_TIME_ITERATIONS: usize = 2;
72
73/// Fixed transmit-time iterations for observable prediction.
74///
75/// Kept distinct from [`SPP_TRANSMIT_TIME_ITERATIONS`] after oracle
76/// reconciliation: the public observable predictor performs three light-time
77/// refinement iterations plus the final transmit-epoch evaluation.
78pub const OBSERVABLE_TRANSMIT_TIME_ITERATIONS: usize = 3;
79
80/// Default SP3 provenance comment emitted when a product has no comments.
81pub const SP3_DEFAULT_PROVENANCE_COMMENT: &str = "Generated by sidereon-core";