Skip to main content

Crate mako_sgp4

Crate mako_sgp4 

Source
Expand description

mako-sgp4: parse and propagate general perturbation element sets with SGP4/SDP4.

§Examples

use mako_sgp4::{from_tle_lines, sgp4_prop_delta};

// Parse a TLE and propagate to epoch
let line0 = "ISS (ZARYA)";
let line1 = "1 25544U 98067A   08264.51782528 -.00002182 -00100-2 -11606-4 0  2921";
let line2 = "2 25544  51.6416 247.4627 0006703 130.5360 325.0288 15.72125391563537";
let sgp4 = from_tle_lines(line1, line2, Some(line0)).unwrap();
let state = sgp4_prop_delta(&sgp4, 0.0).unwrap();

assert_eq!(sgp4.gp.satellite_catalog_number, 25544);
assert!(state.r_x.is_finite());

Modules§

common
Module to handle common constants, coordinate types, and utility functions shared across GP parsing and SGP4 propagation.
gp
Module to handle the input and processing of GP (General Perturbation) elements. Element sets can be parsed from TLE (including Alpha-5 catalog numbers) and OMM formats, and written back to TLE and OMM KVN, XML, JSON, and CSV.
sgp4
Module for propagating GP element sets with SGP4
time
Module for datetime representation and calendar conversions used by GP parsing and SGP4 propagation (UTC Julian / Modified Julian dates).

Structs§

DateTime
A datetime structure
GenPerturbElementSet
General Perturbation Element Set for an Earth-orbiting satellite.
Sgp4
Simplified General Perturbations 4 (SGP4) parameters
StateVector
Satellite state vector
Wgs
World Geodetic System (WGS) parameters

Enums§

CoordinateFrame
Coordinate frames
DateError
Date conversion errors
GpError
GP errors
Sgp4Error
SGP4 errors
Timezone
Timezone options for datetime representation

Constants§

WGS72
Fundamental and derived constants for WGS-72
WGS84
Fundamental and derived constants for WGS-84

Functions§

calc_period
Calculate the orbital period from semi-major axis and gravitational parameter
calc_theta_g
Calculate Greenwich mean sidereal time (GMST) / longitude of Greenwich at a Julian date.
dayofyr2utc
Convert a year and day of year to a UTC datetime
deg2rad
Convert an angle from degrees to radians
from_omm_csv_file
Builds a vector of Sgp4 structs from a file containing Orbit Mean-Elements Message (OMM) sets in CSV format.
from_omm_csv_string
Builds a vector of Sgp4 structs from a string containing Orbit Mean-Elements Message (OMM) sets in CSV format.
from_omm_json_file
Builds a vector of Sgp4 structs from a file containing Orbit Mean-Elements Message (OMM) sets in JSON format.
from_omm_json_string
Builds a vector of Sgp4 structs from a string containing Orbit Mean-Elements Message (OMM) sets in JSON format.
from_omm_kvn_file
Builds a vector of Sgp4 structs from a file containing Orbit Mean-Elements Message (OMM) sets in CCSDS KVN format.
from_omm_kvn_lines
Builds a Sgp4 struct from the lines of a single OMM KVN record.
from_omm_kvn_string
Builds a vector of Sgp4 structs from a string containing Orbit Mean-Elements Message (OMM) sets in CCSDS KVN (key-value notation) format.
from_omm_xml_file
Builds a vector of Sgp4 structs from a file containing Orbit Mean-Elements Message (OMM) sets in CCSDS XML format.
from_omm_xml_string
Builds a vector of Sgp4 structs from a string containing Orbit Mean-Elements Message (OMM) sets in CCSDS XML format.
from_tle_file
Builds a vector of Sgp4 structs from a file containing Two-Line Element (TLE) sets.
from_tle_lines
Builds a Sgp4 struct from the lines of a Two-Line Element (TLE) set.
from_tle_string
Builds a vector of Sgp4 structs from a string containing Two-Line Element (TLE) sets.
init_sgp4
Build an Sgp4 struct for state propagation from a GenPerturbElementSet struct
sgp4_prop_datetime
Propagate an initialized Sgp4 model to a UTC DateTime.
sgp4_prop_delta
Propagate an initialized Sgp4 model by delta_t minutes from the TLE epoch.
to_omm_csv_file
Writes a Celestrak-style CSV OMM file from a slice of Sgp4 structs.
to_omm_csv_string
Builds a Celestrak-style CSV OMM string from a slice of Sgp4 structs.
to_omm_json_file
Writes a Celestrak-style JSON OMM file from a slice of Sgp4 structs.
to_omm_json_string
Builds a Celestrak-style JSON OMM string from a slice of Sgp4 structs.
to_omm_kvn_file
Writes a CCSDS KVN OMM file from a slice of Sgp4 structs.
to_omm_kvn_string
Builds a CCSDS KVN OMM string from a slice of Sgp4 structs.
to_omm_xml_file
Writes a CCSDS XML OMM file from a slice of Sgp4 structs.
to_omm_xml_string
Builds a CCSDS XML OMM string from a slice of Sgp4 structs.
to_tle_file
Writes a Two-Line Element (TLE) file from a slice of Sgp4 structs.
to_tle_string
Builds a Two-Line Element (TLE) string from a slice of Sgp4 structs.
utc2jday
Convert a datetime in UTC to Julian date (JD) format.
utc2mjday
Convert a datetime in UTC to Modified Julian date (MJD) format.
validate_datetime
Validate the calendar and clock fields of a datetime