Test the 1972 hand-over to the leap seconds where it happens, and give the ΔT comment its measured joins

The continuity test sampled 1972 at 2451544.5 + (1972 - 2000) x 365.2425 +/- 0.01 d, which is JD
2441317.70 and .72; the switch is at the calendar's 1 January 1972, JD 2441317.5, so both samples
read the leap-second table (42.184 and 42.184) and the join was never compared. Moving the switch
two years early (a 1.99 s step in 1970) passed all 836 tests. The hand-over now has its own test:
the step across midnight must be under 0.1 s (it is 0.067: 42.2514 to 42.184), and the last day of
1971 must still read the polynomial's 42.2485 s. Control: the switch at JD_1972 - 730 fails that
test only (1 failed, 836 passed).

The polynomials' own joins, measured 1e-6 d either side: 0.251 s at 1600, 0.162 at 1700, 0.087 at
500, 0.088 at 1900, and under 0.06 elsewhere. 34ae803 said its pieces join within 0.1 s; they join
within 0.26 s, a step in NASA's published Espenak-Meeus coefficients, which the code copies as
they are. The test's bound is tightened from 1 s to 0.3 s to say so. Control: starting the
1600-1700 piece 0.5 s high (a 0.75 s jump, which the 1 s bound let through) fails it only.

Comments in constants.ts: TT - UTC from 1972 is 32.184 s plus TAI - UTC, the 10 s UTC started from
and the 27 leap seconds since (it read "the 10 to 37 of them"). The Moon's error when ΔT was held at
69 s is 0.21 to 0.26 degrees at AD 1000 and 1.44 to 1.79 at AD 1 depending on where it is on its
eccentric orbit, not a single 0.22 and 1.43.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-09-29 21:13:09 +02:00
co-authored by Claude Opus 5.5
parent cbe4908219
commit 20c34f9662
2 changed files with 22 additions and 9 deletions
+12 -3
View File
@@ -20,12 +20,21 @@ describe('ttMinusUtSeconds', () => {
expect(ttMinusUtSeconds(jd(2999, 1, 1))).toBe(69.184); expect(ttMinusUtSeconds(jd(2999, 1, 1))).toBe(69.184);
}); });
it('joins its pieces without a jump of more than a second', () => { it('joins its polynomials without a jump of more than 0.3 s, the 0.25 s at 1600 the worst', () => {
for (const year of [500, 1600, 1700, 1800, 1860, 1900, 1920, 1941, 1961, 1972]) { for (const year of [500, 1600, 1700, 1800, 1860, 1900, 1920, 1941, 1961]) {
const at = 2451544.5 + (year - 2000) * 365.2425; const at = 2451544.5 + (year - 2000) * 365.2425;
expect(Math.abs(ttMinusUtSeconds(at + 0.01) - ttMinusUtSeconds(at - 0.01))).toBeLessThan(1); expect(Math.abs(ttMinusUtSeconds(at + 0.01) - ttMinusUtSeconds(at - 0.01))).toBeLessThan(0.3);
} }
}); });
it('hands over from the polynomial to the leap seconds at the start of 1972, 0.07 s apart', () => {
// The switch is placed by the calendar, not by a 365.2425-day year, so it is sampled on either
// side of midnight; and the last day of 1971 must still be the polynomial's 42.25 s, not the
// table's 42.184, or the switch has moved.
const start = jd(1972);
expect(Math.abs(ttMinusUtSeconds(start) - ttMinusUtSeconds(start - 1e-6))).toBeLessThan(0.1);
expect(Math.abs(ttMinusUtSeconds(jd(1971, 12, 31)) - 42.2485)).toBeLessThan(0.01);
});
}); });
describe('tdbFromUtc', () => { describe('tdbFromUtc', () => {
+10 -6
View File
@@ -32,12 +32,16 @@ const JD_1972 = Date.UTC(1972, 0, 1) / 86400000 + 2440587.5;
* has fallen behind the uniform time the ephemerides run on. * has fallen behind the uniform time the ephemerides run on.
* *
* From 1972 the clock is UTC, held to within 0.9 s of UT by leap seconds, and TT - UTC is exact: * From 1972 the clock is UTC, held to within 0.9 s of UT by leap seconds, and TT - UTC is exact:
* 32.184 s plus the 10 to 37 of them. After the last, at the start of 2017, it is held at 69.184 s, * 32.184 s plus TAI - UTC, which is the 10 s UTC started from in 1972 and the 27 leap seconds taken
* as Horizons holds it: no one knows the leap seconds to come. Before 1972 it is ΔT from the * since, 37 s from 2017. After the last, at the start of 2017, it is held at 69.184 s, as Horizons
* Espenak-Meeus polynomials (NASA's Five Millennium Canon, 2006), which fit the historical record * holds it: no one knows the leap seconds to come. Before 1972 it is ΔT from the Espenak-Meeus
* of eclipses and occultations: 10 570 s at AD 1, 1 574 at AD 1000, 29 in 1950. Held at 69 s there, * polynomials (NASA's Five Millennium Canon, 2006), which fit the historical record of eclipses and
* as it was, every spin but Earth's was a turn of (ΔT - 69 s) times its rate out, 15 degrees for * occultations: 10 570 s at AD 1, 1 574 at AD 1000, 29 in 1950. As published they join within
* Jupiter at AD 1000 and 106 at AD 1, and the Moon 0.22 and 1.43 degrees along its orbit. * 0.26 s (at 1600; 0.16 s at 1700, under 0.09 s elsewhere), and the last meets the leap-second
* table 0.07 s apart. Held at 69 s there, as it was, every spin but Earth's was a turn of
* (ΔT - 69 s) times its rate out, 15 degrees for Jupiter at AD 1000 and 106 at AD 1, and the Moon
* 0.21 to 0.26 and 1.44 to 1.79 degrees along its orbit, as its eccentric orbit carries it faster
* or slower through those hours.
*/ */
export function ttMinusUtSeconds(jdUt: number): number { export function ttMinusUtSeconds(jdUt: number): number {
if (jdUt >= JD_1972) { if (jdUt >= JD_1972) {