iers 0.3.1 → 0.4.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1d3826650e5fd3bcabe029c7a531bd3abd53213b06df36135c254875b8d81db9
4
- data.tar.gz: b3f444b9b216fefa81776e8ea8d11fd872ce153baea1ae780055c66d0431be64
3
+ metadata.gz: 396c81f2595653b063acdf498e9a617eb98f20f3597858572df848fc0b65384a
4
+ data.tar.gz: 3d35734d0685c12f526cae0ad0db27b269d02a72ded5d594ae744f24d29d5d34
5
5
  SHA512:
6
- metadata.gz: db698e6202ba685d7a3c0552c97f2dbe0cce5a76e572c985937a52e824b8375b7d6adc4a823a5e7e10ca73f4d4cfc7ec3d3d5a1639ff8af20d88ddf168180a71
7
- data.tar.gz: e2646d5321100190836f0c8bbd2978a4a352ece96250b549e4dfe351217b7478dbdac9fa98cba51996099b456b4ef46524ac8daca0360b9dd9c9bc3785c23318
6
+ metadata.gz: 1f48bdb1a3ea861fa08458c6c6f8cb81c4524e43f01e6d1cde265a038ff1794328fed55f0168ac204591705cda1fa611277ce6a5db95ab173dbdb6e079589b49
7
+ data.tar.gz: 0ba2de375821d44f02b2ee700fb93ddbfd27a70b26044900db072d55da7d1b3fd4f6400b45e1c68627d1534e563b14facce2623b2ee1bd1d5b8724f3f9a1d25e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,72 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.0 - 2026-11-30
4
+
5
+ ### Changed
6
+
7
+ - EOP values for past dates now come from the IERS EOP 20 C04 series, the
8
+ reference series for past Earth orientation, published by the EOP Product
9
+ Center at Paris Observatory. Until now every value came from finals2000A,
10
+ whose Bulletin B columns hold the values as they were published at the time
11
+ and were never reprocessed onto ITRF2020. Polar motion, UT1−UTC and length
12
+ of day use C04 wherever it reaches, and so do the celestial pole offsets
13
+ from 1984, where C04 starts carrying them. finals2000A still covers the last
14
+ few weeks C04 hasn't reached and the predictions.
15
+
16
+ Results for past dates change. Against the Bulletin B values used before,
17
+ polar motion moves by around 50 µas after 2010, a few hundred µas between
18
+ 1994 and 2009, and several mas before 1994; UT1−UTC by tens of µs after
19
+ 1994 and up to about a millisecond before. Everything derived from them
20
+ moves with them: `DeltaT`, `EarthRotationAngle`, `GMST` and
21
+ `TerrestrialRotation`. Recent dates barely move, since Bulletin B is taken
22
+ from C04 nowadays. Set `eop_source = :finals` to get the previous values
23
+ back.
24
+
25
+ C04 only replaces finals2000A rows that are observed, so a C04 file newer
26
+ than the finals2000A one never overrides its predictions.
27
+
28
+ - `Data.update!` with no arguments also downloads C04 (about 5 MB), and its
29
+ result is not successful if that download fails, even when the other files
30
+ were updated. Pass the sources you need, e.g. `Data.update!(:finals,
31
+ :leap_seconds)`, to keep the previous behaviour.
32
+
33
+ - Refreshed the bundled `finals2000A.all` snapshot from IERS. Final values
34
+ now extend through 2026-11-26 (previously 2026-08-27) and predictions
35
+ through 2028-01-22 (previously 2027-10-24). The bundled C04 series runs
36
+ through 2026-10-30.
37
+
38
+ ### Added
39
+
40
+ - `:c04` data source, downloaded by `Data.update!` from
41
+ `hpiers.obspm.fr/iers/eop/eopc04/eopc04.1962-now` and bundled with the gem.
42
+ - `Configuration#eop_source` (`:c04` by default, or `:finals`) and
43
+ `Configuration#c04_path`.
44
+ - `Data.c04_entries` for the raw C04 series and `Data.eop_entries` for the
45
+ series queries read from.
46
+ - `CITATION.cff`, so GitHub shows how to cite the gem and Zenodo can
47
+ archive releases.
48
+
49
+ ### Fixed
50
+
51
+ - `require "iers"` raised `NoMethodError` on Ruby versions before 4.0 when
52
+ nothing had loaded `pathname` first, as in a script run without Bundler.
53
+ Every file that uses `Pathname` now requires it.
54
+
55
+ - `TerrestrialRotation.at` multiplied its two rotations in the wrong order,
56
+ R3(ERA) × W instead of W × R3(ERA), which put the result up to about 1"
57
+ away from the true rotation, depending on the size of polar motion. It now
58
+ returns the rotation from the CIRS to the ITRS, and matches ERFA's `c2tcio`
59
+ to a few microarcseconds. The documentation of `PolarMotion` now says which
60
+ way its matrix turns: from the TIRS to the ITRS, as ERFA's `pom00`, which
61
+ is the transpose of W in the IERS Conventions. Its values are unchanged.
62
+
63
+ - A `Time`, `Date` or `DateTime` query lost up to 20 µs on the way to a
64
+ Modified Julian Date: the Julian Date, around 2.4 million, was turned into
65
+ a Float before the 2400000.5 offset was taken off, so the result kept the
66
+ coarse resolution of the larger number. That moved `EarthRotationAngle` and
67
+ `GMST` by up to about 300 µas. The offset is now taken off exactly first,
68
+ and these queries are as precise as an `mjd:` one.
69
+
3
70
  ## 0.3.1 - 2026-09-13
