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
impl EopData
Sourcepub fn data_from_reader<R: BufRead>(
reader: R,
format: EopFormat,
separator: Separator,
) -> Result<Vec<EopDataRow>, DtErr>
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.
Sourcepub fn data_from_text_file<P: AsRef<Path>>(
path: P,
format: EopFormat,
separator: Separator,
) -> Result<Vec<EopDataRow>, DtErr>
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§impl EopData
impl EopData
pub const MAX_LINE_LEN: usize = 8192
Sourcepub fn data_from_str(
s: &str,
format: EopFormat,
separator: Separator,
) -> Result<Vec<EopDataRow>, DtErr>
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.).
Sourcepub fn data_from_bytes(
bytes: &[u8],
format: EopFormat,
separator: Separator,
) -> Result<Vec<EopDataRow>, DtErr>
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).
Sourcepub fn from_str(
s: &str,
format: EopFormat,
separator: Separator,
) -> Result<Self, DtErr>
pub fn from_str( s: &str, format: EopFormat, separator: Separator, ) -> Result<Self, DtErr>
Create an EopData from a string slice.
Sourcepub fn from_bytes(
bytes: &[u8],
format: EopFormat,
separator: Separator,
) -> Result<Self, DtErr>
pub fn from_bytes( bytes: &[u8], format: EopFormat, separator: Separator, ) -> Result<Self, DtErr>
Create an EopData from raw bytes.
Sourcepub fn eop_offset(&self, mjd: Real) -> Option<EopOffset>
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.