8 releases

0.1.7 Aug 23, 2024
0.1.6 Jul 29, 2024
0.1.4 Dec 14, 2023
0.1.2 Sep 24, 2023
0.1.1 Aug 21, 2023

#9 in #astrodynamics

MIT license

22KB
389 lines

parse-tle

License:MIT

TLE parser in Rust

Install

Command Line:

cargo install parse-tle

or add to your cargo.toml:

[dependencies]
parse-tle = "0.1.3"

Usage

API


use parse_tle::tle::*;

let tle: TLE = parse(tle_string);
println!("\n{}", tle);

CLI

To build:

cargo build --release

To run:

./target/release/parse_tle.exe -h

Which generates the help page:

Parse two line element set

Usage: parse_tle [OPTIONS] [TWO_LINE_ELEMENT] [COMMAND]

Commands:
  celestrak  Query celestrak for tles
  help       Print this message or the help of the given subcommand(s)

Arguments:
  [TWO_LINE_ELEMENT]  Two line element directly in cli

Options:
  -v, --verbose                    Verbose printing
  -f, --file-path <FILE_PATH>      Path to file holding tle information
  -o, --output-path <OUTPUT_PATH>  Path to write json formatted output
  -h, --help                       Print help
  -V, --version                    Print version

To run an example of reading from file:

./target/release/parse_tle.exe -f ./examples/starlink_1007_tle.txt

STARLINK-1007
Catalog #: 44713U
Intl Desig: 19074A
Epoch: 2023-11-05T00:04:07 UTC
Mean Motion: 15.06420179
Mean Motion prime: 0.00013448
Mean Motion prime 2: 0
Radiation Pressure: 91.946
Inclination: 53.0548
Raan: 292.5095
Eccentricity: 0.0001422
Argument of Perigee: 105.9473
Mean Anomaly: 54.1673
Revolution #: 24322

Query celestrak for the ISS:

./target/release/parse_tle celestrak CATNR 25544

Dependencies

~9–21MB
~329K SLoC