Expand description
This crate implements the SGP4 algorithm for satellite propagation
It also provides methods to parse Two-Line Element Set (TLE) and Orbit Mean-Elements Message (OMM) data.
A UTF-8 transcript of the mathematical expressions that compose SGP4 can be found in the repository https://github.com/neuromorphicsystems/sgp4.
§Example
The following standalone program downloads the lastest Galileo OMMs from Celestrak and predicts the satellites’ positions and velocities after 12 h and 24 h.
fn main() -> anyhow::Result<()> {
let response = ureq::get("https://celestrak.com/NORAD/elements/gp.php")
.query("GROUP", "galileo")
.query("FORMAT", "json")
.call()?;
let elements_vec: Vec<sgp4::Elements> = response.into_json()?;
for elements in &elements_vec {
println!("{}", elements.object_name.as_ref().unwrap());
let constants = sgp4::Constants::from_elements(elements)?;
for hours in &[12, 24] {
println!(" t = {} min", hours * 60);
let prediction = constants.propagate(sgp4::MinutesSinceEpoch((hours * 60) as f64))?;
println!(" r = {:?} km", prediction.position);
println!(" ṙ = {:?} km.s⁻¹", prediction.velocity);
}
}
Ok(())
}
More examples can be found in the repository https://github.com/neuromorphicsystems/sgp4/tree/master/examples.
Re-exports§
pub use chrono;
Structs§
- Constants
- Propagator variables calculated from epoch quantities and used during propagation
- Datetime
ToMinutes Since Epoch Error - Nanoseconds overflow while converting from datetime to minutes since epoch
- Elements
- General perturbations orbital data parsed from a TLE or OMM
- Geopotential
- Model of the Earth radius and gravitational field
- Minutes
Since Epoch - Minutes ellapsed since the elements’ epoch
- Orbit
- The Brouwer orbital elements
- OutOf
Range Epoch Eccentricity - The orbit used to generate epoch constants has an invalid eccentricity
- Prediction
- Predicted satellite position and velocity after SGP4 propagation
- Resonance
State - Represents the state of the deep space resonnance integrator
- TleError
- Represents a TLE parse error
Enums§
- Classification
- A satellite’s elements classification
- Elements
Error - Errors returned when creating epoch contants from elements
- Error
- Represents a propagation error caused by orbital elements divergence
- Kozai
Elements Error - Represents a propagation error caused by orbital elements divergence
- Minutes
Since Epoch ToDatetime Error - Nanoseconds overflow while converting from minutes since epoch to datetime
- TleError
Line - Input line where a parse error was found
- TleError
What - TLE error type
Constants§
- WGS72
- The geopotential model used in the AFSPC implementation
- WGS84
- The geopotential model recommended by the IAU
Functions§
- afspc_
epoch_ to_ sidereal_ time - Converts an epoch to sidereal time using the AFSPC expression
- iau_
epoch_ to_ sidereal_ time - Converts an epoch to sidereal time using the IAU expression
- julian_
years_ since_ j2000 - Returns the number of years since UTC 1 January 2000 12h00 (J2000)
- julian_
years_ since_ j2000_ afspc_ compatibility_ mode - Returns the number of years since UTC 1 January 2000 12h00 (J2000) using the AFSPC expression
- parse_
2les alloc
- Parses a multi-line TL/2LE string into a list of
Elements
- parse_
3les alloc
- Parses a multi-line TL/3LE string into a list of
Elements