Description
Upon construction, all Time objects contain two double-precision values, jd1 and jd2. These satisfy, and are tested to satisfy, the invariant that jd1 is an integer, abs(jd2)<=0.5, and if abs(jd2)==0.5 then jd1 is even. This is enforced by application of the not-publicly-documented function day_frac.
When a Time object is converted from one timescale to another, though, under some circumstances abs(jd2)>0.5.
>>> from astropy.time import Time
>>> t = Time(2441316.5, 0, scale='tai', format='jd')
>>> t.tcb.jd2
0.500344155968967
This was revealed by #9532 .
Expected behavior
t.tcb.jd2 should be made less than 0.5 by calling day_frac.
Actual behavior
The value violates the invariant.
System Details
$ python
Python 3.7.3 (default, Apr 3 2019, 05:39:12)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform; print(platform.platform())
Linux-5.0.0-31-generic-x86_64-with-Ubuntu-19.04-disco
>>> import sys; print("Python", sys.version)
Python 3.7.3 (default, Apr 3 2019, 05:39:12)
[GCC 8.3.0]
>>> import numpy; print("Numpy", numpy.__version__)
Numpy 1.17.1
>>> import scipy; print("Scipy", scipy.__version__)
Scipy 1.3.1
>>> import astropy; print("astropy", astropy.__version__)
astropy 4.0.dev26770
>>>
Description
Upon construction, all Time objects contain two double-precision values,
jd1andjd2. These satisfy, and are tested to satisfy, the invariant thatjd1is an integer,abs(jd2)<=0.5, and ifabs(jd2)==0.5thenjd1is even. This is enforced by application of the not-publicly-documented functionday_frac.When a Time object is converted from one timescale to another, though, under some circumstances
abs(jd2)>0.5.This was revealed by #9532 .
Expected behavior
t.tcb.jd2should be made less than 0.5 by callingday_frac.Actual behavior
The value violates the invariant.
System Details