4
71
 
5
72
  ### Fixed
data/README.md CHANGED
@@ -27,17 +27,81 @@ Parameters** (EOP):
27
27
 
28
28
  ### Data files
29
29
 
30
- This library works with two data files published by the IERS:
30
+ This library works with three data files published by the IERS:
31
31
 
32
32
  - **finals2000A** — a daily table spanning from 1973 to the present (plus
33
- predictions ~1 year ahead). Each row contains polar motion, UT1−UTC, and
34
- other EOP for one Modified Julian Date. Recent rows carry rapid "Series A"
35
- values; older rows also include refined "Bulletin B" values.
33
+ predictions ~1 year ahead), from the USNO Rapid Service/Prediction Center.
34
+ Each row contains polar motion, UT1−UTC, and other EOP for one Modified
35
+ Julian Date. Recent rows carry rapid "Series A" values; older rows also
36
+ include "Bulletin B" values as they were published at the time.
37
+ - **EOP 20 C04** — the IERS reference series for past EOP, from the EOP
38
+ Product Center at Paris Observatory. Daily values up to about a month
39
+ before today, consistent with ITRF2020. The file starts in 1962, but the
40
+ gem only uses it from 1973, where finals2000A starts.
36
41
  - **Leap_Second.dat** — the complete history of leap seconds with their
37
42
  effective dates and the cumulative TAI−UTC offset.
38
43
 
