#parser #tle #elements #two-line

tle-parser

Parser for the TLE (Two-line elements)

4 releases

0.1.3 Feb 17, 2020
0.1.2 Feb 15, 2020
0.1.1 Feb 15, 2020
0.1.0 Feb 15, 2020

#5 in #tle

Download history 87/week @ 2024-07-19 167/week @ 2024-07-26 51/week @ 2024-08-02 157/week @ 2024-08-09 75/week @ 2024-08-16 53/week @ 2024-08-23 68/week @ 2024-08-30 58/week @ 2024-09-06 71/week @ 2024-09-13 92/week @ 2024-09-20 179/week @ 2024-09-27 65/week @ 2024-10-04 70/week @ 2024-10-11 22/week @ 2024-10-18 76/week @ 2024-10-25 116/week @ 2024-11-01

293 downloads per month
Used in tletools

MIT/Apache

12KB
249 lines

TLE Parser

tle-parser at crates.io Actions Status MIT License

TLE (Two-line elements) parser.

Example

extern crate tle_parser;

use tle_parser::parse;

fn main() {
    let raw_tle = "ISS (ZARYA)
1 25544U 98067A   20045.18587073  .00000950  00000-0  25302-4 0  9990
2 25544  51.6443 242.0161 0004885 264.6060 207.3845 15.49165514212791";

    let tle = parse(raw_tle);

    match tle {
        Ok(t) => println!("{:?}", t),
        Err(_) => println!("Error Parsing TLE"),
    }

}

Output

TLE {
    name: "ISS (ZARYA)",
    satellite_number: 25544,
    classification: 'U',
    international_designator: "98067A",
    epoch: "20045.18587073",
    first_derivative_mean_motion: 0.0000095,
    second_derivative_mean_motion: 0.0,
    drag_term: 0.000025302,
    ephemeris_type: 0,
    element_number: 999,
    inclination: 51.6443,
    right_ascension: 242.0161,
    eccentricity: 0.0004885,
    argument_of_perigee: 264.606,
    mean_anomaly: 207.3845,
    mean_motion: 15.49165514,
    revolution_number: 21279,
}

You can run this example with the following command:

cargo run --example parse_iss_tle

Dependencies

~1.3–2.2MB
~47K SLoC