pub struct ModifiedJulian {
    pub days: f64,
}
Expand description

ModifiedJulian handles the Modified Julian Days as explained here.

Fields

days: f64

Implementations

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.

Returns the centuries since J2000. This number is often referred to as JD_tt.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

The formatter will show six digits of precision. This allows for a resolution of about 0.864 seconds.

Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
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
This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

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.

into_instant returns an Instant from the ModifiedJulian.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.