ska-sa / astrokat

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

Hotfix v30: Fix Timestamp issue on driftscan #122

Closed sipho-sarao closed 5 months ago

sipho-sarao commented 5 months ago

Hotfix v30: Fix Timestamp issue on driftscan

This is a hotfix branch for the Timestamp issue on driftscan. The following is from the code review of the issue:

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 :

First the duration that is added is in seconds but when added to ephem_date is interperated as days. 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.