ska-sa / astrokat

General observation framework for the MeerKAT telescope
BSD 2-Clause "Simplified" License
2 stars 4 forks source link

Fix Timestamp issue on driftscan #121

Closed spassmoor closed 6 months ago

spassmoor commented 6 months ago

This bug was raised in ticket #120

Adding an float to a ephem_date date object returns an float number of days from 1900 plus the float value. This when passed to a katpoint target object is interpreted as a unix epoch, number of seconds from 1970.
There are two bugs in the code :

  1. First the duration that is added is in seconds but when added to ephem_date is interperated as days.
  2. Second the result which is days is assumed to be unix epoch seconds.

This is fixed by first converting the ephem_date object to a katpoint.Timestamp object then adding the float number of seconds. Then using the to_ephem_date method of the katpoint.Timestamp to convert it back.