Skip to main content

mako_sgp4/
lib.rs

1//! mako-sgp4: parse and propagate general perturbation element sets with SGP4/SDP4.
2//!
3//! # Examples
4//! ```rust
5//! use mako_sgp4::{from_tle_lines, sgp4_prop_delta};
6//!
7//! // Parse a TLE and propagate to epoch
8//! let line0 = "ISS (ZARYA)";
9//! let line1 = "1 25544U 98067A   08264.51782528 -.00002182 -00100-2 -11606-4 0  2921";
10//! let line2 = "2 25544  51.6416 247.4627 0006703 130.5360 325.0288 15.72125391563537";
11//! let sgp4 = from_tle_lines(line1, line2, Some(line0)).unwrap();
12//! let state = sgp4_prop_delta(&sgp4, 0.0).unwrap();
13//!
14//! assert_eq!(sgp4.gp.satellite_catalog_number, 25544);
15//! assert!(state.r_x.is_finite());
16//! ```
17
18pub mod common;
19pub mod gp;
20pub mod sgp4;
21pub mod time;
22
23#[doc(inline)]
24pub use common::{CoordinateFrame, StateVector, WGS72, WGS84, Wgs, calc_period, deg2rad};
25#[doc(inline)]
26pub use gp::{
27    GenPerturbElementSet, GpError, from_omm_kvn_file, from_omm_kvn_lines, from_omm_kvn_string,
28    from_tle_file, from_tle_lines, from_tle_string, to_omm_kvn_file, to_omm_kvn_string,
29    to_tle_file, to_tle_string,
30};
31#[cfg(feature = "csv")]
32#[doc(inline)]
33pub use gp::{from_omm_csv_file, from_omm_csv_string, to_omm_csv_file, to_omm_csv_string};
34#[cfg(feature = "json")]
35#[doc(inline)]
36pub use gp::{from_omm_json_file, from_omm_json_string, to_omm_json_file, to_omm_json_string};
37#[cfg(feature = "xml")]
38#[doc(inline)]
39pub use gp::{from_omm_xml_file, from_omm_xml_string, to_omm_xml_file, to_omm_xml_string};
40#[doc(inline)]
41pub use sgp4::{Sgp4, Sgp4Error, calc_theta_g, init_sgp4, sgp4_prop_datetime, sgp4_prop_delta};
42#[doc(inline)]
43pub use time::{
44    DateError, DateTime, Timezone, dayofyr2utc, utc2jday, utc2mjday, validate_datetime,
45};