1 from __future__
import division, absolute_import
7 __all__ = [
"daySecFromDate",
"dateFromSecInDay",
"secInDayFromDate"]
9 _HalfDaySec = RO.PhysConst.SecPerDay / 2.0
12 """!Convert a TAI date (MJD, seconds) to (days, seconds in the day)
14 fracDays = date / RO.PhysConst.SecPerDay
16 sec = (fracDays - day) * RO.PhysConst.SecPerDay
20 """!Convert a date to seconds in the day (losing day information)
22 A convenience wrapper around daySecFromDate, since we rarely care about the day
23 (the main use case is computing seconds in the day for the old axis controller interface).
28 """!Convert TAI seconds in the day to a full TAI date (MJD, seconds)
33 if secInDay > currSecInDay + _HalfDaySec:
35 elif secInDay < currSecInDay - _HalfDaySec:
39 return secInDay + (actDay * RO.PhysConst.SecPerDay)
def daySecFromDate
Convert a TAI date (MJD, seconds) to (days, seconds in the day)
def secInDayFromDate
Convert a date to seconds in the day (losing day information)
def dateFromSecInDay
Convert TAI seconds in the day to a full TAI date (MJD, seconds)