Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ API Changes

- ``astropy.time``

- Correct use of UT in TDB calculation [#1938, #1939].

- ``astropy.units``

- ``Quantity`` now converts input to float by default, as this is
Expand Down
9 changes: 5 additions & 4 deletions astropy/time/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -810,12 +810,13 @@ def _get_delta_tdb_tt(self, jd1=None, jd2=None):
jd2 = self._time.jd2

# First go from the current input time (which is either
# TDB or TT) to an approximate UTC. Since TT and TDB are
# pretty close (few msec?), assume TT.
# TDB or TT) to an approximate UT1. Since TT and TDB are
# pretty close (few msec?), assume TT. Similarly, since the
# UT1 terms are very small, use UTC instead of UT1.
njd1, njd2 = erfa_time.tt_tai(jd1, jd2)
njd1, njd2 = erfa_time.tai_utc(njd1, njd2)
# TODO: actually need to go to UT1 which needs DUT.
ut = njd1 + njd2
# subtract 0.5, so UT is fraction of the day from midnight
ut = day_frac(njd1 - 0.5, njd2)[1]

# Compute geodetic params needed for d_tdb_tt()
elon = 0. if self.lon is None else self.lon.to(u.radian).value
Expand Down
4 changes: 2 additions & 2 deletions astropy/time/tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ def test_transforms(self):
assert t.tai.iso == '2006-01-15 21:25:10.500000'
assert t.tt.iso == '2006-01-15 21:25:42.684000'
assert t.tcg.iso == '2006-01-15 21:25:43.322690'
assert t.tdb.iso == '2006-01-15 21:25:42.684372'
assert t.tcb.iso == '2006-01-15 21:25:56.893951'
assert t.tdb.iso == '2006-01-15 21:25:42.684373'
assert t.tcb.iso == '2006-01-15 21:25:56.893952'

def test_creating_all_formats(self):
"""Create a time object using each defined format"""
Expand Down
4 changes: 2 additions & 2 deletions docs/time/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -572,9 +572,9 @@ TT, UT1, UTC). This requires auxilliary information (latitude and longitude).
>>> t.tcg.iso
'2006-01-15 21:25:43.322690'
>>> t.tdb.iso
'2006-01-15 21:25:42.684372'
'2006-01-15 21:25:42.684373'
>>> t.tcb.iso
'2006-01-15 21:25:56.893951'
'2006-01-15 21:25:56.893952'

Sidereal Time
-------------
Expand Down