Astro v0.1.0 Astro.Time View Source
Calculations converting between geometry and time
All public functions use degrees as their input parameters
Time is a fraction of a day after UTC
Link to this section Summary
Functions
Returns the number of seconds since 0001-01-01
in the Gregorian calendar.
Returns the Julian centuries for a given Julian day
Returns the astronomical Julian day for a given date
Returns the Julian day for a given Julian century
Returns the modified Julian day for a date
Converts a float number of hours since midnight to
a DateTime.t()
Converts a float number of hourse
since midnight into {hours, minutes, seconds}
.
Link to this section Functions
Returns the number of seconds since 0001-01-01
in the Gregorian calendar.
Arguments
datetime
is anyDateTime.t
since0001-01-01
in theCalendar.ISO
calendar
Returns
- An integer number of seconds since
0001-01-01
Returns the Julian centuries for a given Julian day
Arguments
julian_day
is any astronomical Julian day such as returned fromAstro.Time.julian_day_from_date/1
Returns
- the astronomical Julian century as a
float
Returns the astronomical Julian day for a given date
Arguments
date
is anyCalendar.date
Returns
- the astronomical Julian day as a
float
Returns the Julian day for a given Julian century
Arguments
julian_century
is any astronomical Julian century such as returned fromAstro.Time.julian_centuries_from_julian_day/1
Returns
- the astronomical Julian day as a
float
Returns the modified Julian day for a date
Arguments
date
is anyCalendar.date
Returns
- the modified Julian day as a
float
Notes
A modified version of the Julian date denoted MJD is obtained by subtracting 2,400,000.5 days from the Julian date JD,
The MJD therefore gives the number of days since
midnight on November 17, 1858. This date corresponds
to 2400000.5
days after day 0 of the Julian calendar.
Converts a float number of hours since midnight to
a DateTime.t()
Arguments
time_of_day
is a float number of hours since midnightdate
is anyCalendar.date()
Returns
A DateTime.t()
combining the date
and time_of_day
in the UTC timezone.
Converts a float number of hourse
since midnight into {hours, minutes, seconds}
.
seconds
is forced to zero since the accuracy
of astronomical calculations doesn't extend to
seconds.
Arguments
time_of_day
is a float number of hours since midnight
Returns
- A
{hour, minute, second}
tuple.
Examples
iex> Astro.Time.to_hms 0.0 {0, 0, 0} iex> Astro.Time.to_hms 23.999 {23, 59, 0} iex> Astro.Time.to_hms 15.456 {15, 27, 0}