Skip to content

d2dtf(), dtf2d(), utctai(), dat(): Inexact table and method of detecting jump #92

@mrhso

Description

@mrhso

The pre-1972 _changes are approximated to $10^{-7}\kern{3 mu}\text{s}$, leading to strange results.

Example (After #91 fixed)

>>> from astropy.time import Time, TimeDelta
>>> t = Time('1971-12-31 23:59:60.107757999', format = 'iso', scale = 'utc', precision = 9)
>>> t
<Time object: scale='utc' format='iso' value=1971-12-31 23:59:60.107757999>
>>> t.tai
<Time object: scale='tai' format='iso' value=1972-01-01 00:00:10.000000002>

In theory, it should be earlier than 1972-01-01 00:00:10, for 1972-01-01 00:00:00 UTC = 1972-01-01 00:00:10 TAI and the step was -0.1077580 s.

And the method of detecting jump is also inexact.

/* Separate TAI-UTC change into per-day (DLOD) and any jump (DLEAP). */
   dlod = 2.0 * (dat12 - dat0);
   dleap = dat24 - (dat0 + dlod);

The end of a day may not be 24:00:00 but 24:00:00+dleap.

So $\text{dleap}=\text{dat24}-\left(\text{dat0}+\dfrac{24\kern{3 mu}\text{h}+\text{dleap}}{24\kern{3 mu}\text{h}}\text{dlod}\right)$, that is, $\text{dleap}=\dfrac{\text{ERFA\_DAYSEC}}{\text{ERFA\_DAYSEC}+\text{dlod}}(\text{dat24}-(\text{dat0}+\text{dlod}))$.

Interestingly, this inexact method just matches $10^{-7}\kern{3 mu}\text{s}$ precision, dleap is calculated correctly (just a coincidence).

So the table _changes and the method of detecting jump may need to be modified at the same time.

Date TAI-UTC
1960-01-01 $\dfrac{70890899507113}{50000000000000}\kern{3 mu}\text{s}+\dfrac{81}{62500}\kern{3 mu}\text{s}\kern{3 mu}(\text{MJD}_\text{UTC literal}-37300)$
1961-01-01 $\dfrac{71140899510863}{50000000000000}\kern{3 mu}\text{s}+\dfrac{81}{62500}\kern{3 mu}\text{s}\kern{3 mu}(\text{MJD}_\text{UTC literal}-37300)$
1961-08-01 $\dfrac{68640899473363}{50000000000000}\kern{3 mu}\text{s}+\dfrac{81}{62500}\kern{3 mu}\text{s}\kern{3 mu}(\text{MJD}_\text{UTC literal}-37300)$
1962-01-01 $\dfrac{92292899473363}{50000000000000}\kern{3 mu}\text{s}+\dfrac{351}{312500}\kern{3 mu}\text{s}\kern{3 mu}(\text{MJD}_\text{UTC literal}-37665)$
1963-11-01 $\dfrac{97292899538363}{50000000000000}\kern{3 mu}\text{s}+\dfrac{351}{312500}\kern{3 mu}\text{s}\kern{3 mu}(\text{MJD}_\text{UTC literal}-37665)$
1964-01-01 $\dfrac{162006499538363}{50000000000000}\kern{3 mu}\text{s}+\dfrac{81}{62500}\kern{3 mu}\text{s}\kern{3 mu}(\text{MJD}_\text{UTC literal}-38761)$
1964-04-01 $\dfrac{167006499613363}{50000000000000}\kern{3 mu}\text{s}+\dfrac{81}{62500}\kern{3 mu}\text{s}\kern{3 mu}(\text{MJD}_\text{UTC literal}-38761)$
1964-09-01 $\dfrac{172006499688363}{50000000000000}\kern{3 mu}\text{s}+\dfrac{81}{62500}\kern{3 mu}\text{s}\kern{3 mu}(\text{MJD}_\text{UTC literal}-38761)$
1965-01-01 $\dfrac{177006499763363}{50000000000000}\kern{3 mu}\text{s}+\dfrac{81}{62500}\kern{3 mu}\text{s}\kern{3 mu}(\text{MJD}_\text{UTC literal}-38761)$
1965-03-01 $\dfrac{182006499838363}{50000000000000}\kern{3 mu}\text{s}+\dfrac{81}{62500}\kern{3 mu}\text{s}\kern{3 mu}(\text{MJD}_\text{UTC literal}-38761)$
1965-07-01 $\dfrac{187006499913363}{50000000000000}\kern{3 mu}\text{s}+\dfrac{81}{62500}\kern{3 mu}\text{s}\kern{3 mu}(\text{MJD}_\text{UTC literal}-38761)$
1965-09-01 $\dfrac{192006499988363}{50000000000000}\kern{3 mu}\text{s}+\dfrac{81}{62500}\kern{3 mu}\text{s}\kern{3 mu}(\text{MJD}_\text{UTC literal}-38761)$
1966-01-01 $\dfrac{215658499988363}{50000000000000}\kern{3 mu}\text{s}+\dfrac{81}{31250}\kern{3 mu}\text{s}\kern{3 mu}(\text{MJD}_\text{UTC literal}-39126)$
1968-02-01 $\dfrac{210658499838363}{50000000000000}\kern{3 mu}\text{s}+\dfrac{81}{31250}\kern{3 mu}\text{s}\kern{3 mu}(\text{MJD}_\text{UTC literal}-39126)$
/* Dates and Delta(AT)s */
   static const eraLEAPSECOND _changes[] = {
      { 1960,  1,  1.41781799014226 },
      { 1961,  1,  1.42281799021726 },
      { 1961,  8,  1.37281798946726 },
      { 1962,  1,  1.84585798946726 },
      { 1963, 11,  1.94585799076726 },
      { 1964,  1,  3.24012999076726 },
      { 1964,  4,  3.34012999226726 },
      { 1964,  9,  3.44012999376726 },
      { 1965,  1,  3.54012999526726 },
      { 1965,  3,  3.64012999676726 },
      { 1965,  7,  3.74012999826726 },
      { 1965,  9,  3.84012999976726 },
      { 1966,  1,  4.31316999976726 },
      { 1968,  2,  4.21316999676726 },
      { 1972,  1, 10.0              },
      { 1972,  7, 11.0              },
      { 1973,  1, 12.0              },
      { 1974,  1, 13.0              },
      { 1975,  1, 14.0              },
      { 1976,  1, 15.0              },
      { 1977,  1, 16.0              },
      { 1978,  1, 17.0              },
      { 1979,  1, 18.0              },
      { 1980,  1, 19.0              },
      { 1981,  7, 20.0              },
      { 1982,  7, 21.0              },
      { 1983,  7, 22.0              },
      { 1985,  7, 23.0              },
      { 1988,  1, 24.0              },
      { 1990,  1, 25.0              },
      { 1991,  1, 26.0              },
      { 1992,  7, 27.0              },
      { 1993,  7, 28.0              },
      { 1994,  7, 29.0              },
      { 1996,  1, 30.0              },
      { 1997,  7, 31.0              },
      { 1999,  1, 32.0              },
      { 2006,  1, 33.0              },
      { 2009,  1, 34.0              },
      { 2012,  7, 35.0              },
      { 2015,  7, 36.0              },
      { 2017,  1, 37.0              }
   };

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions