Struct nyx_space::time::Epoch [−][src]
pub struct Epoch(_);
Expand description
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
Initialize an Epoch from the provided TAI seconds since 1900 January 01 at midnight
Initialize an Epoch from the provided TAI days since 1900 January 01 at midnight
Initialize an Epoch from the provided TT seconds (approximated to 32.184s delta from TAI)
Initialize from Dynamic Barycentric Time (TDB) (same as SPICE ephemeris time) whose epoch is 2000 JAN 01 noon TAI
Initialize from Dynamic Barycentric Time (TDB) (same as SPICE ephemeris time) in JD days
Attempts to build an Epoch from the provided Gregorian date and time in TAI.
Attempts to build an Epoch from the provided Gregorian date and time in the provided time system.
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_hms(
year: i32,
month: u8,
day: u8,
hour: u8,
minute: u8,
second: u8
) -> Epoch
[src]Attempts to build an Epoch from the provided Gregorian date and time in UTC.
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_hms(
year: i32,
month: u8,
day: u8,
hour: u8,
minute: u8,
second: u8
) -> Epoch
[src]Returns this time in a Duration past J1900 counted in TAI
Returns the epoch as a floating point value in the provided unit
Returns the number of UTC seconds since the TAI epoch
Returns the number of UTC seconds since the TAI epoch
Returns the number of UTC days since the TAI epoch
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.
Returns the Modified Julian Date in seconds TAI.
Returns the Modified Julian Date in days UTC.
Returns the Modified Julian Date in the provided unit in UTC.
Returns the Modified Julian Date in seconds UTC.
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.
Returns the Julian seconds in TAI.
Returns the Julian days in UTC.
Returns the Julian seconds in UTC.
Returns seconds past TAI epoch in Terrestrial Time (TT) (previously called Terrestrial Dynamical Time (TDT))
Returns days past TAI epoch in Terrestrial Time (TT) (previously called Terrestrial Dynamical Time (TDT))
Returns the centuries pased J2000 TT
Returns the duration past J2000 TT
Returns days past Julian epoch in Terrestrial Time (TT) (previously called Terrestrial Dynamical Time (TDT))
Returns days past Modified Julian epoch in Terrestrial Time (TT) (previously called Terrestrial Dynamical Time (TDT))
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).
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).
Returns the Ephemeris Time seconds past epoch
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)
Returns the Ephemeris Time JDE past epoch
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)
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() );
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());
Converts the Epoch to UTC Gregorian in the ISO8601 format.
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);
Converts the Epoch to TAI Gregorian in the ISO8601 format with “ TAI“ appended to the string
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
Performs the +=
operation. Read more
Performs the +=
operation. Read more
pub fn deserialize<D>(
deserializer: D
) -> Result<Epoch, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
[src]
pub fn deserialize<D>(
deserializer: D
) -> Result<Epoch, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
[src]Deserialize this value from the given Serde deserializer. Read more
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());
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Performs the -=
operation. Read more
Performs the -=
operation. Read more
Auto Trait Implementations
impl RefUnwindSafe for Epoch
impl UnwindSafe for Epoch
Blanket Implementations
Mutably borrows from an owned value. Read more
type Output = T
type Output = T
Should always be Self
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
pub fn is_in_subset(&self) -> bool
pub fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
pub fn to_subset_unchecked(&self) -> SS
pub fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
pub fn from_subset(element: &SS) -> SP
pub fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.
pub fn vzip(self) -> V