Struct hifitime::julian::ModifiedJulian
source · pub struct ModifiedJulian {
pub days: f64,
}
Expand description
ModifiedJulian
handles the Modified Julian Days as explained
here.
Fields
days: f64
Implementations
sourceimpl ModifiedJulian
impl ModifiedJulian
pub fn j2000() -> ModifiedJulian
sourcepub fn julian_days(self) -> f64
pub fn julian_days(self) -> f64
julian_days
returns the true Julian days from epoch 01 Jan -4713, 12:00
as explained in “Fundamentals of astrodynamics and applications”, Vallado et al.
4th edition, page 182, and on Wikipedia.
sourcepub fn centuries_since_j2000(self) -> f64
pub fn centuries_since_j2000(self) -> f64
Returns the centuries since J2000. This number is often referred to as JD_tt.
Trait Implementations
sourceimpl Clone for ModifiedJulian
impl Clone for ModifiedJulian
sourcefn clone(&self) -> ModifiedJulian
fn clone(&self) -> ModifiedJulian
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresourceimpl Debug for ModifiedJulian
impl Debug for ModifiedJulian
sourceimpl Display for ModifiedJulian
impl Display for ModifiedJulian
The formatter will show six digits of precision. This allows for a resolution of about 0.864 seconds.
sourceimpl PartialEq<ModifiedJulian> for ModifiedJulian
impl PartialEq<ModifiedJulian> for ModifiedJulian
sourcefn eq(&self, other: &ModifiedJulian) -> bool
fn eq(&self, other: &ModifiedJulian) -> bool
sourceimpl PartialOrd<ModifiedJulian> for ModifiedJulian
impl PartialOrd<ModifiedJulian> for ModifiedJulian
sourcefn partial_cmp(&self, other: &ModifiedJulian) -> Option<Ordering>
fn partial_cmp(&self, other: &ModifiedJulian) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresourceimpl TimeSystem for ModifiedJulian
impl TimeSystem for ModifiedJulian
sourcefn from_instant(instant: Instant) -> ModifiedJulian
fn from_instant(instant: Instant) -> ModifiedJulian
from_instant
converts an Instant
to a ModifiedJulian as detailed in Vallado et al.
4th edition, page 182.
Leap second source contains information pertinent to the NTP time definition, whose epoch is twelve hours ahead of the Julian Day. Here is the relevant quote:
The NTP timestamps are in units of seconds since the NTP epoch, which is 1 January 1900, 00:00:00. The Modified Julian Day number corresponding to the NTP time stamp, X, can be computed as
X/86400 + 15020
where the first term converts seconds to days and the second term adds the MJD corresponding to the time origin defined above. The integer portion of the result is the integer MJD for that day, and any remainder is the time of day, expressed as the fraction of the day since 0 hours UTC. The conversion from day fraction to seconds or to hours, minutes, and seconds may involve rounding or truncation, depending on the method used in the computation.
sourcefn into_instant(self) -> Instant
fn into_instant(self) -> Instant
into_instant
returns an Instant
from the ModifiedJulian.