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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
//! # SatKit: Satellite Toolkit
//!
//! A comprehensive, high-performance satellite astrodynamics library combining the speed of Rust
//! with the convenience of Python. SatKit provides industrial-grade satellite orbital mechanics
//! calculations with a clean, intuitive API. Built from the ground up in Rust for maximum performance
//! and memory safety, it offers complete Python bindings for all functionality, making advanced orbital
//! mechanics accessible to both systems programmers and data scientists.
//!
//! ## Core Features
//!
//! ### Time Systems
//! - Comprehensive timescale transformations (UTC, GPS, UT1, TDB, TT, TAI)
//! - Leap second handling
//! - High-precision time arithmetic and conversions
//!
//! ### Coordinate Frame Transformations
//! High-precision coordinate transforms between multiple reference frames:
//! - **International Terrestrial Reference Frame (ITRF)**: Earth-fixed frame
//! - **Geocentric Celestial Reference Frame (GCRF)**: Inertial frame using IERS 2010 reduction
//! - **True Equinox Mean Equator (TEME)**: Frame used in SGP4 propagation
//! - **Celestial Intermediate Reference Frame (CIRF)**: IERS 2010 intermediate frame
//! - **Terrestrial Intermediate Reference Frame (TIRF)**: Earth-rotation intermediate frame
//! - **RTN / NTW / LVLH**: Satellite-local frames for maneuvers, thrust, and
//! covariance (`RTN` is the CCSDS OEM canonical name; `RIC` and `RSW` are aliases)
//! - **Geodetic Coordinates**: Latitude, longitude, altitude conversions
//!
//! Unified API: [`frametransform::to_gcrf`] / [`frametransform::from_gcrf`] and
//! [`frametransform::state_to_gcrf`] / [`frametransform::gcrf_to_state`] replace
//! the per-frame helper explosion.
//!
//! ### Orbit Propagation
//! Multiple propagation methods for various accuracy requirements:
//! - **SGP4**: Simplified General Perturbations for Two-Line Element (TLE) sets with fitting capability
//! - **Numerical Integration**: High-precision propagation using adaptive
//! Runge-Kutta (9(8), 8(7), 6(5), 5(4)), RODAS4 (stiff), or **Gauss-Jackson 8**
//! (fixed-step multistep predictor-corrector specialised for long-duration
//! orbit propagation, with per-step dense output)
//! - **Keplerian**: Simplified two-body propagation
//! - **State Transition Matrix**: Support for covariance propagation
//! - **Configurable `max_steps`**: [`PropSettings::max_steps`] bounds runaway propagation
//!
//! ### Orbit Maneuvers
//! - **Impulsive maneuvers**: Instantaneous delta-v at scheduled times in GCRF,
//! RTN (= RIC / RSW), NTW, or LVLH frames. Ergonomic helpers (`prograde`,
//! `retrograde`, `radial_out`, `normal`) cover the common scalar-magnitude burns.
//! - **Continuous thrust**: Constant-acceleration arcs integrated into the force model
//! - Automatic propagation segmentation through maneuver sequences, including
//! backward propagation
//!
//! ### Force Models
//! Comprehensive perturbation modeling:
//! - High-order Earth gravity (JGM2, JGM3, EGM96, ITU GRACE16)
//! - Solar and lunar gravity perturbations
//! - Atmospheric drag using NRLMSISE-00 density model with space weather data
//! - Solar radiation pressure
//! - Continuous thrust acceleration
//!
//! ### Ephemerides
//! - **JPL Ephemerides**: High-precision planetary and lunar positions
//! - **Low-Precision Ephemerides**: Fast analytical models for sun and moon
//!
//! ### Additional Capabilities
//! - Keplerian orbital elements and conversions
//! - Geodesic distance calculations
//! - TLE parsing, generation, and orbit fitting
//! - Unscented Kalman Filter (UKF) implementation
//!
//! ## Language Bindings
//!
//! - **Rust**: Native library available on [crates.io](https://crates.io/crates/satkit)
//! - **Python**: Complete Python bindings via PyO3, available on [PyPI](https://pypi.org/project/satkit/)
//! - Binary wheels for Windows, macOS (Intel & ARM), and Linux (x86_64 & ARM64)
//! - Python versions 3.10 through 3.14
//! - Documentation at <https://satkit.dev/>
//!
//! ## Linear Algebra
//!
//! SatKit uses the [`numeris`](https://crates.io/crates/numeris) crate for all linear algebra
//! (vectors, matrices, quaternions, ODE solvers). Types are re-exported via [`mathtypes`].
//! If you need nalgebra types for interoperability with other crates, enable the `nalgebra`
//! feature on `numeris` for zero-cost `From`/`Into` conversions:
//!
//! ```toml
//! numeris = { version = "0.5.7", features = ["nalgebra"] }
//! ```
//!
//! ## Optional Features
//!
//! - **chrono**: Enables interoperability with `chrono::DateTime` by implementing the `TimeLike` trait.
//! Activate with Cargo feature `chrono`.
//!
//! ## Getting Started
//!
//! ### Data Files
//!
//! The library requires external data files for many calculations:
//!
//! - [JPL Planetary Ephemerides](https://ssd.jpl.nasa.gov/ephem.html) - High-precision planetary positions
//! - [Earth Gravity Models](http://icgem.gfz-potsdam.de/) - Spherical harmonic coefficients
//! - [Space Weather Data](https://celestrak.org/SpaceData/) - Solar flux and geomagnetic indices
//! - [Earth Orientation Parameters](https://celestrak.org/SpaceData/) - Polar motion and UT1-UTC
//! - [IERS Conventions Tables](https://www.iers.org/IERS/EN/Publications/TechnicalNotes/tn36.html) - Nutation coefficients
//!
//! Data files need to be downloaded once. Space weather and Earth orientation parameter files are
//! updated daily and should be refreshed periodically for optimal accuracy.
//!
//! ### Downloading Data Files
//!
//! ```no_run
//! // Print the directory where data will be stored
//! println!("Data directory: {:?}", satkit::utils::datadir());
//!
//! // Download required data files
//! // - Downloads missing files
//! // - Updates space weather and Earth orientation parameters
//! // - Skips files that already exist
//! satkit::utils::update_datafiles(None, false);
//! ```
//!
//! ## Example Usage
//!
//! ```no_run
//! use satkit::prelude::*;
//!
//! // Create a time instant
//! let time = Instant::from_datetime(2024, 1, 1, 12, 0, 0.0).unwrap();
//!
//! // Coordinate frame transformations
//! let itrf_pos = ITRFCoord::from_geodetic_deg(42.0, -71.0, 100.0);
//!
//! // Get planetary ephemeris
//! let (moon_pos, moon_vel) = satkit::jplephem::geocentric_state(
//! SolarSystem::Moon,
//! &time
//! ).unwrap();
//! ```
//!
//! ## Running Tests
//!
//! Tests require external data files and test vectors. Download them with the provided scripts:
//!
//! ```bash
//! pip install requests
//! python python/test/download_testvecs.py
//! ```
//!
//! Then run with the environment variables set:
//!
//! ```bash
//! SATKIT_DATA=astro-data SATKIT_TESTVEC_ROOT=satkit-testvecs cargo test
//! ```
//!
//! ## References
//!
//! This implementation relies heavily on the following excellent references:
//!
//! - **"Fundamentals of Astrodynamics and Applications, Fourth Edition"**
//! by D. Vallado, Microcosm Press and Springer, 2013
//! - **"Satellite Orbits: Models, Methods, Applications"**
//! by O. Montenbruck and E. Gill, Springer, 2000
//!
//! ## License
//!
//! MIT License - See LICENSE file for details
// Math type definitions using the numeris crate
/// Universal constants
/// Earth orientation parameters (polar motion, delta-UT1, length of day)
/// Zonal gravity model for Earth gravity
/// Conversion between coordinate frames
/// International Terrestrial Reference Frame coordinates &
/// transformations to Geodetic, East-North-Up, North-East-Down
/// Solar system body ephemerides, as published by the Jet Propulsion Laboratory (JPL)
/// Keplerian orbital elements
/// Lambert's problem solver for orbital targeting
/// Low-precision ephemeris for sun and moon
/// NRLMSISE-00 Density model
/// High-Precision Orbit Propagation using numeris ODE solvers
/// SGP-4 Orbit Propagator
/// Solar Cycle Forecast (NOAA/SWPC predicted F10.7)
/// Solar system bodies
/// Space Weather
/// Two-line Element Set
/// Utility functions
/// Coordinate frames (re-exported as `Frame` at crate root)
// Orbital Mean-Element Messages
// Time and duration
pub use ;
// Core types available at crate level
pub use Frame;
pub use ;
pub use Kepler;
pub use ;
pub use ;
pub use SolarSystem;
pub use TLE;
/// Prelude for convenient wildcard import.
///
/// Brings the most commonly used types, traits, and functions into scope.
///
/// ```
/// use satkit::prelude::*;
/// ```