39
- Both files are downloaded automatically by `IERS::Data.update!` and cached
40
- locally.
44
+ For every date C04 covers and finals2000A has observed values for, C04 is
45
+ used for polar motion, UT1−UTC and length of day, and for the celestial pole
46
+ offsets from 1984 on, where C04 starts carrying them. finals2000A covers the
47
+ rest: the last few weeks not in C04 yet, and the predictions.
48
+
49
+ All three files are downloaded automatically by `IERS::Data.update!` and
50
+ cached locally.
51
+
52
+ ### Accuracy
53
+
54
+ The gem is checked against external references in `test/references/`. The
55
+ reference values are generated once by the scripts in `script/references/`
56
+ and frozen, with their provenance, in `test/fixtures/references/`.
57
+
58
+ **Interpolation between daily values.** Besides the 0h UTC file the gem
59
+ reads, the EOP Product Center publishes the same C04 solution sampled at 12h
60
+ UTC. Interpolating the 0h series at noon and comparing with the 12h values
61
+ measures the interpolation error directly, over the 15,637 noons from
62
+ 1984-01-01 to 2026-10-23:
63
+
64
+ | Method | UT1−UTC RMS | UT1−UTC 99th pct. | x, y RMS (1994–2020) |
65
+ | -------------------- | ----------- | ----------------- | -------------------- |
66
+ | `:linear` | 19.4 µs | 47.0 µs | 54, 46 µas |
67
+ | `:lagrange`, order 4 | 6.6 µs | 24.5 µs | 34, 33 µas |
68
+ | `:lagrange`, order 6 | 6.5 µs | 23.5 µs | 30, 30 µas |
69
+ | `:lagrange`, order 8 | 6.5 µs | 23.4 µs | 28, 29 µas |
70
+
71
+ The default, Lagrange with 4 points, divides the UT1 error by three compared
72
+ with linear interpolation; more points barely help. The largest differences,
73
+ about 115 µs on UT1, come from a few stretches where the two C04 files
74
+ disagree with each other rather than from the interpolation. The pole is
75
+ compared from 1994 only: before that the series is noisier, with differences
76
+ of several milliarcseconds, and from 2021 to 2024 the 0h pole values are
77
+ themselves interpolated from the 12h ones.
78
+
79
+ **Sub-daily corrections.** The IERS routine [`interp.f`] interpolates with the
80
+ same 4-point Lagrange scheme, which the gem reproduces to about 1e-8 µs, then adds
81
+ the diurnal and semi-diurnal ocean tide terms and the libration terms. The gem
82
+ leaves them out, which costs, over 400 epochs from 1984 to 2026:
83
+
84
+ | Correction | UT1−UTC max (RMS) | x max (RMS) | y max (RMS) |
85
+ | ----------- | ----------------- | --------------- | --------------- |
86
+ | Ocean tides | 82 µs (27 µs) | 863 µas (320) | 686 µas (239) |
87
+ | Libration | n/a | 41 µas (16) | 40 µas (16) |
88
+
89
+ So between two daily values the ocean tides, not the interpolation, dominate
90
+ the error on UT1-UTC and polar motion.
91
+
92
+ **Rotation quantities.** Given the same UT1 and TT, over 215 dates from 1973
93
+ to 2026, `EarthRotationAngle` and `GMST` match ERFA 2.0.1's `era00` and
94
+ `gmst06` within 8 µas (RMS 2.7 µas), the resolution of a Modified Julian Date
95
+ held in one Float. The polar motion matrix matches `pom00`, TIO locator s'
96
+ included, to 5e-18 rad, and `TerrestrialRotation` matches `c2tcio` to the
97
+ same few microarcseconds as ERA. `EarthRotationAngle` also matches all 368
98
+ daily values of the 2026 [Connaissance des temps] table within 7.9 µas
99
+ (RMS 3.7 µas), for a table printed to 10 µas.
100
+
101
+ These figures hold for a `Time`, `Date`, `DateTime` or `mjd:` query. A `jd:`
102
+ Float carries a Julian Date around 2.4 million, whose resolution is about
103
+ 40 µs, so it can put ERA up to about 300 µas off: pass `mjd:` when that
104
+ matters.
41
105
 
42
106
  ## Installation
43
107
 
@@ -76,6 +140,7 @@ You can also update a single source:
76
140
 
77
141
  ```ruby
78
142
  IERS::Data.update!(:finals)
143
+ IERS::Data.update!(:c04)
79
144
  IERS::Data.update!(:leap_seconds)
80
145
  ```
81
146
 
@@ -109,7 +174,9 @@ entries.count # => 31
109
174
 
110
175
  #### Rotation matrix
111
176
 
112
- Compute the polar motion rotation matrix W (IERS Conventions 2010, §5.4.1):
177
+ Compute the polar motion rotation matrix from the TIRS to the ITRS, including
178
+ the TIO locator s'. It is ERFA's `pom00`, the transpose of W in IERS
179
+ Conventions 2010, §5.4.1:
113
180
 
