Skip to content

Time

caldate_to_jd(year, month, day, hour=0, minute=0, second=0.0)

Convert a calendar date to Julian Date.

Parameters:

Name Type Description Default
year ArrayLike

Year of the calendar date.

required
month ArrayLike

Month of the calendar date.

required
day ArrayLike

Day of the calendar date.

required
hour ArrayLike

Hour of the calendar date. Default: 0

0
minute ArrayLike

Minute of the calendar date. Default: 0

0
second ArrayLike

Second of the calendar date. Default: 0.0

0.0

Returns:

Type Description
Array

Julian Date.

References:

1. Montenbruck, O., & Gill, E. (2012). *Satellite Orbits: Models, Methods and Applications*. Springer Science & Business Media.

caldate_to_mjd(year, month, day, hour=0, minute=0, second=0.0)

Convert a calendar date to Modified Julian Date. Algorithm is only valid from year 1583 onward.

Parameters:

Name Type Description Default
year ArrayLike

Year of the calendar date.

required
month ArrayLike

Month of the calendar date.

required
day ArrayLike

Day of the calendar date.

required
hour ArrayLike

Hour of the calendar date. Default: 0

0
minute ArrayLike

Minute of the calendar date. Default: 0

0
second ArrayLike

Second of the calendar date. Default: 0.0

0.0

Returns:

Type Description
Array

Modified Julian Date.

References:

1. Montenbruck, O., & Gill, E. (2012). *Satellite Orbits: Models, Methods and Applications*. Springer Science & Business Media.

jd_to_caldate(jd)

Convert Julian Date to calendar date.

Uses the algorithm from Montenbruck & Gill for Gregorian calendar dates.

Parameters:

Name Type Description Default
jd ArrayLike

Julian Date.

required

Returns:

Type Description
tuple[Array, Array, Array, Array, Array, Array]

tuple[jax.Array, ...]: (year, month, day, hour, minute, second) where year/month/day/hour/minute are int32 and second is configurable float dtype.

References:

1. O. Montenbruck, and E. Gill, *Satellite Orbits: Models, Methods and
   Applications*, 2012, p. 322.

jd_to_mjd(jd)

Convert Julian Date to Modified Julian Date.

Parameters:

Name Type Description Default
jd ArrayLike

Julian Date.

required

Returns:

Type Description
Array

Modified Julian Date.

References:

1. Montenbruck, O., & Gill, E. (2012). *Satellite Orbits: Models, Methods and Applications*. Springer Science & Business Media.

leap_seconds_tai_utc(mjd)

Return TAI-UTC (cumulative leap seconds) for a given MJD.

Uses a hardcoded step-function lookup table covering 1972-01-01 through 2017-01-01. For dates before 1972, returns 10.0; for dates after the last entry, returns the most recent value (37.0).

JIT-compatible: uses jnp.searchsorted for O(log n) lookup.

Parameters:

Name Type Description Default
mjd ArrayLike

Modified Julian Date (UTC), scalar or array.

required

Returns:

Type Description
Array

TAI-UTC in seconds.

mjd_to_caldate(mjd)

Convert Modified Julian Date to calendar date.

Parameters:

Name Type Description Default
mjd ArrayLike

Modified Julian Date.

required

Returns:

Type Description
tuple[Array, Array, Array, Array, Array, Array]

tuple[jax.Array, ...]: (year, month, day, hour, minute, second) where year/month/day/hour/minute are int32 and second is configurable float dtype.

References:

1. O. Montenbruck, and E. Gill, *Satellite Orbits: Models, Methods and
   Applications*, 2012.

mjd_to_jd(mjd)

Convert Modified Julian Date to Julian Date.

Parameters:

Name Type Description Default
mjd ArrayLike

Modified Julian Date.

required

Returns:

Type Description
Array

Julian Date.

References:

1. Montenbruck, O., & Gill, E. (2012). *Satellite Orbits: Models, Methods and Applications*. Springer Science & Business Media.