-
Notifications
You must be signed in to change notification settings - Fork 101
Clock Corrections and Timescales in PINT
Clock corrections and timescale conversions in PINT are handled by a combination of astropy Time objects (and its built in timescale transformation capabilities) and (currently) TEMPO-style clock correction files stored in pint/datafiles
.
Here we walk through the transformations and how they happen for a typical TOA read from a .tim file.
TOA times read from TOA (.tim) files are assumed to be in the UTC timescale, referenced to an observatory clock (often a GPS-disciplined rubidium clock). This timescale is denoted UTC(obs), where obs is the name of the observatory [2]. The MJD representation used in these files is the pulsar_mjd
, as described below.
People from the precise timing community know well that using MJD format for UTC times is a bad idea. There is not a unique way to assign MJDs to times during days with leap seconds, and MJD1 - MJD2 does not correctly give the time interval between two times, because of possible leap seconds between MJD1 and MJD2 (this has been the source of incorrect results in the literature). Nevertheless, MJDs are commonly used for UTC times in many places. In pulsar timing, the MJD times in TOA (.tim) files are in the UTC time scale. PINT follows TEMPO and Tempo2 in defining a pulsar MJD (in pint called pulsar_mjd
) format, in which the integer part is the normal integer MJD and the fractional part is seconds_of_day/86400 [1]. The means that MJDs 'tick' at a constant rate, but there is no representation for a time during a leap second, so there is no way to have a TOA during that time.
- I think we need to look through PINT for Time inits with
format='mjd'
and make sure they are correct. Those may break on leap second days. They should probably all beformat='pulsar_mjd'
Given a UTC(obs), PINT applies clock corrections to convert to UTC(GPS). This can be done using either TEMPO or Tempo2 format clock files. The default is to use the set of TEMPO clock files distributed with PINT in pint/datafiles
. These correct UTC as measured by the observatory clock to the UTC(GPS) timescale from GPS.
A further correction can ben applied to convert UTC(GPS) to "UTC" (which I think means UTC(USNO), but this should be confirmed). This is done by default using the Tempo2-format gps2utc.clk file in pint/datafiles
. Those corrections are derived from BIPM Circular T. Whether this correction is applied is controlled by the include_gps
argument to pint.observatory.observatory.get_observatory()
.
[1] Note that some other codes (notably IAU SOFA and thus astropy) use seconds_of_day/86400 for non-leap-second days and seconds_of_day/86401 for days with a leap second. This makes MJDs 'tick' at a different rate on leap second days, but allows all times to have a representation. PINT code that writes TOA files needs to ensure it is using the pulsar_mjd
format for compatibility with the PINT, TEMPO and Tempo2 tim file readers.
[2] Note that this is not sufficient to distinguish between multiple instruments or backends at an observatory. In the past, this has been dealt with by making two different observatory names (e.g. ncy and ncyobs), which have the same position, but different clock correction files. PINT really should do this a better way.
[3] PINT really needs to support TCB as well as TDB, but this is not currently implemented.