Skip to main content

EopData

Struct EopData 

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

Container for Earth/Body Orientation Parameters data.

  • On Earth this would enable time scale conversions to and from the UT1 time scale.
  • Earth Orientation Parameters data is available from: https://maia.usno.navy.mil/ser7/finals2000A.all

Implementations§

Source§

impl EopData

Source

pub fn data_from_reader<R: BufRead>( reader: R, format: EopFormat, separator: Separator, ) -> Result<Vec<EopDataRow>, DtErr>

Parse EOP data from any std::io::BufRead (file, network stream, etc.).

Lines starting with # or longer than [MAX_LINE_LEN] are skipped. The returned vector is always sorted by MJD.

Source

pub fn data_from_text_file<P: AsRef<Path>>( path: P, format: EopFormat, separator: Separator, ) -> Result<Vec<EopDataRow>, DtErr>

Returns a Vec of EopDataRow from a text file on disk.

§Examples
use deep_time::eop::{EopData, EopFormat, Separator};

let path = "finals.all.iau2000.txt";
let rows = EopData::data_from_text_file(path, EopFormat::Finals2000A, Separator::Whitespace).unwrap();
§See also
Source

pub fn from_text_file<P: AsRef<Path>>( path: P, format: EopFormat, separator: Separator, ) -> Result<Self, DtErr>

Create an EopData by loading from a text file on disk.

§Examples
use deep_time::eop::{EopData, EopFormat, Separator};

let path = "finals.all.iau2000.txt";
let provider = EopData::from_text_file(path, EopFormat::Finals2000A, Separator::Whitespace).unwrap();
Source§

impl EopData

Source

pub const MAX_LINE_LEN: usize = 8192

Source

pub fn data_from_str( s: &str, format: EopFormat, separator: Separator, ) -> Result<Vec<EopDataRow>, DtErr>

Parse EOP data from a &str.

Useful when the data is already in memory (embedded resource, downloaded string, etc.).

Source

pub fn data_from_bytes( bytes: &[u8], format: EopFormat, separator: Separator, ) -> Result<Vec<EopDataRow>, DtErr>

Parse EOP data from raw bytes.

The bytes are interpreted as UTF-8. Invalid UTF-8 sequences result in an empty string (and therefore an error).

Source

pub fn from_str( s: &str, format: EopFormat, separator: Separator, ) -> Result<Self, DtErr>

Create an EopData from a string slice.

Source

pub fn from_bytes( bytes: &[u8], format: EopFormat, separator: Separator, ) -> Result<Self, DtErr>

Create an EopData from raw bytes.

Source

pub fn eop_offset(&self, mjd: Real) -> Option<EopOffset>

Returns all interpolated orientation parameters (offset + polar motion) at the given MJD.

Returns None if the table is empty or the MJD is completely outside the loaded data.

Trait Implementations§

Source§

impl Clone for EopData

Source§

fn clone(&self) -> EopData

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for EopData

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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.
Source§

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more