@interstellar-tools/temporal 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,7 +2,8 @@
2
2
 
3
3
  Time and epoch utilities for space applications, from attoseconds to gigayears,
4
4
  with unit normalisation and conversion that the rest of the stack builds on, and
5
- Julian dates on the UTC, TAI, TT and UT1 time scales, with leap seconds.
5
+ Julian dates on the UTC, TAI, TT, UT1, TDB and GPS time scales, with leap
6
+ seconds.
6
7
 
7
8
  ## Documentation
8
9
 
@@ -45,12 +45,14 @@ export declare const taiMinusUtc: (date: Date) => number;
45
45
  *
46
46
  * Where:
47
47
  * - $ t_{\mathrm{Unix}} $ is the `Date`'s milliseconds since 1970-01-01T00:00:00Z (ms)
48
- * - $ \Delta $ is the scale's lead over UTC: 0 for UTC and UT1, TAI − UTC for TAI, and TAI − UTC + 32.184 s for TT (ms)
48
+ * - $ \Delta $ is the scale's lead over UTC: 0 for UTC and UT1, TAI − UTC for TAI, TAI − UTC − 19 s for GPS, TAI − UTC + 32.184 s for TT, and that plus TDB − TT for TDB (ms)
49
49
  *
50
50
  * ::: info Notes
51
51
  *
52
52
  * - **UT1 is taken as UTC.** They differ by up to 0.9 s; the exact difference
53
53
  * is measured and published by the IERS, and the library fetches nothing.
54
+ * - **TDB − TT** comes from the series in USNO Circular 179 (eq. 2.6), good
55
+ * to 10 µs: within 1.7 ms, largest in early April and early October.
54
56
  * - A Julian date as a double is precise to about 40 µs today.
55
57
  * - UTC Julian dates step over leap seconds, like the `Date` itself: the
56
58
  * difference between two of them in days can be 1 s short. Take differences
@@ -58,11 +60,11 @@ export declare const taiMinusUtc: (date: Date) => number;
58
60
  *
59
61
  * :::
60
62
  *
61
- * @param date - The moment, as a UTC `Date` (on or after 1972-01-01 for TAI and TT).
63
+ * @param date - The moment, as a UTC `Date` (on or after 1972-01-01 for TAI, TT, TDB and GPS).
62
64
  * @param scale - The time scale to count in. Defaults to `UTC`.
63
65
  * @returns The Julian date in **days**.
64
66
  * @throws {TypeError} If `date` is not a valid `Date`.
65
- * @throws {RangeError} If `scale` is not a {@link TimeScaleType}, or `date` is before 1972-01-01 for TAI and TT.
67
+ * @throws {RangeError} If `scale` is not a {@link TimeScaleType}, or `date` is before 1972-01-01 for TAI, TT, TDB and GPS.
66
68
  * @group Time scales
67
69
  *
68
70
  * @example
@@ -71,7 +73,10 @@ export declare const taiMinusUtc: (date: Date) => number;
71
73
  *
72
74
  * julianDate(J2000_UTC, 'TT'); // 2451545: J2000 is JD 2451545.0 TT
73
75
  * julianDate(J2000_UTC); // 2451544.999257: 64.184 s earlier on the UTC clock