114
181
  ```ruby
115
182
  w = IERS::PolarMotion.rotation_matrix_at(Time.utc(2020, 6, 15))
@@ -202,8 +269,10 @@ IERS::GMST.at(Time.utc(2020, 6, 15)) # => radians, in [0, 2π)
202
269
 
203
270
  ### Terrestrial rotation matrix
204
271
 
205
- Compute R(ERA) × W, the rotation from ITRS to TIRS (IERS Conventions 2010,
206
- eq. 5.1), combining the Earth Rotation Angle and the polar motion matrix (W):
272
+ Compute the rotation from the CIRS to the ITRS, combining the Earth Rotation
273
+ Angle and the polar motion matrix above as W × R3(ERA), the transpose of
274
+ R(t) W(t) in IERS Conventions 2010, eq. 5.1. It is ERFA's `c2tcio` with the
275
+ CIRS as the celestial frame:
207
276
 
208
277
  ```ruby
209
278
  r = IERS::TerrestrialRotation.at(Time.utc(2020, 6, 15))
@@ -352,6 +421,7 @@ Point the gem at your own copies of the IERS data files:
352
421
  ```ruby
353
422
  IERS.configure do |config|
354
423
  config.finals_path = "/path/to/finals2000A.all"
424
+ config.c04_path = "/path/to/eopc04.1962-now"
355
425
  config.leap_second_path = "/path/to/Leap_Second.dat"
356
426
  end
357
427
  ```
@@ -364,9 +434,17 @@ IERS.configure do |config|
364
434
  config.interpolation = :linear # default: :lagrange
365
435
  config.lagrange_order = 6 # default: 4
366
436
  config.download_timeout = 60 # default: 30 (seconds)
437
+ config.eop_source = :finals # default: :c04
367
438
  end
368
439
  ```
369
440
 
441
+ `eop_source = :finals` ignores C04 and reads every EOP value from
442
+ finals2000A, preferring its Bulletin B values where a row has them.
443
+
444
+ If the downloaded C04 file can't be read, queries use the bundled one, and
445
+ finals2000A alone if that fails too. `IERS::Data.c04_entries` raises the
446
+ underlying error if you want to check.
447
+
370
448
  To fully reset configuration and cached data:
371
449
 
372
450
  ```ruby
@@ -413,6 +491,8 @@ rooms and mailing lists is expected to follow the [code of conduct].
413
491
  [IERS]: https://www.iers.org
414
492
  [IERS Earth Orientation Center]: https://hpiers.obspm.fr/eop-pc/
415
493
  [USNO Rapid Service/Prediction Center]: https://maia.usno.navy.mil/ser7/
494
+ [`interp.f`]: https://hpiers.obspm.fr/iers/models/interp.f
495
+ [Connaissance des temps]: https://www.imcce.fr/content/medias/publications/publications-institutionnelles/CDT_2026_ebook.pdf
416
496
  [Bundler]: https://bundler.io
417
497
  [rubygems.org]: https://rubygems.org
418
498
  [MIT License]: https://opensource.org/licenses/MIT
data/Rakefile CHANGED
@@ -20,19 +20,19 @@ namespace :data do
20
20
  IERS.configure do |config|
21
21
  config.finals_path = File.join(data_dir, "finals2000A.all")
22
22
  config.leap_second_path = File.join(data_dir, "Leap_Second.dat")
23
+ config.c04_path = File.join(data_dir, "eopc04.1962-now")
23
24
  end
24
25
 
25
26
  result = IERS::Data.update!
26
27
 
27
- unless result.success?
28
- result.errors.each do |source, error|
29
- warn "#{source}: #{error.class} - #{error.message}"
30
- end
31
- abort "IERS data update failed"
28
+ result.errors.each do |source, error|
29
+ warn "#{source}: #{error.class} - #{error.message}"
32
30
  end
31
+ abort "IERS data update failed" unless (result.errors.keys - [:c04]).empty?
33
32
 
34
33
  IERS::Data.ensure_fresh!(coverage_days_ahead: 90)
35
34
  IERS::Data.leap_second_entries
35
+ IERS::Data.c04_entries unless result.errors.key?(:c04)
36
36
 
37
37
  puts "Updated: #{result.updated_files.join(", ")}"
38
38
  end