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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
//! Committed planetary gravity-coefficient fixtures.
//!
//! Loads spherical-harmonics coefficient sets (and point-mass `mu`
//! values) from the binary fixtures committed under `test_data/gravity/`.
//! The bytes are embedded at compile time via the [`crate::data`] module,
//! so these loaders work identically inside the workspace and from a
//! published `.crate` — no filesystem lookups, no `JEOD_HOME`, no
//! `CARGO_MANIFEST_DIR` resolution at runtime.
//!
//! ## Coverage
//!
//! - **Earth**: [`load_ggm02c`], [`load_ggm05c`], [`load_gemt1`].
//! - **Moon**: [`load_moon_lp150q`], [`load_moon_grail150`] / [`load_moon_grail150_mu`].
//! - **Mars**: [`load_mars_mro110b2`].
//! - **Sun**: [`load_sun_spherical`] / [`load_sun_spherical_mu`]
//! (point-mass; encoded as a degree-1 zero-coefficient SH so the
//! uniform binary loader works — only `mu` and `radius` are
//! physically meaningful).
//!
//! ## Regenerate
//!
//! Earth coefficients (GGM02C / GGM05C / GEMT1):
//!
//! ```bash
//! cargo run -p astrodyn_gravity --bin extract_grav_coeffs
//! ```
//!
//! Mars / Sun / Moon coefficients:
//!
//! ```bash
//! cargo run -p astrodyn_gravity --bin extract_mars_data
//! ```
//!
//! Commit the updated `test_data/gravity/*.bin` and the sidecar
//! `*.json` metadata files together — `include_bytes!` re-reads them at
//! every compile.
use crateSphericalHarmonicsData;
/// Load the GGM02C Earth gravity coefficient set (degree=order=200).
///
/// Equivalent to parsing `models/environment/gravity/data/src/earth_GGM02C.cc`
/// from a JEOD checkout, but reads the embedded binary fixture instead, so
/// callers do not need `JEOD_HOME` set.
/// Load the GGM05C Earth gravity coefficient set (degree=order=360).
///
/// Equivalent to parsing `models/environment/gravity/data/src/earth_GGM05C.cc`
/// from a JEOD checkout, but reads the embedded binary fixture instead, so
/// callers do not need `JEOD_HOME` set.
/// Load the GEM-T1 Earth gravity coefficient set (degree=order=36).
///
/// Equivalent to parsing `models/environment/gravity/data/src/earth_GEMT1.cc`
/// from a JEOD checkout, but reads the embedded binary fixture instead.
/// Used by `SIM_7_time_reversal` Tier 3 tests.
/// Load Mars MRO110B2 spherical harmonics coefficients (degree=order=110).
///
/// Equivalent to parsing `models/environment/gravity/data/src/mars_MRO110B2.cc`
/// from a JEOD checkout, but reads the embedded binary fixture
/// (regenerable via `extract_mars_data`).
/// Load Moon LP150Q (Lunar Prospector) spherical harmonics coefficients
/// (degree=order=150).
///
/// Equivalent to parsing `models/environment/gravity/data/src/moon_LP150Q.cc`
/// from a JEOD checkout, but reads the embedded binary fixture
/// (regenerable via `extract_mars_data`). Used by `SIM_Earth_Moon`.
/// Load Moon GRAIL150 spherical harmonics coefficients (degree=order=150).
///
/// Equivalent to parsing `models/environment/gravity/data/src/moon_GRAIL150.cc`
/// from a JEOD checkout, but reads the embedded binary fixture
/// (regenerable via `extract_mars_data`). The GRAIL field is the newer
/// JEOD default for the Moon and is used by SIM_dyncomp's third-body
/// Moon source as well as the gravity-gradient torque rigs
/// (`SIM_torque_compare_simple`, `SIM_tide_verif`).
/// Load the Moon GRAIL150 gravitational parameter (mu, m³/s²).
///
/// Convenience for callers that only need `mu` for a third-body
/// point-mass approximation (most Tier 3 dyncomp scenarios).
/// Load the full Sun point-mass record (mu and reference radius).
///
/// `sun_spherical.cc` is a JEOD point-mass entry — it has no Cnm/Snm
/// coefficients. The embedded fixture encodes it as a degree-1 SH with
/// all-zero coefficients so the production binary loader works
/// uniformly. Only `mu` and `radius` are physically meaningful; do not
/// evaluate this as a non-spherical model.
///
/// Regenerable via `extract_mars_data`.
/// Load the Sun point-mass gravitational parameter (mu, m³/s²).
///
/// Most callers (Mars, Mercury, Earth–Moon, Venus, etc. Tier 3 tests)
/// model the Sun as a point-mass third-body, so only `mu` is needed.