76
+ * julianDate(J2000_UTC, 'GPS'); // 2451544.999408: 13 s ahead of UTC in 2000
74
77
  * ```
78
+ *
79
+ * @see https://aa.usno.navy.mil/publications/Circular_179 USNO Circular 179, for TDB
75
80
  */
76
81
  export declare const julianDate: (date: Date, scale?: TimeScaleType) => number;
77
82
  /**
@@ -82,11 +87,11 @@ export declare const julianDate: (date: Date, scale?: TimeScaleType) => number;
82
87
  * \mathrm{MJD} = \mathrm{JD} - 2\,400\,000.5
83
88
  * $$
84
89
  *
85
- * @param date - The moment, as a UTC `Date` (on or after 1972-01-01 for TAI and TT).
90
+ * @param date - The moment, as a UTC `Date` (on or after 1972-01-01 for TAI, TT, TDB and GPS).
86
91
  * @param scale - The time scale to count in. Defaults to `UTC`.
87
92
  * @returns The modified Julian date in **days**.
88
93
  * @throws {TypeError} If `date` is not a valid `Date`.
89
- * @throws {RangeError} If `scale` is not a {@link TimeScaleType}, or `date` is before 1972-01-01 for TAI and TT.
94
+ * @throws {RangeError} If `scale` is not a {@link TimeScaleType}, or `date` is before 1972-01-01 for TAI, TT, TDB and GPS.
90
95
  * @group Time scales
91
96
  * @see {@link julianDate}
92
97
  *
@@ -112,7 +117,7 @@ export declare const modifiedJulianDate: (date: Date, scale?: TimeScaleType) =>
112
117
  * @param scale - The time scale the Julian date counts in. Defaults to `UTC`.
113
118
  * @returns The moment as a `Date`.
114
119
  * @throws {TypeError} If `jd` is not a finite number.
115
- * @throws {RangeError} If `scale` is not a {@link TimeScaleType}, the moment is before 1972-01-01 for TAI and TT, or it's outside the range of a `Date`.
120
+ * @throws {RangeError} If `scale` is not a {@link TimeScaleType}, the moment is before 1972-01-01 for TAI, TT, TDB and GPS, or it's outside the range of a `Date`.
116
121
  * @group Time scales
117
122
  *
118
123
  * @example
@@ -1 +1 @@
1
- {"version":3,"file":"time-scales.d.ts","sourceRoot":"","sources":["../src/time-scales.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AA8C/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,eAAO,MAAM,WAAW,GAAI,MAAM,IAAI,KAAG,MACR,CAAC;AAElC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,eAAO,MAAM,UAAU,GACrB,MAAM,IAAI,EACV,QAAO,aAAqB,KAC3B,MASF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,kBAAkB,GAC7B,MAAM,IAAI,EACV,QAAO,aAAqB,KAC3B,MAUF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,kBAAkB,GAC7B,IAAI,MAAM,EACV,QAAO,aAAqB,KAC3B,IAmCF,CAAC"}
1
+ {"version":3,"file":"time-scales.d.ts","sourceRoot":"","sources":["../src/time-scales.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAgF/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,eAAO,MAAM,WAAW,GAAI,MAAM,IAAI,KAAG,MACR,CAAC;AAElC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,eAAO,MAAM,UAAU,GACrB,MAAM,IAAI,EACV,QAAO,aAAqB,KAC3B,MASF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,kBAAkB,GAC7B,MAAM,IAAI,EACV,QAAO,aAAqB,KAC3B,MAUF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,kBAAkB,GAC7B,IAAI,MAAM,EACV,QAAO,aAAqB,KAC3B,IAwCF,CAAC"}
@@ -4,7 +4,19 @@ const STEPS = LEAP_SECONDS.map(({ date, taiMinusUtc }) => ({
4
4
  ms: Date.parse(`${date}T00:00:00Z`),
5
5
  taiMinusUtc
6
6
  }));
7
- const SCALES = ['UTC', 'TAI', 'TT', 'UT1'];
7
+ const SCALES = [
8
+ 'UTC',
9
+ 'TAI',
10
+ 'TT',
11
+ 'UT1',
12
+ 'TDB',
13
+ 'GPS'
14
+ ];
15
+ // GPS time was set to UTC on 1980-01-06, when TAI − UTC was 19 s, and has
16
+ // taken no leap seconds since
17
+ const TAI_MINUS_GPS_SECONDS = 19;
18
+ // Julian date of J2000.0
19
+ const JD_J2000 = 2451545;
8
20
  const assertDate = (date) => {
9
21
  if (!(date instanceof Date) || !Number.isFinite(date.getTime()))
10
22
  throw new TypeError(`date must be a valid Date. Received: ${String(date)}`);
@@ -17,7 +29,7 @@ const assertScale = (scale) => {
17
29
  // TAI − UTC in s at a UTC instant in Unix ms
18
30
  const leapSecondsAt = (ms) => {
19
31
  if (ms < STEPS[0].ms)
20
- throw new RangeError(`TAI and TT are only defined here from 1972-01-01, when UTC began to step by whole leap seconds. Received: ${new Date(ms).toISOString()}`);
32
+ throw new RangeError(`TAI, TT, TDB and GPS time are only defined here from 1972-01-01, when UTC began to step by whole leap seconds. Received: ${new Date(ms).toISOString()}`);
21
33
  let taiMinusUtc = STEPS[0].taiMinusUtc;
22
34
  for (const step of STEPS) {
23
35
  if (ms < step.ms)
@@ -26,12 +38,29 @@ const leapSecondsAt = (ms) => {
26
38
  }
27
39
  return taiMinusUtc;
28
40
  };
41
+ // TDB − TT in ms at a TT instant in Unix ms: USNO Circular 179, eq. 2.6,
42
+ // good to 10 µs
43
+ const tdbMinusTt = (ms) => {
44
+ const t = (ms / MILLISECONDS_PER_DAY + JULIAN_DATE_UNIX_EPOCH - JD_J2000) / 36525;
45
+ return (1.657 * Math.sin(628.3076 * t + 6.2401) +
46
+ 0.022 * Math.sin(575.3385 * t + 4.297) +
47
+ 0.014 * Math.sin(1256.6152 * t + 6.1969) +
48
+ 0.005 * Math.sin(606.9777 * t + 4.0212) +
49
+ 0.005 * Math.sin(52.9691 * t + 0.4444) +
50
+ 0.002 * Math.sin(21.3299 * t + 5.5431) +
51
+ 0.01 * t * Math.sin(628.3076 * t + 4.249));
52
+ };
29
53
  // The scale's lead over UTC, in ms, at a UTC instant in Unix ms
30
54
  const leadOverUtc = (ms, scale) => {
31
55
  if (scale === 'UTC' || scale === 'UT1')
32
56
  return 0;
33
57
  const tai = 1000 * leapSecondsAt(ms);
34
- return scale === 'TT' ? tai + 1000 * TT_MINUS_TAI_SECONDS : tai;
58
+ if (scale === 'TAI')
59
+ return tai;
60
+ if (scale === 'GPS')
61
+ return tai - 1000 * TAI_MINUS_GPS_SECONDS;
62
+ const tt = tai + 1000 * TT_MINUS_TAI_SECONDS;
63
+ return scale === 'TT' ? tt : tt + tdbMinusTt(ms + tt);
35
64
  };
36
65
  /**
37
66
  * **TAI − UTC**, in **s**, at a moment: the number of leap seconds so far, plus
@@ -79,12 +108,14 @@ export const taiMinusUtc = (date) => leapSecondsAt(assertDate(date));
79
108
  *
80
109
  * Where:
81
110
  * - $ t_{\mathrm{Unix}} $ is the `Date`'s milliseconds since 1970-01-01T00:00:00Z (ms)
82
- * - $ \Delta $ is the scale's lead over UTC: 0 for UTC and UT1, TAI − UTC for TAI, and TAI − UTC + 32.184 s for TT (ms)
111
+ * - $ \Delta $ is the scale's lead over UTC: 0 for UTC and UT1, TAI − UTC for TAI, TAI − UTC − 19 s for GPS, TAI − UTC + 32.184 s for TT, and that plus TDB − TT for TDB (ms)
83
112
  *
84
113
  * ::: info Notes
85
114
  *
86
115
  * - **UT1 is taken as UTC.** They differ by up to 0.9 s; the exact difference
87
116
  * is measured and published by the IERS, and the library fetches nothing.
117
+ * - **TDB − TT** comes from the series in USNO Circular 179 (eq. 2.6), good
118
+ * to 10 µs: within 1.7 ms, largest in early April and early October.
88
119
  * - A Julian date as a double is precise to about 40 µs today.
89
120
  * - UTC Julian dates step over leap seconds, like the `Date` itself: the
90
121
  * difference between two of them in days can be 1 s short. Take differences
@@ -92,11 +123,11 @@ export const taiMinusUtc = (date) => leapSecondsAt(assertDate(date));
92
123
  *
93
124
  * :::
94
125
  *
95
- * @param date - The moment, as a UTC `Date` (on or after 1972-01-01 for TAI and TT).
126
+ * @param date - The moment, as a UTC `Date` (on or after 1972-01-01 for TAI, TT, TDB and GPS).
96
127
  * @param scale - The time scale to count in. Defaults to `UTC`.
97
128
  * @returns The Julian date in **days**.
98
129
  * @throws {TypeError} If `date` is not a valid `Date`.
99
- * @throws {RangeError} If `scale` is not a {@link TimeScaleType}, or `date` is before 1972-01-01 for TAI and TT.
130
+ * @throws {RangeError} If `scale` is not a {@link TimeScaleType}, or `date` is before 1972-01-01 for TAI, TT, TDB and GPS.
100
131
  * @group Time scales
101
132
  *
102
133
  * @example
@@ -105,7 +136,10 @@ export const taiMinusUtc = (date) => leapSecondsAt(assertDate(date));
105
136
  *
106
137
  * julianDate(J2000_UTC, 'TT'); // 2451545: J2000 is JD 2451545.0 TT
107
138
  * julianDate(J2000_UTC); // 2451544.999257: 64.184 s earlier on the UTC clock
139
+ * julianDate(J2000_UTC, 'GPS'); // 2451544.999408: 13 s ahead of UTC in 2000
108
140
  * ```
