to_julian_date#

to_julian_date(tivs, scale)#

Converts STARE temporal index values to two-part Julian Dates

from [Julian Day Wikipedia](https://en.wikipedia.org/wiki/Julian_day) “the Julian date (JD) of any instant is the Julian day number plus the fraction of a day since the preceding noon in Universal Time. Julian dates are expressed as a Julian day number with a decimal fraction added. For example, the Julian Date for 00:30:00.0 UT January 1, 2013, is 2 456 293.520 833.

Parameters:
tivs: 1D array-like

The STARE temporal index values to convert

scale: str. Either ‘tai’ or ‘utc

The timescale (or time standard)

Returns:
jd1: double

jd1+jd2 is Julian Date apportioned in any convenient

jd2: double

jd1+jd2 is Julian Date apportioned in any convenient

Examples

>>> tiv = numpy.array([2276038620410065089])
>>> pystare.to_julian_date(tiv, scale='tai')
(array([2459215.5]), array([237.71107206]))
>>> pystare.to_julian_date(tiv, scale='utc')
(array([2459215.5]), array([237.71064382]))
>>> import astropy.time
>>> timestamps = ['2021-09-26T17:16:46.426092', '2020-09-26T17:16:46.426092']
>>> t = astropy.time.Time(timestamps, format='isot')
>>> tivs = pystare.from_julian_date(t.jd1, t.jd2, scale='tai')
>>> jds = pystare.to_julian_date(tivs, scale='tai')
>>> t = astropy.time.Time(jds[0], jds[1], format='jd', scale='tai')
>>> t.isot
array(['2021-09-26T17:16:46.426', '2020-09-26T17:16:46.426'], dtype='<U23')