Tle

Struct Tle 

Source
pub struct Tle { /* private fields */ }
Expand description

Two-Line Element Set (TLE) data structure.

A TLE is a standardized format for describing the orbit of an Earth-orbiting object. TLEs are used with the SGP4/SDP4 propagators to predict satellite positions at future times.

Implementations§

Source§

impl Tle

Source

pub fn parse(line1: &str, line2: &str) -> TleResult<Self>

Parse a TLE from two lines.

§Arguments
  • line1 - First line of the TLE (69 characters)
  • line2 - Second line of the TLE (69 characters)
§Returns
  • Ok(Tle) - Successfully parsed TLE
  • Err(TleError) - Parsing failed
Source

pub fn parse_3le(_name: &str, line1: &str, line2: &str) -> TleResult<Self>

Parse a TLE from three lines (name + two TLE lines).

§Arguments
  • name - Satellite name (ignored)
  • line1 - First line of the TLE
  • line2 - Second line of the TLE
Source

pub fn line1(&self) -> &str

Get the raw TLE line 1.

Source

pub fn line2(&self) -> &str

Get the raw TLE line 2.

Source

pub fn catalog_number(&self) -> &str

Get the NORAD catalog number.

Source

pub fn classification(&self) -> char

Get the security classification.

Source

pub fn international_designator(&self) -> &str

Get the international designator.

Source

pub fn epoch(&self) -> DateTime<Utc>

Get the TLE epoch.

Source

pub fn mean_motion_dot(&self) -> f64

Get the first derivative of mean motion (rev/day²).

Source

pub fn mean_motion_double_dot(&self) -> f64

Get the second derivative of mean motion (rev/day³).

Source

pub fn bstar(&self) -> f64

Get the BSTAR drag coefficient.

Source

pub fn ephemeris_type(&self) -> u8

Get the ephemeris type.

Source

pub fn element_set_number(&self) -> u32

Get the element set number.

Source

pub fn inclination_deg(&self) -> f64

Get the orbital inclination in degrees.

Source

pub fn raan_deg(&self) -> f64

Get the Right Ascension of Ascending Node in degrees.

Source

pub fn eccentricity(&self) -> f64

Get the orbital eccentricity.

Source

pub fn arg_perigee_deg(&self) -> f64

Get the argument of perigee in degrees.

Source

pub fn mean_anomaly_deg(&self) -> f64

Get the mean anomaly at epoch in degrees.

Source

pub fn mean_motion(&self) -> f64

Get the mean motion in revolutions per day.

Source

pub fn rev_number(&self) -> u32

Get the revolution number at epoch.

Source

pub fn period_minutes(&self) -> f64

Get the orbital period in minutes.

Source

pub fn period_seconds(&self) -> f64

Get the orbital period in seconds.

Source

pub fn propagate(&self, epoch: &DateTime<Utc>) -> TleResult<TEMEState>

Propagate the TLE to a specific epoch using SGP4.

Returns the satellite state in the TEME (True Equator Mean Equinox) frame.

§Arguments
  • epoch - Target epoch for propagation
§Returns
  • Ok(TEMEState) - Position and velocity in TEME frame
  • Err(TleError) - Propagation failed
Source

pub fn propagate_minutes(&self, minutes: f64) -> TleResult<TEMEState>

Propagate the TLE by a number of minutes from the TLE epoch.

§Arguments
  • minutes - Minutes since TLE epoch (can be negative)
Source

pub fn get_rv_at_time( &self, epoch: &DateTime<Utc>, ) -> TleResult<((f64, f64, f64), (f64, f64, f64))>

Get position and velocity at a specific epoch.

Returns ((x, y, z), (vx, vy, vz)) in km and km/s.

Source

pub fn minutes_since_epoch(&self, target: &DateTime<Utc>) -> f64

Calculate minutes since TLE epoch.

Source

pub fn accuracy_warning(&self, epoch: &DateTime<Utc>) -> u8

Check if propagation to a given epoch is likely to be accurate.

TLEs are typically valid for a few days before/after their epoch. This function returns a warning level based on the time difference.

§Returns
  • 0 - Within ±1 day (good accuracy)
  • 1 - Within ±3 days (acceptable)
  • 2 - Within ±7 days (degraded)
  • 3 - Beyond ±7 days (poor accuracy)

Trait Implementations§

Source§

impl Clone for Tle

Source§

fn clone(&self) -> Tle

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Tle

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Tle

§

impl RefUnwindSafe for Tle

§

impl Send for Tle

§

impl Sync for Tle

§

impl Unpin for Tle

§

impl UnwindSafe for Tle

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.