[−][src]Struct nyx_space::time::Epoch
Defines an Epoch in TAI (temps atomique international) in seconds past 1900 January 01 at midnight (like the Network Time Protocol).
Refer to the appropriate functions for initializing this Epoch from different time systems or representations.
Implementations
impl Epoch
[src]
pub fn from_tai_seconds(seconds: f64) -> Epoch
[src]
Initialize an Epoch from the provided TAI seconds since 1900 January 01 at midnight
pub fn from_tai_days(days: f64) -> Epoch
[src]
Initialize an Epoch from the provided TAI days since 1900 January 01 at midnight
pub fn from_mjd_tai(days: f64) -> Epoch
[src]
pub fn from_jde_tai(days: f64) -> Epoch
[src]
pub fn from_tt_seconds(seconds: f64) -> Epoch
[src]
Initialize an Epoch from the provided TT seconds (approximated to 32.184s delta from TAI)
pub fn from_et_seconds(seconds: f64) -> Epoch
[src]
pub fn from_tdb_seconds(seconds: f64) -> Epoch
[src]
Initialize from Dynamic Barycentric Time (TDB) (same as SPICE ephemeris time) whose epoch is 2000 JAN 01 noon TAI
pub fn from_jde_et(days: f64) -> Epoch
[src]
pub fn from_jde_tdb(days: f64) -> Epoch
[src]
Initialize from Dynamic Barycentric Time (TDB) (same as SPICE ephemeris time) in JD days
pub fn maybe_from_gregorian_tai(
year: i32,
month: u8,
day: u8,
hour: u8,
minute: u8,
second: u8,
nanos: u32
) -> Result<Epoch, Errors>
[src]
year: i32,
month: u8,
day: u8,
hour: u8,
minute: u8,
second: u8,
nanos: u32
) -> Result<Epoch, Errors>
Attempts to build an Epoch from the provided Gregorian date and time in TAI.
pub fn maybe_from_gregorian(
year: i32,
month: u8,
day: u8,
hour: u8,
minute: u8,
second: u8,
nanos: u32,
ts: TimeSystem
) -> Result<Epoch, Errors>
[src]
year: i32,
month: u8,
day: u8,
hour: u8,
minute: u8,
second: u8,
nanos: u32,
ts: TimeSystem
) -> Result<Epoch, Errors>
Attempts to build an Epoch from the provided Gregorian date and time in the provided time system.
pub fn from_gregorian_tai(
year: i32,
month: u8,
day: u8,
hour: u8,
minute: u8,
second: u8,
nanos: u32
) -> Epoch
[src]
year: i32,
month: u8,
day: u8,
hour: u8,
minute: u8,
second: u8,
nanos: u32
) -> Epoch
Builds an Epoch from the provided Gregorian date and time in TAI. If invalid date is provided, this function will panic. Use maybe_from_gregorian_tai if unsure.
pub fn from_gregorian_tai_at_midnight(year: i32, month: u8, day: u8) -> Epoch
[src]
pub fn from_gregorian_tai_at_noon(year: i32, month: u8, day: u8) -> Epoch
[src]
pub fn from_gregorian_tai_hms(
year: i32,
month: u8,
day: u8,
hour: u8,
minute: u8,
second: u8
) -> Epoch
[src]
year: i32,
month: u8,
day: u8,
hour: u8,
minute: u8,
second: u8
) -> Epoch
pub fn maybe_from_gregorian_utc(
year: i32,
month: u8,
day: u8,
hour: u8,
minute: u8,
second: u8,
nanos: u32
) -> Result<Epoch, Errors>
[src]
year: i32,
month: u8,
day: u8,
hour: u8,
minute: u8,
second: u8,
nanos: u32
) -> Result<Epoch, Errors>
Attempts to build an Epoch from the provided Gregorian date and time in UTC.
pub fn from_gregorian_utc(
year: i32,
month: u8,
day: u8,
hour: u8,
minute: u8,
second: u8,
nanos: u32
) -> Epoch
[src]
year: i32,
month: u8,
day: u8,
hour: u8,
minute: u8,
second: u8,
nanos: u32
) -> Epoch
Builds an Epoch from the provided Gregorian date and time in TAI. If invalid date is provided, this function will panic. Use maybe_from_gregorian_tai if unsure.
pub fn from_gregorian_utc_at_midnight(year: i32, month: u8, day: u8) -> Epoch
[src]
pub fn from_gregorian_utc_at_noon(year: i32, month: u8, day: u8) -> Epoch
[src]
pub fn from_gregorian_utc_hms(
year: i32,
month: u8,
day: u8,
hour: u8,
minute: u8,
second: u8
) -> Epoch
[src]
year: i32,
month: u8,
day: u8,
hour: u8,
minute: u8,
second: u8
) -> Epoch
pub fn as_tai_seconds(self) -> f64
[src]
pub fn as_tai_days(self) -> f64
[src]
pub fn as_utc_seconds(self) -> f64
[src]
Returns the number of UTC seconds since the TAI epoch
pub fn as_utc_days(self) -> f64
[src]
pub fn as_mjd_tai_days(self) -> f64
[src]
as_mjd_days
creates an Epoch from the provided Modified Julian Date in days as explained
here. MJD epoch is Modified Julian Day at 17 November 1858 at midnight.
pub fn as_mjd_utc_days(self) -> f64
[src]
Returns the Modified Julian Date in days UTC.
pub fn as_mjd_tai_seconds(self) -> f64
[src]
Returns the Modified Julian Date in seconds TAI.
pub fn as_mjd_utc_seconds(self) -> f64
[src]
Returns the Modified Julian Date in seconds UTC.
pub fn as_jde_tai_days(self) -> f64
[src]
Returns the Julian days from epoch 01 Jan -4713, 12:00 (noon) as explained in "Fundamentals of astrodynamics and applications", Vallado et al. 4th edition, page 182, and on Wikipedia.
pub fn as_jde_tai_seconds(self) -> f64
[src]
Returns the Julian seconds in TAI.
pub fn as_jde_utc_days(self) -> f64
[src]
Returns the Julian days in UTC.
pub fn as_jde_utc_seconds(self) -> f64
[src]
Returns the Julian seconds in UTC.
pub fn as_tt_seconds(self) -> f64
[src]
Returns seconds past TAI epoch in Terrestrial Time (TT) (previously called Terrestrial Dynamical Time (TDT))
pub fn as_tt_days(self) -> f64
[src]
Returns days past TAI epoch in Terrestrial Time (TT) (previously called Terrestrial Dynamical Time (TDT))
pub fn as_tt_centuries_j2k(self) -> f64
[src]
Returns the centuries pased J2000 TT
pub fn as_jde_tt_days(self) -> f64
[src]
Returns days past Julian epoch in Terrestrial Time (TT) (previously called Terrestrial Dynamical Time (TDT))
pub fn as_mjd_tt_days(self) -> f64
[src]
Returns days past Modified Julian epoch in Terrestrial Time (TT) (previously called Terrestrial Dynamical Time (TDT))
pub fn as_gpst_seconds(self) -> f64
[src]
Returns seconds past GPS Time Epoch, defined as UTC midnight of January 5th to 6th 1980 (cf. https://gssc.esa.int/navipedia/index.php/Time_References_in_GNSS#GPS_Time_.28GPST.29).
pub fn as_gpst_days(self) -> f64
[src]
Returns days past GPS Time Epoch, defined as UTC midnight of January 5th to 6th 1980 (cf. https://gssc.esa.int/navipedia/index.php/Time_References_in_GNSS#GPS_Time_.28GPST.29).
pub fn as_et_seconds(self) -> f64
[src]
Returns the Ephemeris Time seconds past epoch
pub fn as_tdb_seconds(self) -> f64
[src]
Returns the Dynamic Barycentric Time (TDB) (higher fidelity SPICE ephemeris time) whose epoch is 2000 JAN 01 noon TAI (cf. https://gssc.esa.int/navipedia/index.php/Transformations_between_Time_Systems#TDT_-_TDB.2C_TCB)
pub fn as_jde_et_days(self) -> f64
[src]
Returns the Ephemeris Time JDE past epoch
pub fn as_jde_tdb_days(self) -> f64
[src]
Returns the Dynamic Barycentric Time (TDB) (higher fidelity SPICE ephemeris time) whose epoch is 2000 JAN 01 noon TAI (cf. https://gssc.esa.int/navipedia/index.php/Transformations_between_Time_Systems#TDT_-_TDB.2C_TCB)
pub fn mut_add_days(&mut self, days: f64)
[src]
Increment this epoch by the number of days provided.
pub fn mut_add_secs(&mut self, seconds: f64)
[src]
Increment this epoch by the number of days provided.
pub fn mut_sub_days(&mut self, days: f64)
[src]
Decrement this epoch by the number of days provided.
pub fn mut_sub_secs(&mut self, seconds: f64)
[src]
Decrement this epoch by the number of days provided.
pub fn from_gregorian_str(s: &str) -> Result<Epoch, Errors>
[src]
Converts an ISO8601 Datetime representation without timezone offset to an Epoch.
If no time system is specified, than UTC is assumed.
The T
which separates the date from the time can be replaced with a single whitespace character (\W
).
The offset is also optional, cf. the examples below.
Example
use hifitime::Epoch; let dt = Epoch::from_gregorian_utc(2017, 1, 14, 0, 31, 55, 0); assert_eq!( dt, Epoch::from_gregorian_str("2017-01-14T00:31:55 UTC").unwrap() ); assert_eq!( dt, Epoch::from_gregorian_str("2017-01-14T00:31:55.0000 UTC").unwrap() ); assert_eq!( dt, Epoch::from_gregorian_str("2017-01-14T00:31:55").unwrap() ); assert_eq!( dt, Epoch::from_gregorian_str("2017-01-14 00:31:55").unwrap() );
pub fn as_gregorian_utc(self) -> (i32, u8, u8, u8, u8, u8, u32)
[src]
Converts the Epoch to the Gregorian UTC equivalent as (year, month, day, hour, minute, second). WARNING: Nanoseconds are lost in this conversion!
Example
use hifitime::Epoch; let dt_str = "2017-01-14T00:31:55 UTC"; let dt = Epoch::from_gregorian_str(dt_str).unwrap(); let (y, m, d, h, min, s, _) = dt.as_gregorian_utc(); assert_eq!(y, 2017); assert_eq!(m, 1); assert_eq!(d, 14); assert_eq!(h, 0); assert_eq!(min, 31); assert_eq!(s, 55); assert_eq!(dt_str, dt.as_gregorian_utc_str().to_owned());
pub fn as_gregorian_utc_str(self) -> String
[src]
Converts the Epoch to UTC Gregorian in the ISO8601 format.
pub fn as_gregorian_tai(self) -> (i32, u8, u8, u8, u8, u8, u32)
[src]
Converts the Epoch to the Gregorian TAI equivalent as (year, month, day, hour, minute, second). WARNING: Nanoseconds are lost in this conversion!
Example
use hifitime::Epoch; let dt = Epoch::from_gregorian_tai_at_midnight(1972, 1, 1); let (y, m, d, h, min, s, _) = dt.as_gregorian_tai(); assert_eq!(y, 1972); assert_eq!(m, 1); assert_eq!(d, 1); assert_eq!(h, 0); assert_eq!(min, 0); assert_eq!(s, 0);
pub fn as_gregorian_utc_tai(self) -> String
[src]
Use as_gregorian_tai_str() instead; this function was a typo
pub fn as_gregorian_tai_str(self) -> String
[src]
Converts the Epoch to TAI Gregorian in the ISO8601 format with " TAI" appended to the string
pub fn as_gregorian_str(self, ts: TimeSystem) -> String
[src]
Converts the Epoch to Gregorian in the provided time system and in the ISO8601 format with the time system appended to the string
Trait Implementations
impl Add<f64> for Epoch
[src]
type Output = Epoch
The resulting type after applying the +
operator.
fn add(self, seconds: f64) -> Epoch
[src]
impl Clone for Epoch
[src]
impl Copy for Epoch
[src]
impl Debug for Epoch
[src]
impl FromStr for Epoch
[src]
type Err = Errors
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Epoch, <Epoch as FromStr>::Err>
[src]
Attempts to convert a string to an Epoch.
Format identifiers: + JD: Julian days + MJD: Modified Julian days + SEC: Seconds past a given epoch (e.g. SEC 17.2 TAI is 17.2 seconds past TAI Epoch)
Example
use hifitime::Epoch; use std::str::FromStr; assert!(Epoch::from_str("JD 2452312.500372511 TDB").is_ok()); assert!(Epoch::from_str("JD 2452312.500372511 ET").is_ok()); assert!(Epoch::from_str("JD 2452312.500372511 TAI").is_ok()); assert!(Epoch::from_str("MJD 51544.5 TAI").is_ok()); assert!(Epoch::from_str("SEC 0.5 TAI").is_ok()); assert!(Epoch::from_str("SEC 66312032.18493909 TDB").is_ok());
impl PartialEq<Epoch> for Epoch
[src]
impl PartialOrd<Epoch> for Epoch
[src]
fn partial_cmp(&self, other: &Epoch) -> Option<Ordering>
[src]
fn lt(&self, other: &Epoch) -> bool
[src]
fn le(&self, other: &Epoch) -> bool
[src]
fn gt(&self, other: &Epoch) -> bool
[src]
fn ge(&self, other: &Epoch) -> bool
[src]
impl StructuralPartialEq for Epoch
[src]
impl Sub<Epoch> for Epoch
[src]
type Output = f64
The resulting type after applying the -
operator.
fn sub(self, other: Epoch) -> f64
[src]
impl Sub<f64> for Epoch
[src]
Auto Trait Implementations
impl RefUnwindSafe for Epoch
impl Send for Epoch
impl Sync for Epoch
impl Unpin for Epoch
impl UnwindSafe for Epoch
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> Scalar for T where
T: PartialEq<T> + Copy + Any + Debug,
[src]
T: PartialEq<T> + Copy + Any + Debug,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn is_in_subset(&self) -> bool
unsafe fn to_subset_unchecked(&self) -> SS
fn from_subset(element: &SS) -> SP
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,