astro_time_t

Struct astro_time_t 

Source
#[repr(C)]
pub struct astro_time_t { pub ut: f64, pub tt: f64, pub psi: f64, pub eps: f64, pub st: f64, }
Expand description

@brief A date and time used for astronomical calculations.

This type is of fundamental importance to Astronomy Engine. It is used to represent dates and times for all astronomical calculations. It is also included in the values returned by many Astronomy Engine functions.

To create a valid astro_time_t value from scratch, call #Astronomy_MakeTime (for a given calendar date and time) or #Astronomy_CurrentTime (for the system’s current date and time).

To adjust an existing astro_time_t by a certain real number of days, call #Astronomy_AddDays.

The astro_time_t type contains ut to represent Universal Time (UT1/UTC) and tt to represent Terrestrial Time (TT, also known as ephemeris time). The difference tt-ut is known as ΔT, using a best-fit piecewise model devised by Espenak and Meeus.

Both tt and ut are necessary for performing different astronomical calculations. Indeed, certain calculations (such as rise/set times) require both time scales. See the documentation for the ut and tt fields for more detailed information.

In cases where astro_time_t is included in a structure returned by a function that can fail, the astro_status_t field status will contain a value other than ASTRO_SUCCESS; in that case the ut and tt will hold NAN (not a number). In general, when there is an error code stored in a struct field status, the caller should ignore all other values in that structure, including the ut and tt inside astro_time_t.

Fields§

§ut: f64

@brief UT1/UTC number of days since noon on January 1, 2000.

The floating point number of days of Universal Time since noon UTC January 1, 2000. Astronomy Engine approximates UTC and UT1 as being the same thing, although they are not exactly equivalent; UTC and UT1 can disagree by up to ±0.9 seconds. This approximation is sufficient for the accuracy requirements of Astronomy Engine.

Universal Time Coordinate (UTC) is the international standard for legal and civil timekeeping and replaces the older Greenwich Mean Time (GMT) standard. UTC is kept in sync with unpredictable observed changes in the Earth’s rotation by occasionally adding leap seconds as needed.

UT1 is an idealized time scale based on observed rotation of the Earth, which gradually slows down in an unpredictable way over time, due to tidal drag by the Moon and Sun, large scale weather events like hurricanes, and internal seismic and convection effects. Conceptually, UT1 drifts from atomic time continuously and erratically, whereas UTC is adjusted by a scheduled whole number of leap seconds as needed.

The value in ut is appropriate for any calculation involving the Earth’s rotation, such as calculating rise/set times, culumination, and anything involving apparent sidereal time.

Before the era of atomic timekeeping, days based on the Earth’s rotation were often known as mean solar days.

§tt: f64

@brief Terrestrial Time days since noon on January 1, 2000.

Terrestrial Time is an atomic time scale defined as a number of days since noon on January 1, 2000. In this system, days are not based on Earth rotations, but instead by the number of elapsed SI seconds divided by 86400. Unlike ut, tt increases uniformly without adjustments for changes in the Earth’s rotation.

The value in tt is used for calculations of movements not involving the Earth’s rotation, such as the orbits of planets around the Sun, or the Moon around the Earth.

Historically, Terrestrial Time has also been known by the term Ephemeris Time (ET).

§psi: f64

@brief For internal use only. Used to optimize Earth tilt calculations.

§eps: f64

@brief For internal use only. Used to optimize Earth tilt calculations.

§st: f64

@brief For internal use only. Lazy-caches sidereal time (Earth rotation).

Trait Implementations§

Source§

impl Clone for astro_time_t

Source§

fn clone(&self) -> astro_time_t

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for astro_time_t

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Copy for astro_time_t

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.