141
+ *
142
+ * @see https://aa.usno.navy.mil/publications/Circular_179 USNO Circular 179, for TDB
109
143
  */
110
144
  export const julianDate = (date, scale = 'UTC') => {
111
145
  const ms = assertDate(date);
@@ -121,11 +155,11 @@ export const julianDate = (date, scale = 'UTC') => {
121
155
  * \mathrm{MJD} = \mathrm{JD} - 2\,400\,000.5
122
156
  * $$
123
157
  *
124
- * @param date - The moment, as a UTC `Date` (on or after 1972-01-01 for TAI and TT).
158
+ * @param date - The moment, as a UTC `Date` (on or after 1972-01-01 for TAI, TT, TDB and GPS).
125
159
  * @param scale - The time scale to count in. Defaults to `UTC`.
126
160
  * @returns The modified Julian date in **days**.
127
161
  * @throws {TypeError} If `date` is not a valid `Date`.
128
- * @throws {RangeError} If `scale` is not a {@link TimeScaleType}, or `date` is before 1972-01-01 for TAI and TT.
162
+ * @throws {RangeError} If `scale` is not a {@link TimeScaleType}, or `date` is before 1972-01-01 for TAI, TT, TDB and GPS.
129
163
  * @group Time scales
130
164
  * @see {@link julianDate}
131
165
  *
@@ -157,7 +191,7 @@ export const modifiedJulianDate = (date, scale = 'UTC') => {
157
191
  * @param scale - The time scale the Julian date counts in. Defaults to `UTC`.
158
192
  * @returns The moment as a `Date`.
159
193
  * @throws {TypeError} If `jd` is not a finite number.
160
- * @throws {RangeError} If `scale` is not a {@link TimeScaleType}, the moment is before 1972-01-01 for TAI and TT, or it's outside the range of a `Date`.
194
+ * @throws {RangeError} If `scale` is not a {@link TimeScaleType}, the moment is before 1972-01-01 for TAI, TT, TDB and GPS, or it's outside the range of a `Date`.
161
195
  * @group Time scales
162
196
  *
163
197
  * @example
@@ -169,13 +203,18 @@ export const dateFromJulianDate = (jd, scale = 'UTC') => {
169
203
  if (!Number.isFinite(jd))
170
204
  throw new TypeError(`jd must be a finite number. Received: ${jd}`);
171
205
  assertScale(scale);
172
- // Milliseconds since 1970-01-01T00:00:00 on the scale's clock
173
- const onScale = Math.round((jd - JULIAN_DATE_UNIX_EPOCH) * MILLISECONDS_PER_DAY);
206
+ // Milliseconds since 1970-01-01T00:00:00 on the scale's clock, TT for TDB
207
+ const exact = (jd - JULIAN_DATE_UNIX_EPOCH) * MILLISECONDS_PER_DAY;
208
+ const onScale = Math.round(scale === 'TDB' ? exact - tdbMinusTt(exact) : exact);
174
209
  let ms = onScale;
175
- if (scale === 'TAI' || scale === 'TT') {
176
- // The leap seconds depend on the UTC moment: guess with the scale's own
177
- // time, then settle on the offset at the guess
178
- const tai = scale === 'TT' ? onScale - 1000 * TT_MINUS_TAI_SECONDS : onScale;
210
+ if (scale !== 'UTC' && scale !== 'UT1') {
211
+ // Back to TAI, then to UTC. The leap seconds depend on the UTC moment:
212
+ // guess with TAI, then settle on the offset at the guess
213
+ const tai = scale === 'TAI'
214
+ ? onScale
215
+ : scale === 'GPS'
216
+ ? onScale + 1000 * TAI_MINUS_GPS_SECONDS
217
+ : onScale - 1000 * TT_MINUS_TAI_SECONDS;
179
218
  const guess = tai - 1000 * leapSecondsAt(tai);
180
219
  const offset = leapSecondsAt(guess);
181
220
  ms = tai - 1000 * offset;
@@ -1 +1 @@
1
- {"version":3,"file":"time-scales.js","sourceRoot":"","sources":["../src/time-scales.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,YAAY,EACZ,oBAAoB,EACpB,2BAA2B,EAC3B,oBAAoB,EACrB,MAAM,+BAA+B,CAAC;AAGvC,0DAA0D;AAC1D,MAAM,KAAK,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC;IACzD,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,IAAI,YAAY,CAAC;IACnC,WAAW;CACZ,CAAC,CAAC,CAAC;AACJ,MAAM,MAAM,GAA6B,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;AACrE,MAAM,UAAU,GAAG,CAAC,IAAU,EAAU,EAAE;IACxC,IAAI,CAAC,CAAC,IAAI,YAAY,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;QAC7D,MAAM,IAAI,SAAS,CAAC,wCAAwC,MAAM,C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,GAAG,IAAI,IAAI,CAAC,EAAE,CAAC,CAAC;IAE1B,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;QAClC,MAAM,IAAI,UAAU,CAAC,gDAAgD,EAAE,EAAE,CAAC,CAAC;IAE7E,OAAO,IAAI,CAAC;AACd,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@interstellar-tools/temporal",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "Time and epoch utilities for space applications (e.g., building blocks toward Julian dates, conversions, and ephemeris-friendly time handling).",
5
5
  "keywords": [
6
6
  "temporal",
@@ -112,8 +112,8 @@
112
112
  "test:ci": "glob-bin -c \"node --import tsx --test --no-warnings --experimental-test-coverage --test-coverage-include='src/**' --test-coverage-exclude='**/__tests__/**' --test-coverage-lines=100 --test-coverage-branches=100 --test-coverage-functions=100 --test-reporter=cobertura --test-reporter-destination=coverage/cobertura-coverage.xml --test-reporter=spec --test-reporter-destination=stdout\" \"**/__tests__/**/*.spec.ts\""
113
113
  },
114
114
  "dependencies": {
115
- "@interstellar-tools/constants": "^1.1.1",
116
- "@interstellar-tools/types": "^1.5.1"
115
+ "@interstellar-tools/constants": "^1.2.0",
116
+ "@interstellar-tools/types": "^1.12.0"
117
117
  },
118
118
  "devDependencies": {
119
119
  "@types/node": "^24.19.2",