From 0d8f1ab63f8ec21bea07d14b6ef9a2efd3b944b6 Mon Sep 17 00:00:00 2001 From: Paul Grogan Date: Sat, 14 Nov 2026 17:42:28 -0700 Subject: [PATCH] add EarthCARE ATLID, BBR, CPR, and MSI and TRMM PR, TMI, and VIRS to the catalog TMI, VIRS, and EarthCARE MSI are validated on data held out 39 to 41 days from the fit. TRMM PR is partial, as its published footprint at the scan's edge (5.0 km) lies 7.9% below the size its beam gives, while its swath is validated. ATLID and CPR, of a new profiler class (version 6 of the standard, with the altimeter's gates), are partial on track offset (0.72 km) with the element set nearest the held-out day's middle; the day's other set passes, stated in their limitations and not counted. BBR is partial on pass recall and, with that set, swath IoU; it is scored with breaks in its data over 1 s as periods without data, chosen after a first score on the day of the fit, and stated in its limitations. EarthCARE product times include leap seconds and are corrected to UTC. observe_orbit bounds its nearest-neighbor query, which gives the same cells compared in minutes rather than hours. Its span of the day is documented as it is: TAT-C's mean motion, in degrees per second, is read as revolutions per day, so swath IoU compares from noon to the end of the day rather than one orbit, for every record scored through it. --- CHANGELOG.md | 2 +- docs/validation/earthcare_2026-09-27.3le | 174 ++++++ docs/validation/earthcare_io.py | 476 +++++++++++++++ docs/validation/gesdisc_scanner.py | 86 ++- docs/validation/standard.rst | 20 +- docs/validation/summary.rst | 30 +- docs/validation/trmm_2013-05-20.3le | 159 +++++ docs/validation/validate_catalog_atlid.py | 110 ++++ docs/validation/validate_catalog_bbr.py | 260 +++++++++ docs/validation/validate_catalog_cpr.py | 108 ++++ .../validate_catalog_earthcare_msi.py | 171 ++++++ docs/validation/validate_catalog_ssmis.py | 3 +- docs/validation/validate_catalog_tmi.py | 551 ++++++++++++++++++ docs/validation/validate_catalog_trmm_pr.py | 128 ++++ docs/validation/validate_catalog_virs.py | 210 +++++++ src/tatc/catalog/standard.py | 13 +- src/tatc/resources/instruments/atlid.yml | 62 ++ src/tatc/resources/instruments/bbr.yml | 84 +++ src/tatc/resources/instruments/cpr.yml | 51 ++ .../resources/instruments/earthcare_msi.yml | 59 ++ src/tatc/resources/instruments/tmi.yml | 145 +++++ src/tatc/resources/instruments/trmm_pr.yml | 102 ++++ src/tatc/resources/instruments/virs.yml | 99 ++++ src/tatc/resources/validation/atlid.json | 38 ++ src/tatc/resources/validation/bbr.json | 97 +++ src/tatc/resources/validation/cpr.json | 38 ++ .../resources/validation/earthcare_msi.json | 42 ++ src/tatc/resources/validation/tmi.json | 156 +++++ src/tatc/resources/validation/trmm_pr.json | 84 +++ src/tatc/resources/validation/virs.json | 84 +++ tests/catalog/fixtures/NOTICE.md | 7 + tests/catalog/fixtures/atlid.npz | Bin 0 -> 2912 bytes tests/catalog/fixtures/bbr.npz | Bin 0 -> 3193 bytes tests/catalog/fixtures/cpr.npz | Bin 0 -> 3237 bytes tests/catalog/fixtures/earthcare_msi.npz | Bin 0 -> 3192 bytes tests/catalog/fixtures/tmi.npz | Bin 0 -> 14181 bytes tests/catalog/fixtures/trmm_pr.npz | Bin 0 -> 15349 bytes tests/catalog/fixtures/virs.npz | Bin 0 -> 15305 bytes tests/catalog/test_entries.py | 100 +++- tests/catalog/test_scanner_fixtures.py | 84 ++- tests/catalog/test_standard.py | 14 +- tests/catalog/test_tmi_fixture.py | 213 +++++++ 42 files changed, 4014 insertions(+), 46 deletions(-) create mode 100644 docs/validation/earthcare_2026-09-27.3le create mode 100644 docs/validation/earthcare_io.py create mode 100644 docs/validation/trmm_2013-05-20.3le create mode 100644 docs/validation/validate_catalog_atlid.py create mode 100644 docs/validation/validate_catalog_bbr.py create mode 100644 docs/validation/validate_catalog_cpr.py create mode 100644 docs/validation/validate_catalog_earthcare_msi.py create mode 100644 docs/validation/validate_catalog_tmi.py create mode 100644 docs/validation/validate_catalog_trmm_pr.py create mode 100644 docs/validation/validate_catalog_virs.py create mode 100644 src/tatc/resources/instruments/atlid.yml create mode 100644 src/tatc/resources/instruments/bbr.yml create mode 100644 src/tatc/resources/instruments/cpr.yml create mode 100644 src/tatc/resources/instruments/earthcare_msi.yml create mode 100644 src/tatc/resources/instruments/tmi.yml create mode 100644 src/tatc/resources/instruments/trmm_pr.yml create mode 100644 src/tatc/resources/instruments/virs.yml create mode 100644 src/tatc/resources/validation/atlid.json create mode 100644 src/tatc/resources/validation/bbr.json create mode 100644 src/tatc/resources/validation/cpr.json create mode 100644 src/tatc/resources/validation/earthcare_msi.json create mode 100644 src/tatc/resources/validation/tmi.json create mode 100644 src/tatc/resources/validation/trmm_pr.json create mode 100644 src/tatc/resources/validation/virs.json create mode 100644 tests/catalog/fixtures/atlid.npz create mode 100644 tests/catalog/fixtures/bbr.npz create mode 100644 tests/catalog/fixtures/cpr.npz create mode 100644 tests/catalog/fixtures/earthcare_msi.npz create mode 100644 tests/catalog/fixtures/tmi.npz create mode 100644 tests/catalog/fixtures/trmm_pr.npz create mode 100644 tests/catalog/fixtures/virs.npz create mode 100644 tests/catalog/test_tmi_fixture.py diff --git a/CHANGELOG.md b/CHANGELOG.md index 287aa26..18866d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ Added a catalog of instruments from past and present missions, with a standard for validating them. Fixed instruments losing their fields when serialized. Instruments now reject unknown fields, which can break code that passes misspelled or unused arguments. Added: - - Module `catalog` of instruments from past and present missions (`get_entry`, `list_entries`), starting with GOES-R ABI, GPM GMI, GCOM-W AMSR2, ATMS, CrIS, VIIRS, MODIS, Landsat OLI, Sentinel-2 MSI, Sentinel-1 C-SAR, NISAR L-SAR, SWOT KaRIn, the SMAP radiometer, IASI, Sentinel-5P TROPOMI, GPM DPR, MHS, ICESat-2 ATLAS, AIRS, AMSU-A, AVHRR, SSMIS, Sentinel-3 OLCI, PACE OCI, HARP2, and SPEXone, the OMPS Nadir Mapper, Himawari AHI, CERES, ECOSTRESS, OCO-2, the Sentinel-6 Poseidon-4 altimeter, Metop ASCAT, TEMPO, GEDI, and EMIT. `InstrumentEntry.to_satellite` and `build` give an entry's instruments with the attitude they were validated with, and `InstrumentEntry.validation` gives its validation tier, computed from its results and the thresholds of the validation standard (`docs/validation/standard.rst`). GMI, ATMS, VIIRS, MODIS, OLI, MSI, KaRIn, TROPOMI, DPR, MHS, HARP2, SPEXone, Poseidon-4, ASCAT, and TEMPO are `validated`, each with stated limitations, and ABI, AMSR2, CrIS, C-SAR, L-SAR, the SMAP radiometer, IASI, ATLAS, AIRS, AMSU-A, AVHRR, SSMIS, OLCI, OCI, OMPS, AHI, CERES, ECOSTRESS, OCO-2, GEDI, and EMIT are `partial` and list their gaps. Results on sibling satellites (NOAA-21, Metop-B, Sentinel-1D, Sentinel-6B) are recorded as transfers, which warn on use and do not count toward a tier; ATMS and VIIRS also have configurations fitted on NOAA-21, validated on held-out data, as NOAA-20's angles did not transfer. In an entry with configurations fitted on more than one platform (ATMS, VIIRS, and the OMPS Nadir Mapper), each configuration's name ends with its platform (`swath_noaa_20`, `swath_noaa_21`). Version 2 of the standard adds a lidar class, for ATLAS, version 3 an altimeter class, for Poseidon-4, version 4 a scatterometer class, for ASCAT, with the gates of the SAR class, and version 5 a regional geostationary class, for TEMPO, whose gate is the intersection over union of the field of regard with the area a scan images; none changes a threshold of an earlier version. Every pointed configuration with a view tailored to the time step is swept (`is_swept`), so its swaths do not depend on the time step; its records were rescored with swept swaths on the same held-out data, and MSI, TROPOMI, DPR, OCI's swath, and C-SAR's EW mode, whose tiers changed, were tested again on a later held-out day, with the rescored results stated in their limitations. The documentation lists the entries and their results on a page written from the catalog (`docs/validation/catalog_page.py`), and the example `UseInstrumentCatalog` shows their use. The OSSE examples `RunOSSEMonsoon` and `RunOSSEHurricane` take their ATMS and CrIS swaths from the catalog. + - Module `catalog` of instruments from past and present missions (`get_entry`, `list_entries`), starting with GOES-R ABI, GPM GMI, GCOM-W AMSR2, ATMS, CrIS, VIIRS, MODIS, Landsat OLI, Sentinel-2 MSI, Sentinel-1 C-SAR, NISAR L-SAR, SWOT KaRIn, the SMAP radiometer, IASI, Sentinel-5P TROPOMI, GPM DPR, MHS, ICESat-2 ATLAS, AIRS, AMSU-A, AVHRR, SSMIS, Sentinel-3 OLCI, PACE OCI, HARP2, and SPEXone, the OMPS Nadir Mapper, Himawari AHI, CERES, ECOSTRESS, OCO-2, the Sentinel-6 Poseidon-4 altimeter, Metop ASCAT, TEMPO, GEDI, EMIT, EarthCARE ATLID, BBR, CPR, and MSI, and TRMM PR, TMI, and VIRS. `InstrumentEntry.to_satellite` and `build` give an entry's instruments with the attitude they were validated with, and `InstrumentEntry.validation` gives its validation tier, computed from its results and the thresholds of the validation standard (`docs/validation/standard.rst`). GMI, ATMS, VIIRS, MODIS, OLI, MSI, KaRIn, TROPOMI, DPR, MHS, HARP2, SPEXone, Poseidon-4, ASCAT, TEMPO, TMI, VIRS, and EarthCARE's MSI are `validated`, each with stated limitations, and ABI, AMSR2, CrIS, C-SAR, L-SAR, the SMAP radiometer, IASI, ATLAS, AIRS, AMSU-A, AVHRR, SSMIS, OLCI, OCI, OMPS, AHI, CERES, ECOSTRESS, OCO-2, GEDI, EMIT, ATLID, BBR, CPR, and TRMM PR are `partial` and list their gaps. Results on sibling satellites (NOAA-21, Metop-B, Sentinel-1D, Sentinel-6B) are recorded as transfers, which warn on use and do not count toward a tier; ATMS and VIIRS also have configurations fitted on NOAA-21, validated on held-out data, as NOAA-20's angles did not transfer. In an entry with configurations fitted on more than one platform (ATMS, VIIRS, and the OMPS Nadir Mapper), each configuration's name ends with its platform (`swath_noaa_20`, `swath_noaa_21`). Version 2 of the standard adds a lidar class, for ATLAS, version 3 an altimeter class, for Poseidon-4, version 4 a scatterometer class, for ASCAT, with the gates of the SAR class, version 5 a regional geostationary class, for TEMPO, whose gate is the intersection over union of the field of regard with the area a scan images, and version 6 a profiler class, for ATLID and CPR, with the gates of the altimeter class; none changes a threshold of an earlier version. Every pointed configuration with a view tailored to the time step is swept (`is_swept`), so its swaths do not depend on the time step; its records were rescored with swept swaths on the same held-out data, and MSI, TROPOMI, DPR, OCI's swath, and C-SAR's EW mode, whose tiers changed, were tested again on a later held-out day, with the rescored results stated in their limitations. The documentation lists the entries and their results on a page written from the catalog (`docs/validation/catalog_page.py`), and the example `UseInstrumentCatalog` shows their use. The OSSE examples `RunOSSEMonsoon` and `RunOSSEHurricane` take their ATMS and CrIS swaths from the catalog. - Class `catalog.TiltSchedule` and field `attitude_schedule` of catalog configurations, for an attitude that changes by day, as PACE's tilt does: `build` and `to_satellite` take the `start` and `end` of the analysis and give an `AttitudeSchedule` with an attitude for each day (UTC), blind while the tilt changes. Function `catalog.get_subsolar_latitude` gives the latitude of the subsolar point. - Field `type` of a catalog configuration's `attitude` (`attitude`, `glint`, or `target`), which builds an `Attitude`, `GlintAttitude`, or `TargetAttitude`, as for OCO-2's glint mode. - Field `blind_intervals` of `Attitude`: intervals of argument of latitude in which a space system's instruments do not observe, for example while the body or a mechanism moves. Observations in them are not valid, so point observations, ground tracks (`valid_obs`, and the swaths of `compute_ground_track`), orbit tracks, and ground pixels omit them, and the periods and swaths of region observations end at them. Method `is_observing` of attitudes, schedules, and instruments. diff --git a/docs/validation/earthcare_2026-09-27.3le b/docs/validation/earthcare_2026-09-27.3le new file mode 100644 index 0000000..d48f515 --- /dev/null +++ b/docs/validation/earthcare_2026-09-27.3le @@ -0,0 +1,174 @@ +0 EARTHCARE +1 59908U 24101A 26270.30400445 .00010278 00000+0 14327-3 0 9993 +2 59908 97.0025 35.6478 0001699 98.7667 261.3782 15.57094527132456 +0 EARTHCARE +1 59908U 24101A 26271.07518142 .00008356 00000+0 11670-3 0 9994 +2 59908 97.0027 36.4053 0001679 98.1966 261.9481 15.57106303132571 +0 EARTHCARE +1 59908U 24101A 26271.33223884 .00008195 00000+0 11447-3 0 9992 +2 59908 97.0029 36.6577 0001670 97.4764 262.6683 15.57111230132617 +0 EARTHCARE +1 59908U 24101A 26271.91061552 .00007700 00000+0 10759-3 0 9994 +2 59908 97.0028 37.2255 0001677 95.9929 264.1518 15.57120813132700 +0 EARTHCARE +1 59908U 24101A 26272.74604323 .00007193 00000+0 10056-3 0 9991 +2 59908 97.0027 38.0459 0001695 95.5808 264.5642 15.57132622132833 +0 EARTHCARE +1 59908U 24101A 26272.81030651 .00007304 00000+0 10208-3 0 9999 +2 59908 97.0028 38.1091 0001699 95.9434 264.2016 15.57133952132840 +0 EARTHCARE +1 59908U 24101A 26273.32446627 .00006596 00000+0 92847-4 0 9992 +2 59908 97.0028 38.6144 0001623 100.1950 259.9490 15.56981014132928 +0 EARTHCARE +1 59908U 24101A 26273.64581377 .00010289 00000+0 14400-3 0 9991 +2 59908 97.0029 38.9302 0001593 100.4101 259.7335 15.56988436132971 +0 EARTHCARE +1 59908U 24101A 26273.90289106 .00008407 00000+0 11790-3 0 9993 +2 59908 97.0027 39.1822 0001724 100.9320 259.2130 15.56991952133014 +0 EARTHCARE +1 59908U 24101A 26274.35277531 .00006838 00000+0 96135-4 0 9995 +2 59908 97.0026 39.6239 0001772 100.1761 259.9695 15.56996505133083 +0 EARTHCARE +1 59908U 24101A 26274.93119503 .00006894 00000+0 96889-4 0 9991 +2 59908 97.0025 40.1916 0001792 100.6584 259.4874 15.57004747133174 +0 EARTHCARE +1 59908U 24101A 26275.31680633 .00007250 00000+0 10179-3 0 9995 +2 59908 97.0024 40.5702 0001778 100.3533 259.7924 15.57010797133233 +0 EARTHCARE +1 59908U 24101A 26275.31680634 .00007250 00000+0 10179-3 0 9996 +2 59908 97.0024 40.5702 0001778 100.3533 259.7924 15.57010797133233 +0 EARTHCARE +1 59908U 24101A 26276.60216813 .00008481 00000+0 11876-3 0 9995 +2 59908 97.0023 41.8320 0001794 99.5328 260.6131 15.57030503133431 +0 EARTHCARE +1 59908U 24101A 26277.30910986 .00007983 00000+0 11182-3 0 9991 +2 59908 97.0022 42.5259 0001763 99.3224 260.8232 15.57040984133548 +0 EARTHCARE +1 59908U 24101A 26277.30910987 .00007983 00000+0 11182-3 0 9992 +2 59908 97.0022 42.5259 0001763 99.3224 260.8232 15.57040984133548 +0 EARTHCARE +1 59908U 24101A 26277.88751157 .00011156 00000+0 15561-3 0 9999 +2 59908 97.0022 43.0938 0001756 98.7174 261.4281 15.57056553133637 +0 EARTHCARE +1 59908U 24101A 26278.27311009 .00011982 00000+0 16697-3 0 9999 +2 59908 97.0022 43.4723 0001744 98.8004 261.3449 15.57065480133693 +0 EARTHCARE +1 59908U 24101A 26278.59444088 .00010580 00000+0 14757-3 0 9996 +2 59908 97.0022 43.7878 0001755 98.7646 261.3809 15.57069955133747 +0 EARTHCARE +1 59908U 24101A 26278.91576980 .00010295 00000+0 14361-3 0 9993 +2 59908 97.0022 44.1033 0001756 98.5106 261.6349 15.57077111133795 +0 EARTHCARE +1 59908U 24101A 26279.10856661 .00010090 00000+0 14075-3 0 9997 +2 59908 97.0023 44.2926 0001760 98.4262 261.7194 15.57080861133824 +0 EARTHCARE +1 59908U 24101A 26279.30136280 .00010068 00000+0 14042-3 0 9996 +2 59908 97.0023 44.4819 0001749 97.9664 262.1791 15.57085415133855 +0 EARTHCARE +1 59908U 24101A 26279.62268893 .00009308 00000+0 12991-3 0 9993 +2 59908 97.0025 44.7975 0001764 97.5609 262.5847 15.57091013133908 +0 EARTHCARE +1 59908U 24101A 26279.81548394 .00009281 00000+0 12952-3 0 9998 +2 59908 97.0025 44.9868 0001768 97.7061 262.4396 15.57095177133935 +0 EARTHCARE +1 59908U 24101A 26280.32963292 .00008649 00000+0 12114-3 0 9991 +2 59908 97.0027 45.4920 0002301 120.0967 240.0518 15.57015634134019 +0 EARTHCARE +1 59908U 24101A 26280.90804579 .00007673 00000+0 10760-3 0 9998 +2 59908 97.0027 46.0596 0002057 114.3505 245.7966 15.57023889134107 +0 EARTHCARE +1 59908U 24101A 26281.61498963 .00009849 00000+0 13764-3 0 9997 +2 59908 97.0030 46.7538 0001908 107.8974 252.2491 15.57038973134213 +0 EARTHCARE +1 59908U 24101A 26281.80779139 .00010110 00000+0 14122-3 0 9997 +2 59908 97.0031 46.9431 0001911 107.6651 252.4814 15.57043065134244 +0 EARTHCARE +1 59908U 24101A 26282.77179213 .00011580 00000+0 16142-3 0 9997 +2 59908 97.0035 47.8899 0001938 107.3306 252.8162 15.57064219134399 +0 EARTHCARE +1 59908U 24101A 26282.90032570 .00010620 00000+0 14816-3 0 9996 +2 59908 97.0035 48.0162 0001928 107.1180 253.0287 15.57064131134419 +0 EARTHCARE +1 59908U 24101A 26283.92858931 .00010396 00000+0 14501-3 0 9997 +2 59908 97.0042 49.0266 0001964 107.0799 253.0672 15.57074560134570 +0 EARTHCARE +1 59908U 24101A 26284.24992114 .00008781 00000+0 12275-3 0 9996 +2 59908 97.0056 49.3428 0001125 121.7230 238.4136 15.57067307134629 +0 EARTHCARE +1 59908U 24101A 26285.92080361 .00003903 00000+0 55204-4 0 9995 +2 59908 97.0047 50.9835 0002068 105.6429 254.5055 15.57115154134888 +0 EARTHCARE +1 59908U 24101A 26287.59173376 .00003559 00000+0 50722-4 0 9996 +2 59908 97.0048 52.6243 0001791 98.3036 261.8424 15.56971239135149 +0 EARTHCARE +1 59908U 24101A 26287.91308245 .00003560 00000+0 50729-4 0 9996 +2 59908 97.0045 52.9401 0002233 96.7262 263.4249 15.56977907135196 +0 EARTHCARE +1 59908U 24101A 26290.93367580 .00003625 00000+0 51486-4 0 9992 +2 59908 97.0026 55.9065 0001923 96.3252 263.8223 15.57055294135669 +0 EARTHCARE +1 59908U 24101A 26290.93367581 .00003625 00000+0 51486-4 0 9993 +2 59908 97.0026 55.9065 0001924 96.3252 263.8223 15.57055294135660 +0 EARTHCARE +1 59908U 24101A 26291.76913756 .00003546 00000+0 50367-4 0 9995 +2 59908 97.0058 56.7272 0001742 88.4867 271.6589 15.57066367135795 +0 EARTHCARE +1 59908U 24101A 26291.76913756 .00003546 00000+0 50367-4 0 9995 +2 59908 97.0058 56.7272 0001742 88.4867 271.6588 15.57066367135794 +0 EARTHCARE +1 59908U 24101A 26292.79737737 .00003751 00000+0 53146-4 0 9998 +2 59908 96.9992 57.7376 0001506 99.2907 260.8520 15.57095573135953 +0 EARTHCARE +1 59908U 24101A 26292.79737738 .00003751 00000+0 53146-4 0 9999 +2 59908 96.9992 57.7376 0001506 99.2907 260.8520 15.57095573135953 +0 EARTHCARE +1 59908U 24101A 26293.82560905 .00003749 00000+0 53103-4 0 9994 +2 59908 97.0045 58.7474 0000880 120.8749 239.2594 15.57104807136114 +0 EARTHCARE +1 59908U 24101A 26297.81024450 .00002604 00000+0 37350-4 0 9992 +2 59908 97.0063 62.6593 0001915 90.1833 269.9642 15.57054905136738 +0 EARTHCARE +1 59908U 24101A 26299.86674944 .00002325 00000+0 33445-4 0 9999 +2 59908 97.0072 64.6820 0002042 94.8464 265.3025 15.57086876137059 +0 EARTHCARE +1 59908U 24101A 26301.60193994 .00002399 00000+0 34558-4 0 9993 +2 59908 97.0061 66.3859 0001907 110.0112 250.1350 15.57020012137321 +0 EARTHCARE +1 59908U 24101A 26301.79474373 .00002373 00000+0 34191-4 0 9991 +2 59908 97.0053 66.5747 0002047 110.0831 250.0646 15.57022240137359 +0 EARTHCARE +1 59908U 24101A 26302.63022384 .00002548 00000+0 36603-4 0 9990 +2 59908 97.0062 67.3969 0002119 103.9145 256.2347 15.57030080137484 +0 EARTHCARE +1 59908U 24101A 26305.32939785 .00003175 00000+0 45205-4 0 9996 +2 59908 97.0059 70.0466 0001929 90.4463 269.7015 15.57087475137902 +0 EARTHCARE +1 59908U 24101A 26305.32939785 .00003175 00000+0 45205-4 0 9996 +2 59908 97.0059 70.0466 0001929 90.4463 269.7015 15.57087475137902 +0 EARTHCARE +1 59908U 24101A 26307.32159083 .00002642 00000+0 37777-4 0 9996 +2 59908 97.0056 72.0051 0001923 100.9333 259.2139 15.57124313138217 +0 EARTHCARE +1 59908U 24101A 26307.32159084 .00002642 00000+0 37777-4 0 9997 +2 59908 97.0056 72.0051 0001923 100.9333 259.2139 15.57124313138217 +0 EARTHCARE +1 59908U 24101A 26309.18532497 .00002966 00000+0 42291-4 0 9992 +2 59908 97.0270 73.8709 0009943 329.3908 30.6767 15.57065875138506 +0 EARTHCARE +1 59908U 24101A 26309.31388748 .00002986 00000+0 42718-4 0 9991 +2 59908 97.0068 73.9652 0001671 77.6970 282.4473 15.57004533138528 +0 EARTHCARE +1 59908U 24101A 26309.31388748 .00002986 00000+0 42718-4 0 9991 +2 59908 97.0068 73.9652 0001671 77.6970 282.4473 15.57004533138528 +0 EARTHCARE +1 59908U 24101A 26310.59924290 .00003558 00000+0 50578-4 0 9990 +2 59908 97.0059 75.2257 0002750 96.9250 263.2319 15.57040707138729 +0 EARTHCARE +1 59908U 24101A 26311.30617853 .00004223 00000+0 59757-4 0 9992 +2 59908 97.0084 75.9264 0002209 67.3764 292.7725 15.57053133138830 +0 EARTHCARE +1 59908U 24101A 26311.62750801 .00004461 00000+0 63043-4 0 9995 +2 59908 97.0160 76.2389 0000978 99.6583 260.4783 15.57061660138880 +0 EARTHCARE +1 59908U 24101A 26311.62750802 .00004461 00000+0 63043-4 0 9996 +2 59908 97.0160 76.2389 0000978 99.6583 260.4783 15.57061661138881 diff --git a/docs/validation/earthcare_io.py b/docs/validation/earthcare_io.py new file mode 100644 index 0000000..aac5c71 --- /dev/null +++ b/docs/validation/earthcare_io.py @@ -0,0 +1,476 @@ +""" +Reads the Level 1 products of EarthCARE from ESA's MAAP, and validates the catalog +entries of its profilers (ATLID and CPR), whose profiles lie along a narrow track. + +Products are found in the MAAP catalogue (STAC, no authentication) and read with range +requests, with an access token exchanged for the MAAP offline token in `ESA_MAAP_KEY`. +Only the needed fields of each frame (an eighth of an orbit) are read, and a day is +cached in a directory. + +@author: Paul T. Grogan +""" + +import concurrent.futures +import json +import os +import pathlib +import threading +import time as clock +from collections.abc import Callable +from datetime import datetime, timedelta + +import h5py +import numpy as np +import pandas as pd +import requests + +import tatc +from tatc.analysis import collect_observations +from tatc.catalog.metrics import summarize +from tatc.schemas import Point +from validation_io import ( + TO_GEODETIC, + RemoteFile, + ecef, + get_holdout_gap, + get_with_retries, + normalize, + recompute_passes, + up, + update_fixture, + update_record, +) + +CATALOGUE = "https://catalog.maap.eo.esa.int/catalogue/collections" +TOKEN_URL = "https://iam.maap.eo.esa.int/realms/esa-maap/protocol/openid-connect/token" +# the public client of MAAP's offline tokens, as in ESA's examples of data access +CLIENT = { + "client_id": "offline-token", + "client_secret": "p1eL7uonXs6MDxtGbgKdPVRAmnGxHpVE", +} +VALIDATED = "EarthCAREL1Validated_MAAP" +EPOCH = pd.Timestamp("2000-01-01", tz="UTC") +# the products' times count elapsed seconds since 2000-01-01 00:00 UTC, including the +# leap seconds since (five, from 2017), so they run 5 s ahead of UTC: the spacecraft +# positions they record match an element set's orbit 5.0 s before their times, and +# a frame's first time follows the UTC sensing start of its header by 5.1 s +LEAP_SECONDS_SINCE_2000 = 5 +EARTH_ROTATION = 7.2921150e-5 # rad/s +TIME_STEPS = (10, 30, 120) + + +class MaapSession: + """A session with an access token, renewed before it expires.""" + + def __init__(self): + if "ESA_MAAP_KEY" not in os.environ: + raise RuntimeError("MAAP access needs an offline token in ESA_MAAP_KEY") + self.session = requests.Session() + self.expires = 0.0 + self.lock = threading.Lock() + + def get(self) -> requests.Session: + """Gets the session, with a current access token.""" + with self.lock: + if clock.time() > self.expires - 600: + response = requests.post( + TOKEN_URL, + data={ + **CLIENT, + "grant_type": "refresh_token", + "refresh_token": os.environ["ESA_MAAP_KEY"], + "scope": "offline_access openid", + }, + timeout=60, + ) + response.raise_for_status() + token = response.json() + self.session.headers["Authorization"] = ( + f"Bearer {token['access_token']}" + ) + self.expires = clock.time() + float(token.get("expires_in", 3600)) + return self.session + + +def find_frames(product_type: str, day: datetime, collection: str = VALIDATED): + """ + Gets the identifiers and URLs of the frames of a product from an hour before to + after a day, keeping the latest processing of each frame. + """ + url = f"{CATALOGUE}/{collection}/items" + params = { + "productType": product_type, + "datetime": f"{day - timedelta(hours=1):%Y-%m-%dT%H:%M:%SZ}/" + f"{day + timedelta(days=1, hours=1):%Y-%m-%dT%H:%M:%SZ}", + "limit": 500, + } + frames = {} + while url: + page = get_with_retries(url, params=params).json() + for feature in page.get("features", []): + properties = feature["properties"] + key = (properties["sat:absolute_orbit"], properties["grid:code"]) + created = properties.get("created", "") + if key not in frames or created > frames[key][2]: + frames[key] = ( + feature["id"], + feature["assets"]["enclosure_h5"]["href"], + created, + ) + url = next( + (link["href"] for link in page.get("links", []) if link["rel"] == "next"), + None, + ) + params = None + return sorted((name, href) for name, href, _ in frames.values()) + + +def to_seconds(seconds_since_2000, day: datetime) -> np.ndarray: + """ + Converts the products' times (elapsed seconds since 2000, with leap seconds) to + UTC seconds from the start of a day. + """ + return ( + np.asarray(seconds_since_2000, dtype=float) + - LEAP_SECONDS_SINCE_2000 + - (pd.Timestamp(day) - EPOCH).total_seconds() + ) + + +def load_day( + product_type: str, + day: datetime, + directory: pathlib.Path, + read: Callable[[h5py.File, datetime], dict], + name: str | None = None, + collection: str = VALIDATED, + threads: int = 4, + orbit_stride: int = 1, +) -> dict: + """ + Reads fields of the frames of a day, with range requests, or loads them from a + cache. `read` gets a frame's fields, including `time` (seconds from the start of + the day) along its first axis. Keeps each time once, in order, within the day. + With `orbit_stride`, reads only the frames of orbits whose number it divides. + """ + cache = directory / f"{(name or product_type).lower()}_{day:%Y%m%d}.npz" + if cache.exists(): + return dict(np.load(cache)) + frames = [ + frame + for frame in find_frames(product_type, day, collection) + if int(frame[0].rsplit("_", 1)[1][:-1]) % orbit_stride == 0 + ] + maap = MaapSession() + + def read_frame(frame): + _, href = frame + for attempt in range(3): + try: + with h5py.File(RemoteFile(href, maap.get(), block_size=2**20)) as f: + return read(f, day) + except (OSError, requests.RequestException): + if attempt == 2: + raise + clock.sleep(5) + return None + + with concurrent.futures.ThreadPoolExecutor(threads) as pool: + parts = list(pool.map(read_frame, frames)) + reduced = {k: np.concatenate([p[k] for p in parts]) for k in parts[0]} + _, first = np.unique(np.round(reduced["time"], 4), return_index=True) + keep = first[(reduced["time"][first] >= 0) & (reduced["time"][first] < 86400)] + np.savez_compressed( + cache, frames=len(frames), **{k: v[keep] for k, v in reduced.items()} + ) + print(f"cached {len(frames)} frames of {product_type} in {cache.name}", flush=True) + return dict(np.load(cache)) + + +class Profiles: + """ + A day of profiles of a single-beam profiler: each profile's time (seconds from + the start of the day), its position on the ground, and the spacecraft's position. + """ + + def __init__(self, day: datetime, data: dict): + valid = ( + np.isfinite(data["time"]) + & (np.abs(data["lat"]) <= 90) + & (np.abs(data["lon"]) <= 360) + & np.all(np.isfinite(data["sc_position"]), axis=-1) + & (np.linalg.norm(data["sc_position"], axis=-1) > 6e6) + & (np.linalg.norm(data["sc_position"], axis=-1) < 8e6) + ) + order = np.argsort(data["time"][valid]) + self.day = day + self.seconds = data["time"][valid][order].astype(float) + self.lat = data["lat"][valid][order].astype(float) + self.lon = (data["lon"][valid][order].astype(float) + 180) % 360 - 180 + self.position = data["sc_position"][valid][order].astype(float) + self.time = pd.DatetimeIndex( + pd.Timestamp(day) + pd.to_timedelta(self.seconds, unit="s") + ) + period = np.diff(self.seconds) + self.gaps = [ + (self.time[i].to_pydatetime(), self.time[i + 1].to_pydatetime()) + for i in np.nonzero(period > 60)[0] + ] + + def velocity(self, frame: str) -> np.ndarray: + """Gets the spacecraft's velocity (m/s), Earth-fixed or inertial.""" + velocity = np.gradient(self.position, self.seconds, axis=0) + if frame == "inertial": + velocity = velocity + np.cross( + [0, 0, EARTH_ROTATION], self.position, axis=-1 + ) + return velocity + + def pointing(self, frame: str) -> tuple[np.ndarray, np.ndarray]: + """ + Gets each profile's angles (deg) from the geodetic nadir along track (positive + forward of the motion in the frame) and across track (positive to the left). + """ + lon, lat, _ = TO_GEODETIC.transform(*self.position.T) + zenith = up(lon, lat) + motion = self.velocity(frame) + forward = normalize(motion - np.sum(motion * zenith, axis=-1)[:, None] * zenith) + left = np.cross(zenith, forward) + ray = ecef(self.lon, self.lat) - self.position + down = -np.sum(ray * zenith, axis=-1) + along = np.degrees(np.arctan2(np.sum(ray * forward, axis=-1), down)) + cross = np.degrees(np.arctan2(np.sum(ray * left, axis=-1), down)) + return along, cross + + +def fit_pointing(profiles: Profiles) -> None: + """ + Prints the profiler's fitted pointing: the median angles along and across track + from the geodetic nadir, with their spread and their medians by latitude and + direction, in the inertial and Earth-fixed frames, and the period of profiles. + """ + ascending = np.gradient(profiles.lat) > 0 + for frame in ("inertial", "earth_fixed"): + along, cross = profiles.pointing(frame) + print( + f"{frame}: along track {np.median(along):+.4f} deg (p5 " + f"{np.percentile(along, 5):+.4f}, p95 {np.percentile(along, 95):+.4f}); " + f"across track {np.median(cross):+.4f} deg (p5 " + f"{np.percentile(cross, 5):+.4f}, p95 {np.percentile(cross, 95):+.4f})" + ) + for name, chosen in (("ascending", ascending), ("descending", ~ascending)): + bands = [] + for low in range(-90, 90, 30): + band = chosen & (profiles.lat >= low) & (profiles.lat < low + 30) + if np.any(band): + bands.append( + f"{low:+d}..{low + 30:+d}: {np.median(along[band]):+.3f}/" + f"{np.median(cross[band]):+.3f}" + ) + print(f" {name} along/across by latitude: " + ", ".join(bands)) + altitude = TO_GEODETIC.transform(*profiles.position.T)[2] + print( + f"profile period: median {np.median(np.diff(profiles.seconds)):.4f} s; " + f"altitude median {np.median(altitude) / 1e3:.2f} km " + f"(p5 {np.percentile(altitude, 5) / 1e3:.2f}, " + f"p95 {np.percentile(altitude, 95) / 1e3:.2f})" + ) + + +def track_offsets(satellite, sample: pd.DataFrame) -> np.ndarray: + """ + Gets the distances (km) across track of profiles from the predicted track of the + view's center (the ground track, for a view at nadir), near each profile's time. + """ + instrument = satellite.instruments[0] + orbit = satellite.orbit.to_gp_orbit() + offsets = np.arange(-30, 30.5, 0.5) + result = [] + for row in sample.itertuples(): + times = [ + row.time.floor("us").to_pydatetime() + timedelta(seconds=float(s)) + for s in offsets + ] + center = instrument.compute_footprint_center(orbit.get_orbit_track(times)) + xyz = ecef(center.longitude.degrees, center.latitude.degrees) + target = ecef(row.longitude, row.latitude) + k = int( + np.clip(np.argmin(np.linalg.norm(xyz - target, axis=-1)), 1, len(xyz) - 2) + ) + direction = normalize(xyz[k + 1] - xyz[k - 1]) + relative = target - xyz[k] + result.append( + np.linalg.norm(relative - np.dot(relative, direction) * direction) / 1e3 + ) + return np.array(result) + + +def find_epochs(satellite, sample: pd.DataFrame) -> np.ndarray: + """Gets the difference (s) of each profile's nearest predicted epoch, or NaN.""" + + def find(row): + time = row.time.floor("us").to_pydatetime() + found = collect_observations( + Point(latitude=row.latitude, longitude=row.longitude), + satellite, + time - timedelta(minutes=2), + time + timedelta(minutes=2), + ) + if found.empty: + return np.nan + return min( + ((e - pd.Timestamp(time)).total_seconds() for e in found.epoch), key=abs + ) + + with concurrent.futures.ThreadPoolExecutor(8) as pool: + return np.array(list(pool.map(find, sample.itertuples())), dtype=float) + + +def validate_profiler( + entry, + configuration: str, + platform: str, + profiles: Profiles, + orbit, + tle, + day: datetime, + fit_day: datetime, + record_path: pathlib.Path, + fixture_path: pathlib.Path, + source: str, + reference: str, + write: bool, + sample_size: int = 1000, + fixture_passes: int = 60, +) -> dict: + """ + Scores a profiler's configuration on a sample of a day's profiles: the share + within the view at their times (segment recall), at time steps up to 120 s, the + epochs' differences, and the distance across track from the predicted track of + the view's center. Writes the record and the reduced fixture if requested. + """ + rng = np.random.default_rng(1) + picks = np.sort(rng.choice(len(profiles.seconds), sample_size, replace=False)) + sample = pd.DataFrame( + { + "time": profiles.time[picks], + "latitude": profiles.lat[picks], + "longitude": profiles.lon[picks], + } + ) + satellite = entry.to_satellite( + orbit, configuration, time_step=TIME_STEPS[0], platform=platform + ) + offsets = track_offsets(satellite, sample) + results = {"track_offset_median": float(np.median(offsets))} + print( + f"track offset: median {np.median(offsets):.3f} km, 95th percentile " + f"{np.percentile(offsets, 95):.3f} km", + flush=True, + ) + by_step = {} + for time_step in TIME_STEPS: + satellite = entry.to_satellite( + orbit, configuration, time_step=time_step, platform=platform + ) + differences = find_epochs(satellite, sample) + found = np.isfinite(differences) + by_step[time_step] = { + "segment_recall": 100 * float(found.mean()), + "epoch_p95": float(summarize(differences[found])["p95"]), + "epoch_median": float(summarize(differences[found])["median"]), + } + print( + f" time step {time_step} s: {json.dumps(by_step[time_step])}", flush=True + ) + # the worst over the time steps + results["segment_recall"] = min(r["segment_recall"] for r in by_step.values()) + results["epoch_p95"] = max(r["epoch_p95"] for r in by_step.values()) + results["epoch_median"] = by_step[TIME_STEPS[0]]["epoch_median"] + print(json.dumps(results), flush=True) + if not write: + return results + chosen = sample.iloc[rng.choice(len(sample), fixture_passes, replace=False)] + passes = np.stack( + [ + chosen.latitude.to_numpy(), + chosen.longitude.to_numpy(), + (chosen.time - pd.Timestamp(day)).dt.total_seconds().to_numpy(), + ], + axis=-1, + ) + update_fixture( + fixture_path, tle=np.array(tle), day=np.array(day.isoformat()), passes=passes + ) + satellite = entry.to_satellite( + orbit, configuration, time_step=TIME_STEPS[0], platform=platform + ) + update_record( + record_path, + entry.id, + configuration, + { + "digest": entry.configurations[configuration].digest, + "evidence": "rerun", + "tatc_version": tatc.__version__, + "source": source, + "reference": reference, + "period": f"{day:%Y-%m-%d}", + "platform": platform, + "holdout_gap_days": get_holdout_gap(day, fit_day), + "metrics": [ + {"name": name, "value": float(results[name])} + for name in ( + "segment_recall", + "track_offset_median", + "epoch_p95", + "epoch_median", + ) + ], + "fixture_metrics": recompute_passes(satellite, 0, day, passes), + }, + ) + print(f"wrote {record_path} and {fixture_path}") + return results + + +def check_time_scale( + product_type: str, day: datetime, time_field: str, collection: str = VALIDATED +) -> None: + """ + Prints the difference (s) between the first time of a frame of a day and the + sensing start in its header, which reveals a time scale other than UTC (such as + GPS, 18 s ahead). + """ + frames = find_frames(product_type, day, collection) + _, href = frames[len(frames) // 2] + with h5py.File(RemoteFile(href, MaapSession().get(), block_size=2**20)) as f: + first = EPOCH + pd.Timedelta( + seconds=float(np.nanmin(f[time_field][:])) - LEAP_SECONDS_SINCE_2000 + ) + header = f["HeaderData/VariableProductHeader/MainProductHeader"] + start = header["sensingStartTime"][()] + # the header gives the time scale before the time, as in "UTC=2026-09-27T11:49:32" + start = (start.decode() if isinstance(start, bytes) else str(start)).split("=") + print(f"sensing start's time scale: {start[0] if len(start) > 1 else 'unstated'}") + start = pd.Timestamp(start[-1]) + if start.tzinfo is None: + start = start.tz_localize("UTC") + print( + f"first time {first.isoformat()} vs sensing start {start.isoformat()}: " + f"{(first - start).total_seconds():+.3f} s" + ) + + +__all__ = [ + "MaapSession", + "Profiles", + "check_time_scale", + "find_epochs", + "find_frames", + "fit_pointing", + "load_day", + "to_seconds", + "track_offsets", + "validate_profiler", +] diff --git a/docs/validation/gesdisc_scanner.py b/docs/validation/gesdisc_scanner.py index fe9337f..adaeeef 100644 --- a/docs/validation/gesdisc_scanner.py +++ b/docs/validation/gesdisc_scanner.py @@ -194,8 +194,12 @@ class Reference: (`line_stride`). """ - def __init__(self, day: datetime, data: dict, scan_period: float): + def __init__( + self, day: datetime, data: dict, scan_period: float, gap_threshold: float = 60 + ): + # breaks longer than the threshold (s) are periods without data self.day = day + self.gap_threshold = gap_threshold valid = np.all(np.abs(data["lat"]) <= 90, axis=1) & np.all( np.abs(data["lon"]) <= 180, axis=1 ) @@ -230,7 +234,7 @@ def __init__(self, day: datetime, data: dict, scan_period: float): self.is_next_contiguous = period < 1.5 * scan_period self.gaps = [ (self.time[i].to_pydatetime(), self.time[i + 1].to_pydatetime()) - for i in np.nonzero(period > 60)[0] + for i in np.nonzero(period > gap_threshold)[0] ] def velocity(self, frame: str) -> np.ndarray: @@ -399,6 +403,7 @@ def fit_view( pitch_angle: float, lines: int = 3000, iterations: int = 8, + instrument_pitch: bool = False, ) -> None: """ Prints the view that TAT-C centers on the outermost beams: given the body's yaw @@ -407,6 +412,8 @@ def fit_view( of view between the first and last beams, from TAT-C's view tangents, with the spacecraft's position and velocity of the product. A roll measured from the geodetic nadir (`fit`) does not center a view that is also pitched and yawed. + With `instrument_pitch`, the pitch is the instrument's (applied after its roll), + starting from `pitch_angle`, and the body is only yawed. """ contiguous = ( np.r_[False, reference.is_next_contiguous] @@ -431,29 +438,34 @@ def fit_view( for k in (0, middle, reference.beams - 1) ] roll, pitch = 0.0, pitch_angle - for _ in range(iterations): + + def tangents(roll, pitch): + body = 0.0 if instrument_pitch else pitch attitude = Attitude( - velocity_frame=velocity_frame, yaw_angle=yaw_angle, pitch_angle=pitch + velocity_frame=velocity_frame, yaw_angle=yaw_angle, pitch_angle=body ) - (a0, c0), (am, _), (a1, c1) = ( + return [ compute_view_tangents( - track, target, velocity_frame, roll, 0, attitude=attitude + track, + target, + velocity_frame, + roll, + pitch if instrument_pitch else 0, + attitude=attitude, ) for target in targets - ) + ] + + for _ in range(iterations): + (a0, c0), (am, _), (a1, c1) = tangents(roll, pitch) roll += float(np.degrees(np.arctan(np.median((c0 + c1) / 2)))) pitch += float(np.degrees(np.arctan(np.median(am)))) - attitude = Attitude( - velocity_frame=velocity_frame, yaw_angle=yaw_angle, pitch_angle=pitch - ) - (a0, c0), (am, cm), (a1, c1) = ( - compute_view_tangents(track, target, velocity_frame, roll, 0, attitude=attitude) - for target in targets - ) + (a0, c0), (am, cm), (a1, c1) = tangents(roll, pitch) width = 2 * np.degrees(np.arctan(np.median(np.abs(c0 - c1)) / 2)) slope = np.degrees(np.arctan(np.median((a0 - a1) / (c0 - c1)))) print( - f"{frame} view, with yaw {yaw_angle:.4f} deg: roll {roll:.4f} deg, pitch " + f"{frame} view, with yaw {yaw_angle:.4f} deg: roll {roll:.4f} deg, " + f"{'instrument' if instrument_pitch else 'body'} pitch " f"{pitch:.4f} deg, cross-track field of view {width:.4f} deg; remaining " f"across tangents of the ends p5..p95 {np.percentile(c0, 5):+.5f}..." f"{np.percentile(c0, 95):+.5f} and {np.percentile(c1, 5):+.5f}..." @@ -547,8 +559,8 @@ def score_swath_width( def longest_span(reference: Reference, period: float) -> np.ndarray: """ - Gets the scans of the longest span of data, of at most an orbit's period (s), - without a gap of more than a minute, for products that do not cover whole orbits. + Gets the scans of the longest span of data, of at most a period (s), without a gap + of more than a minute. """ breaks = np.nonzero(np.diff(reference.seconds) >= 60)[0] + 1 spans = np.split(np.arange(len(reference.seconds)), breaks) @@ -557,12 +569,19 @@ def longest_span(reference: Reference, period: float) -> np.ndarray: def observe_orbit(reference: Reference, orbit, grid, radius: float): - """Gets the cells compared over one orbit, and which of them were observed.""" + """ + Gets the cells compared over a span of the day's data, and which of them were + observed. The span is not one orbit but the rest of the data from noon (or from + the first later start, in steps of 10 minutes until 22:00, after which no gap of a + minute or more remains), or else the longest span without such a gap. + """ lon, lat, _ = grid unit = up(lon, lat) begin = pd.Timestamp(reference.day) + pd.Timedelta(hours=12) + # the span is bounded by 1 / mean motion days; TAT-C's mean motion is in deg/s, + # so this bound (about 15 days) exceeds the data, and every record scored with + # this function compares the span described above, rather than one orbit period = pd.Timedelta(days=1 / orbit.elements[0].mean_motion) - # the first orbit from noon without a gap of more than a minute while True: scans = np.nonzero( (reference.time >= begin) & (reference.time < begin + period) @@ -573,22 +592,39 @@ def observe_orbit(reference: Reference, orbit, grid, radius: float): if begin > pd.Timestamp(reference.day) + pd.Timedelta(hours=22): scans = longest_span(reference, period.total_seconds()) print( - "no orbit without a gap; the longest span without one lasts " - f"{np.ptp(reference.seconds[scans]) / 60:.1f} min", + "no span from noon without a gap; the longest span without one " + f"lasts {np.ptp(reference.seconds[scans]) / 60:.1f} min", flush=True, ) break first, last = reference.time[scans[0]], reference.time[scans[-1]] - distance, nearest = cKDTree(reference.unit[scans].reshape(-1, 3)).query( - unit, workers=-1 + chord = 2 * np.sin(radius / 6371 / 2) + # bounding the search keeps it fast for cells far from the span's thin swath, + # which are not compared (their distance is infinite, their index out of range) + vertices = reference.unit[scans].reshape(-1, 3) + distance, nearest = cKDTree(vertices).query( + unit, distance_upper_bound=chord, workers=-1 ) elapsed = reference.seconds[scans] - reference.seconds[scans[0]] - nearest_time = elapsed[nearest // reference.beams] + nearest_scan = np.minimum(nearest, len(vertices) - 1) // reference.beams + nearest_time = elapsed[nearest_scan] compared = ( - (distance < 2 * np.sin(radius / 6371 / 2)) + (distance < chord) & (nearest_time > ORBIT_MARGIN) & (nearest_time < (last - first).total_seconds() - ORBIT_MARGIN) ) + if reference.gap_threshold < 60: + # cells nearest the scans on either side of a shorter period without data + # (as the strip it leaves unimaged) are not compared + breaks = np.nonzero(np.diff(elapsed) > reference.gap_threshold)[0] + bordering = np.zeros(len(scans), dtype=bool) + bordering[breaks] = bordering[breaks + 1] = True + compared &= ~bordering[nearest_scan] + print( + f"{len(breaks)} periods without data over {reference.gap_threshold} s in " + "the span compared", + flush=True, + ) observed = np.zeros(len(unit), dtype=bool) observed[compared] = reference.in_cells(unit[compared], scans[0], scans[-1]) return first.to_pydatetime(), last.to_pydatetime(), compared, observed diff --git a/docs/validation/standard.rst b/docs/validation/standard.rst index 18b0a22..b03c03d 100644 --- a/docs/validation/standard.rst +++ b/docs/validation/standard.rst @@ -7,7 +7,7 @@ entry must show before it is called validated, so that entries can be compared and the claim means the same for each. An entry's tier is computed from its results and these thresholds, and cannot be declared. -This is version 5 of the standard. The thresholds of version 1 were drafted from +This is version 6 of the standard. The thresholds of version 1 were drafted from the earlier results below, so they can show little about those instruments. They were frozen before validating instruments new to TAT-C, which are their first real test. Changing a threshold requires a new version and a stated reason here. @@ -50,6 +50,14 @@ Versions union of the predicted field of regard with the area imaged in a scan, at least 0.95, as for swaths. No threshold of earlier versions changed, so their results still apply. The gate was frozen before any TEMPO data were analyzed. + * - 6 + - Adds the profiler class, for single-beam atmospheric profilers near nadir + (EarthCARE's ATLID lidar and CPR radar), which observe a narrow track, as + altimeters do, but are neither altimeters nor multi-beam lidars, whose beam + spacing gate needs several beams. Its gates are those of the altimeter + class, so that a class filter does not mix the two. No threshold of earlier + versions changed, so their results still apply. The gates were adopted + before any profiler data were analyzed. Rules ===== @@ -96,8 +104,11 @@ epoch gate. Cross-track and conical instruments also need a configuration at the sample size grade. Orbit error against recorded positions is reported but not gated, because it grades the element set rather than the instrument. -Lidar and altimeter gates are separate, because they observe narrow tracks -rather than a swath: +Lidar, altimeter, and profiler gates are separate, because they observe narrow +tracks rather than a swath. Profilers take the altimeter's gates, with the track +offset measured from the predicted track of the view's center, which is the ground +track for a view at nadir; a profiler pointed off nadir (ATLID, a few degrees behind) +observes a track displaced from the ground track by the Earth's rotation: .. list-table:: :header-rows: 1 @@ -211,7 +222,8 @@ rather than a swath: Pushbroom imagers, SAR, and lidar have no precision gate because they acquire or point according to plans, so a predicted observation that was not made is not an error of geometry. Nor do altimeters, whose products omit measurements by surface -and quality, or scatterometers, whose wind products omit land and sea ice. +and quality, profilers, whose products omit profiles by quality and mode, or +scatterometers, whose wind products omit land and sea ice. A swath's IoU is measured at several time steps, up to 120 s, and gated at the lowest. Configurations whose instruments are swept (`is_swept`), as every diff --git a/docs/validation/summary.rst b/docs/validation/summary.rst index 5655cb3..f18fd64 100644 --- a/docs/validation/summary.rst +++ b/docs/validation/summary.rst @@ -65,7 +65,7 @@ Instruments and Pointing - Result * - Cross-track scanners (`PointedInstrument`, `ViewGeometry.SCAN`) - NOAA-20 ATMS, CrIS, and VIIRS; Terra and Aqua MODIS; Metop-B IASI; GPM DPR; Metop-C MHS and AVHRR; Aqua - AIRS and AMSU-A; PACE OCI; NOAA-20 CERES; ISS ECOSTRESS + AIRS and AMSU-A; PACE OCI; NOAA-20 CERES; ISS ECOSTRESS; TRMM PR and VIRS - On held-out data, 99.8 to 100% of passes predicted (ATMS, CrIS, VIIRS, MODIS, IASI, DPR); epochs within 0.25 s (ATMS), 0.40 s (CrIS), 0.44 s (MODIS), 0.60 s (DPR), and 2.0 s (VIIRS) at the 95th percentile; swath width within 0.20 to 3.3 km (median) with measured fields of regard; pixel centers within 1.4 to 2.9 km (median; @@ -91,10 +91,13 @@ Instruments and Pointing percentile), and swath IoU 0.999, but swath width within 7.9 km (median), its edges 60 deg from nadir; ECOSTRESS, with fitted yaw and pitch and its view centered in TAT-C's frame, had 98.4% of predicted passes observed, epochs within 0.72 s, swath width within 0.62 km, and swath IoU 0.988, but predicted 98.9% of observed passes - (:doc:`catalog`) + (:doc:`catalog`). On data of TRMM held out 39 days from the fit, PR and VIRS predicted 99.89 and 99.81% of + passes, with epochs within 0.48 and 0.59 s (95th percentile), swath width within 0.07 and 0.24 km, swath IoU + 0.997 and 0.994, and pixel centers within 1.4 and 2.2 km (median); PR's published footprint of 5.0 km at the + scan's edge lies 7.9% below the size its beam width gives (:doc:`catalog`) * - Pushbroom imagers (`PointedInstrument`) - Sentinel-2 MSI, Landsat 9 OLI, Sentinel-5P TROPOMI, Sentinel-3A OLCI, PACE HARP2 and SPEXone, NOAA-20 and - NOAA-21 OMPS Nadir Mapper, OCO-2, ISS EMIT + NOAA-21 OMPS Nadir Mapper, OCO-2, ISS EMIT, EarthCARE MSI and BBR - On held-out data, 99.8% or more of passes predicted; swath width within 0.1 to 2.0 km and swath IoU 0.99 or more (median); epochs within 1.3 s (OLI), 2.1 s (TROPOMI), and 2.6 s (MSI, one view) at the 95th percentile (:doc:`catalog`). MSI's epochs within @@ -109,16 +112,25 @@ Instruments and Pointing (:doc:`catalog`). EMIT, with fitted yaw and pitch and its view centered in TAT-C's frame, observed 94.6% of sampled pixels on held-out data, with epochs within 0.25 s and swath width within 0.05 km, but missed pixels within about 1.5 km of one edge of its 75 km swath, and swath IoU was 0.925; with its roll measured from - the geodetic nadir instead, its view had lain 4.0 to 4.5 km to one side (:doc:`catalog`) + the geodetic nadir instead, its view had lain 4.0 to 4.5 km to one side (:doc:`catalog`). On EarthCARE data + held out 41 days from the fit, MSI (rolled 5.6 deg away from the sun) predicted 99.55% of passes, with epochs + within 0.50 s (95th percentile), swath width within 0.22 km, and swath IoU 0.989. BBR's three views (about + 50 deg aft, nadir, and 50 deg fore), with breaks in its data over 1 s as periods without data, predicted 95.5 + to 97.9% of passes, with epochs within 0.52 s (95th percentile), swath width within 0.04 km, and swath IoU + 0.921 to 0.954, against 99.2 to 99.5% and 0.983 to 0.990 on the day of the fit, with the element set nearest + the day's middle that put ATLID's and CPR's profiles 0.72 km from their track; with the day's other element + set, swath IoU 0.963 to 0.978, but still 97.5 to 98.6% of passes predicted (:doc:`catalog`) * - Conical scanners (`ConicalInstrument`) - - GCOM-W AMSR2, GPM GMI, SMAP radiometer, DMSP F18 SSMIS + - GCOM-W AMSR2, GPM GMI, SMAP radiometer, DMSP F18 SSMIS, TRMM TMI - 99.95 to 100% of passes, epochs within 0.27 s (AMSR2) and 0.69 s (GMI) at the 95th percentile; swath IoU 0.998 to 0.999; SMAP's forward and aft looks within 0.2 s (median) (:doc:`ValidateConicalAMSR2`, :doc:`ValidateConicalGMI`, :doc:`ValidateGridSMAP`). On held-out AMSR2 data, 99.98% of passes predicted, epochs within 0.79 s (95th percentile), swath width within 2.8 km, and swath IoU 0.998; on held-out SMAP Level 1B footprints, 100% of passes predicted with both looks, epochs within 0.14 s (95th percentile), swath width within 2.1 km, and swath IoU 0.998; on held-out SSMIS data, 99.7% of passes predicted, epochs within 0.51 s - (95th percentile), swath width within 2.6 km, and swath IoU 0.992 (:doc:`catalog`) + (95th percentile), swath width within 2.6 km, and swath IoU 0.992 (:doc:`catalog`). TMI's three feeds, on + held-out data: 99.66 to 99.80% of passes predicted, epochs within 0.75 s (95th percentile), swath width within + 2.9 km, and swath IoU 0.995 or more (:doc:`catalog`) * - Side-looking SAR (`PointedInstrument` with roll, `roll_angle_profile`) - NISAR, Sentinel-1C - Epochs within 0.3 and 0.44 s (95th percentile) of zero-Doppler times; footprint IoU 0.93 to 0.96 (median); roll @@ -158,6 +170,12 @@ Instruments and Pointing - With a view 0.43 deg wide, every sampled segment of the ground track observed, the track within 0.14 km (median) and epochs within 0.12 s (95th percentile); on Sentinel-6B, as a transfer, the track within 0.11 km and epochs within 0.11 s (:doc:`catalog`) + * - Profilers + - EarthCARE ATLID and CPR + - With views about 10 km wide (ATLID's pitched 3.05 deg behind nadir), on held-out data every sampled profile + within its view, and epochs within 0.46 and 0.48 s (95th percentile), but profiles 0.72 km (median) from the + predicted track with the element set nearest the day's middle, whose inclination differed by 0.01 deg from + those of the sets around it; with the day's other element set, 0.33 km (:doc:`catalog`) * - Geostationary imagers - GOES-19 ABI, Himawari-9 AHI, TEMPO - A 17.4 deg field of regard observes the full disk; elevation angles within 0.0004 deg; product coverage limits diff --git a/docs/validation/trmm_2013-05-20.3le b/docs/validation/trmm_2013-05-20.3le new file mode 100644 index 0000000..2d401a8 --- /dev/null +++ b/docs/validation/trmm_2013-05-20.3le @@ -0,0 +1,159 @@ +0 TRMM +1 25063U 97074A 13140.52808031 .00022369 00000+0 30741-3 0 3273 +2 25063 34.9589 217.6510 0000349 281.4816 184.7439 15.56316198883497 +0 TRMM +1 25063U 97074A 13141.56249583 .00022440 00000+0 30790-3 0 3284 +2 25063 34.9588 210.8048 0000295 268.7459 242.9592 15.56358341883659 +0 TRMM +1 25063U 97074A 13142.30519303 .00007178 00000+0 10000-3 0 3291 +2 25063 34.9570 205.8905 0015037 106.5100 252.4227 15.56001007883765 +0 TRMM +1 25063U 97074A 13142.58274557 .00018507 00000+0 25986-3 0 3309 +2 25063 34.9585 204.0579 0001146 251.9350 223.9064 15.55763715883815 +0 TRMM +1 25063U 97074A 13144.17260700 .00023555 00000+0 32955-3 0 3315 +2 25063 34.9576 193.5430 0001081 249.0399 146.5197 15.55826626884068 +0 TRMM +1 25063U 97074A 13145.47609994 .00019296 00000+0 26965-3 0 3323 +2 25063 34.9574 184.9215 0001052 250.4099 258.5085 15.55886531884265 +0 TRMM +1 25063U 97074A 13146.50258894 .00018095 00000+0 25249-3 0 3338 +2 25063 34.9576 178.1314 0001052 250.1466 258.1752 15.55935287884425 +0 TRMM +1 25063U 97074A 13147.52607207 .00017145 00000+0 23895-3 0 3348 +2 25063 34.9578 171.3609 0001053 249.6794 241.3463 15.55974166884586 +0 TRMM +1 25063U 97074A 13149.11752728 .00015560 00000+0 21654-3 0 3355 +2 25063 34.9581 160.8327 0001094 245.8428 175.0257 15.56028231884833 +0 TRMM +1 25063U 97074A 13150.14526883 .00016064 00000+0 22326-3 0 3369 +2 25063 34.9583 154.0333 0001119 244.7281 183.0768 15.56059187884997 +0 TRMM +1 25063U 97074A 13151.17268545 .00019008 00000+0 26365-3 0 3370 +2 25063 34.9582 147.2362 0001117 244.0877 188.9412 15.56089102885153 +0 TRMM +1 25063U 97074A 13152.39985911 .00018488 00000+0 25602-3 0 3383 +2 25063 34.9582 139.1169 0001146 244.8451 234.4665 15.56137402885341 +0 TRMM +1 25063U 97074A 13154.12387291 .00017778 00000+0 24557-3 0 3393 +2 25063 34.9583 127.7089 0001231 243.7947 190.2415 15.56209703885615 +0 TRMM +1 25063U 97074A 13155.14835556 .00012213 00000+0 16880-3 0 3409 +2 25063 34.9584 120.9291 0001286 243.2264 180.1374 15.56247475885770 +0 TRMM +1 25063U 97074A 13156.24734649 .00011716 00000+0 16519-3 0 3419 +2 25063 34.9591 113.6595 0000684 238.4328 231.5102 15.55717806885940 +0 TRMM +1 25063U 97074A 13157.28160795 .00015883 00000+0 22329-3 0 3425 +2 25063 34.9591 106.8201 0000809 232.5078 279.7822 15.55751425886101 +0 TRMM +1 25063U 97074A 13159.13770333 .00013889 00000+0 19488-3 0 3433 +2 25063 34.9594 94.5464 0000966 227.4709 258.1264 15.55823351886396 +0 TRMM +1 25063U 97074A 13160.16629444 .00013670 00000+0 19164-3 0 3444 +2 25063 34.9595 87.7441 0001088 227.8186 268.7215 15.55850098886554 +0 TRMM +1 25063U 97074A 13161.18939752 .00014154 00000+0 19814-3 0 3454 +2 25063 34.9595 80.9777 0001152 230.3164 246.4699 15.55883322886711 +0 TRMM +1 25063U 97074A 13162.84818233 .00012673 00000+0 17724-3 0 3461 +2 25063 34.9593 70.0064 0001304 234.1648 189.6703 15.55924234886976 +0 TRMM +1 25063U 97074A 13164.14100627 .00011929 00000+0 16670-3 0 3470 +2 25063 34.9595 61.4546 0001480 236.8026 240.9370 15.55955692887177 +0 TRMM +1 25063U 97074A 13166.07057037 .00010872 00000+0 15174-3 0 3485 +2 25063 34.9598 48.6909 0001655 243.0924 261.5021 15.56004418887478 +0 TRMM +1 25063U 97074A 13167.09267128 .00011954 00000+0 16657-3 0 3492 +2 25063 34.9599 41.9296 0001711 247.9761 231.8053 15.56033077887635 +0 TRMM +1 25063U 97074A 13168.81676997 .00013453 00000+0 18703-3 0 3503 +2 25063 34.9602 30.5235 0001807 254.2983 179.9441 15.56075420887901 +0 TRMM +1 25063U 97074A 13170.59986881 .00019995 00000+0 27602-3 0 3524 +2 25063 34.9595 18.7271 0001760 269.3991 90.7045 15.56133877888186 +0 TRMM +1 25063U 97074A 13171.88292560 .00001095 00000+0 15122-4 0 3551 +2 25063 34.9593 10.2371 0001812 269.0360 91.0670 15.56131365888387 +0 TRMM +1 25063U 97074A 13171.90850667 .00013272 00000+0 18704-3 0 3516 +2 25063 34.9596 10.0695 0000948 267.4117 235.9193 15.55712282888389 +0 TRMM +1 25063U 97074A 13172.99760271 .00017963 00000+0 25231-3 0 3522 +2 25063 34.9596 2.8673 0000977 266.3236 227.0035 15.55757588888550 +0 TRMM +1 25063U 97074A 13174.79129009 .00018255 00000+0 25576-3 0 3538 +2 25063 34.9598 351.0056 0000940 271.4015 205.1475 15.55825142888836 +0 TRMM +1 25063U 97074A 13175.82231521 .00020195 00000+0 28234-3 0 3547 +2 25063 34.9600 344.1871 0000955 274.0966 227.0726 15.55868080888995 +0 TRMM +1 25063U 97074A 13176.91153433 .00016135 00000+0 22552-3 0 3550 +2 25063 34.9600 336.9832 0000937 273.3084 219.1466 15.55905618889166 +0 TRMM +1 25063U 97074A 13178.83382148 .00016475 00000+0 22982-3 0 3565 +2 25063 34.9596 324.2686 0000928 274.7334 203.4234 15.55955734889466 +0 TRMM +1 25063U 97074A 13179.86354984 .00011982 00000+0 16721-3 0 3579 +2 25063 34.9594 317.4568 0000890 270.7501 225.2235 15.55993152889624 +0 TRMM +1 25063U 97074A 13180.82512491 .00011259 00000+0 15695-3 0 3583 +2 25063 34.9593 311.0956 0000866 270.5537 220.9606 15.56032962889778 +0 TRMM +1 25063U 97074A 13182.48225934 .00012058 00000+0 16772-3 0 3596 +2 25063 34.9594 300.1326 0000822 270.6796 159.5382 15.56079575890039 +0 TRMM +1 25063U 97074A 13183.70919156 .00011961 00000+0 16620-3 0 3604 +2 25063 34.9594 292.0157 0000758 274.3608 200.7280 15.56109103890229 +0 TRMM +1 25063U 97074A 13185.29268551 -.00039199 00000+0 00000+0 0 3612 +2 25063 34.9501 281.4902 0001703 352.9118 7.2132 15.55917333890471 +0 TRMM +1 25063U 97074A 13185.70013348 .00022500 00000+0 31602-3 0 3613 +2 25063 34.9593 278.8483 0001354 270.4170 215.4735 15.55728461890531 +0 TRMM +1 25063U 97074A 13186.45858125 .00014070 00000+0 19800-3 0 3626 +2 25063 34.9589 273.8330 0001260 264.6530 156.2470 15.55742712890659 +0 TRMM +1 25063U 97074A 13187.49604528 .00010534 00000+0 14828-3 0 3634 +2 25063 34.9585 266.9725 0001196 264.1758 217.1578 15.55779916890811 +0 TRMM +1 25063U 97074A 13187.69083627 .00012978 00000+0 18235-3 0 3648 +2 25063 34.9584 265.6844 0001186 265.9512 228.2216 15.55796297890840 +0 TRMM +1 25063U 97074A 13189.48451179 .00014202 00000+0 19908-3 0 3659 +2 25063 34.9578 253.8222 0001122 267.8489 209.6936 15.55846128891129 +0 TRMM +1 25063U 97074A 13190.50948453 .00014288 00000+0 20009-3 0 3669 +2 25063 34.9577 247.0431 0001083 270.4868 197.7777 15.55870883891284 +0 TRMM +1 25063U 97074A 13191.53714675 .00013972 00000+0 19544-3 0 3672 +2 25063 34.9577 240.2457 0001034 271.9159 202.2509 15.55906296891443 +0 TRMM +1 25063U 97074A 13192.56605543 .00013859 00000+0 19356-3 0 3685 +2 25063 34.9577 233.4395 0000990 270.8711 216.3373 15.55949196891609 +0 TRMM +1 25063U 97074A 13194.15799227 .00013601 00000+0 18965-3 0 3696 +2 25063 34.9578 222.9084 0000905 267.9173 151.6636 15.55994951891852 +0 TRMM +1 25063U 97074A 13195.18577647 .00015909 00000+0 22137-3 0 3701 +2 25063 34.9578 216.1093 0000841 263.8018 162.8367 15.56029143892016 +0 TRMM +1 25063U 97074A 13196.47853462 .00012424 00000+0 17274-3 0 3712 +2 25063 34.9578 207.5569 0000780 263.1967 217.5244 15.56086056892216 +0 TRMM +1 25063U 97074A 13197.44037573 .00016727 00000+0 23194-3 0 3726 +2 25063 34.9577 201.1931 0000761 258.4479 219.6307 15.56116350892362 +0 TRMM +1 25063U 97074A 13199.16455744 .00014624 00000+0 20256-3 0 3732 +2 25063 34.9575 189.7843 0000751 246.4136 187.1400 15.56164497892637 +0 TRMM +1 25063U 97074A 13200.39194786 .00017714 00000+0 24923-3 0 3745 +2 25063 34.9583 181.6641 0000645 253.2770 226.8273 15.55715312892822 +0 TRMM +1 25063U 97074A 13200.94807878 .00007167 00000+0 10000-3 0 3752 +2 25063 34.9572 177.9481 0017244 55.0617 305.3549 15.55917046892918 +0 TRMM +1 25063U 97074A 13201.15371807 .00018238 00000+0 25628-3 0 3779 +2 25063 34.9577 176.6276 0001190 239.4155 194.3359 15.55743978892948 diff --git a/docs/validation/validate_catalog_atlid.py b/docs/validation/validate_catalog_atlid.py new file mode 100644 index 0000000..f772431 --- /dev/null +++ b/docs/validation/validate_catalog_atlid.py @@ -0,0 +1,110 @@ +""" +Validates the ATLID catalog entry against EarthCARE's Level 1B ATLID product +(ATL_NOM_1B), using the exact values of the entry through public TAT-C methods. ATLID +is a single-beam lidar, pointed a few degrees behind nadir. Its pointing is fitted to +the positions of the profiles on one day (run with `--fit`), from the sensor positions +the product records, so the fit needs no element set; running on a day at least 30 +days from it tests the fitted pointing on data held out from the fit. A sample of a +day's profiles is scored as for the profiler class: whether the view observes each +within two minutes of its time, the epoch's difference, and its distance across track +from the predicted track of the view's center. + +Needs the `validation` extra and a MAAP offline token in `ESA_MAAP_KEY`. Only the +profiles' times and positions are read, with range requests: + + python docs/validation/validate_catalog_atlid.py 2026-09-27 --fit + python docs/validation/validate_catalog_atlid.py 2026-11-07 + +With `--write`, it writes the entry's validation record and the reduced fixture from +which unit tests recompute the results. + +@author: Paul T. Grogan +""" + +import argparse +import pathlib +from datetime import datetime, timezone + +import numpy as np + +from tatc.catalog import get_entry +from tatc.schemas import GeneralPerturbationsOrbit +from earthcare_io import ( + Profiles, + check_time_scale, + fit_pointing, + load_day, + to_seconds, + validate_profiler, +) +from validation_io import ecef, read_element_set_file + +REPOSITORY = pathlib.Path(__file__).resolve().parents[2] +RECORD_PATH = REPOSITORY / "src" / "tatc" / "resources" / "validation" / "atlid.json" +FIXTURE_PATH = REPOSITORY / "tests" / "catalog" / "fixtures" / "atlid.npz" +NORAD_ID = 59908 +FIT_DAY = datetime(2026, 9, 27, tzinfo=timezone.utc) +ELEMENT_SET_FILE = REPOSITORY / "docs" / "validation" / "earthcare_2026-09-27.3le" +PLATFORM = "earthcare" +CONFIGURATION = "profile" + + +def read_atlid(f, day: datetime) -> dict: + """Reads the times and positions of a frame's profiles.""" + g = f["ScienceData"] + return { + "time": to_seconds(g["time"][:], day), + "lat": g["ellipsoid_latitude"][:], + "lon": g["ellipsoid_longitude"][:], + "sc_position": ecef( + g["sensor_longitude"][:], + g["sensor_latitude"][:], + g["sensor_altitude"][:].astype(float), + ), + } + + +def main() -> None: + """Validates the entry on a day of data, or fits its pointing.""" + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("directory", type=pathlib.Path) + parser.add_argument("day") + parser.add_argument("--fit", action="store_true") + parser.add_argument("--write", action="store_true") + arguments = parser.parse_args() + arguments.directory.mkdir(parents=True, exist_ok=True) + day = datetime.fromisoformat(arguments.day).replace(tzinfo=timezone.utc) + data = load_day("ATL_NOM_1B", day, arguments.directory, read_atlid) + profiles = Profiles(day, data) + print( + f"{arguments.day}: {len(profiles.seconds)} profiles from {int(data['frames'])} " + f"frames, {len(profiles.gaps)} gaps over a minute", + flush=True, + ) + if arguments.fit: + check_time_scale("ATL_NOM_1B", day, "ScienceData/time") + fit_pointing(profiles) + return + tle = read_element_set_file(ELEMENT_SET_FILE, NORAD_ID, day) + print(f"element set: {tle[0][:32]}", flush=True) + orbit = GeneralPerturbationsOrbit.from_tle(tle) + validate_profiler( + get_entry("atlid"), + CONFIGURATION, + PLATFORM, + profiles, + orbit, + tle, + day, + FIT_DAY, + RECORD_PATH, + FIXTURE_PATH, + "docs/validation/validate_catalog_atlid.py", + "ATL_NOM_1B (profile positions and times)", + arguments.write, + ) + + +if __name__ == "__main__": + np.seterr(invalid="ignore") + main() diff --git a/docs/validation/validate_catalog_bbr.py b/docs/validation/validate_catalog_bbr.py new file mode 100644 index 0000000..b57656a --- /dev/null +++ b/docs/validation/validate_catalog_bbr.py @@ -0,0 +1,260 @@ +""" +Validates the BBR catalog entry against EarthCARE's Level 1B BBR product of single +pixels (BBR_SNG_1B), using the exact values of the entry through public TAT-C methods. +BBR has three fixed telescopes, viewing about 50 deg behind (aft), at, and about 50 +deg ahead of (fore) nadir along track, each imaging a line of 30 pixels. The product +gives each pixel's position, each line's time, and the platform's position at it, by +view, so the fit needs no element set. The views' angles are fitted to one day (run +with `--fit`, then `--fit-view` to center each view in TAT-C's frame with its pitch): +running on a day at least 30 days from it tests the fitted angles on data held out +from the fit. Each view's swath is scored as for other pushbroom swaths: passes of +points within the lattice of its pixels, the swath width, and the swath area over a +span of the day. The views break for about 4.3 s about every 93 s (about 5% of the +day); these breaks, like longer ones, are periods without data, outside which passes +are scored and swath areas compared. + +Needs the `validation` extra and a MAAP offline token in `ESA_MAAP_KEY`. Only the +pixels' positions and the lines' times are read (of the shortwave band, every second +line), with range requests: + + python docs/validation/validate_catalog_bbr.py 2026-09-27 --fit + python docs/validation/validate_catalog_bbr.py 2026-09-27 --fit-view + python docs/validation/validate_catalog_bbr.py 2026-11-07 + +With `--write`, it writes the entry's validation record and the reduced fixture from +which unit tests recompute the results. + +@author: Paul T. Grogan +""" + +import argparse +import json +import pathlib +from datetime import datetime, timedelta, timezone + +import numpy as np +import pandas as pd + +import tatc +from tatc.catalog import get_entry +from tatc.generation import generate_points_fibonacci_lattice +from tatc.schemas import GeneralPerturbationsOrbit +from earthcare_io import check_time_scale, load_day, to_seconds +from gesdisc_scanner import ( + Reference, + fit, + fit_view, + fit_yaw, + observe_orbit, + score_swath_width, +) +from validation_io import ( + build_grid, + get_holdout_gap, + read_element_set_file, + recompute_passes, + score_passes, + score_swath_area, + update_fixture, + update_record, +) + +REPOSITORY = pathlib.Path(__file__).resolve().parents[2] +RECORD_PATH = REPOSITORY / "src" / "tatc" / "resources" / "validation" / "bbr.json" +FIXTURE_PATH = REPOSITORY / "tests" / "catalog" / "fixtures" / "bbr.npz" +NORAD_ID = 59908 +FIT_DAY = datetime(2026, 9, 27, tzinfo=timezone.utc) +ELEMENT_SET_FILE = REPOSITORY / "docs" / "validation" / "earthcare_2026-09-27.3le" +PLATFORM = "earthcare" +CONFIGURATION = "views" +PRODUCT = "BBR_SNG_1B" +# the product's order of views, and the nominal pitch (deg) from which each is fitted +VIEWS = {"AFT": -50.0, "NADIR": 0.0, "FORE": 50.0} +BAND = 0 +LINE_STRIDE = 2 +TIME_STEPS = (10, 30, 120) +POINT_SPACING = 100e3 +PASS_RADIUS = 15 # km +# the product's views break for about 4.3 s about every 93 s, periods without data +# like those over a minute in other products +GAP_THRESHOLD = 1.0 # s +FIXTURE_PASSES = 60 +WIDTH_STRIDE = 50 + + +def read_bbr(f, day: datetime) -> dict: + """Reads each view's pixel positions, line times, and platform positions.""" + g = f["ScienceData"] + lines = np.arange(0, g["time"].shape[-1], LINE_STRIDE) + time = to_seconds(g["time"][:, BAND, :], day) + part = {"time": time[1, lines]} + for v, view in enumerate(VIEWS): + part[f"time_{view}"] = time[v, lines] + part[f"lat_{view}"] = g["latitude"][v, BAND][lines] + part[f"lon_{view}"] = g["longitude"][v, BAND][lines] + part[f"sc_lat_{view}"] = g["platform_latitude"][v, BAND][lines] + part[f"sc_lon_{view}"] = g["platform_longitude"][v, BAND][lines] + part[f"sc_alt_{view}"] = g["platform_altitude"][v, BAND][lines] + return part + + +def load_references(day: datetime, directory: pathlib.Path) -> dict[str, Reference]: + """Loads a day, as a reference for each view, in the order of its own times.""" + data = load_day(PRODUCT, day, directory, read_bbr) + references = {} + for view in VIEWS: + seconds = data[f"time_{view}"] + order = np.argsort(seconds) + keep = order[(seconds[order] >= 0) & (seconds[order] < 86400)] + _, unique = np.unique(np.round(seconds[keep], 4), return_index=True) + keep = keep[unique] + part = { + "time": seconds[keep], + "lat": data[f"lat_{view}"][keep], + "lon": data[f"lon_{view}"][keep], + "sc_lat": data[f"sc_lat_{view}"][keep], + "sc_lon": data[f"sc_lon_{view}"][keep], + "sc_alt": data[f"sc_alt_{view}"][keep], + } + period = float(np.median(np.diff(part["time"]))) + references[view] = Reference(day, part, period, GAP_THRESHOLD) + return references + + +def validate(day, tle, entry, orbit, references, write: bool) -> None: + """ + Scores each view of the configuration on its pixels, and writes the results if + requested, with the fixture of the nadir view's passes. + """ + + def satellite_for(time_step: float): + return entry.to_satellite( + orbit, CONFIGURATION, time_step=time_step, platform=PLATFORM + ) + + satellite = satellite_for(TIME_STEPS[0]) + points = generate_points_fibonacci_lattice(POINT_SPACING) + grid = build_grid() + metrics, nadir_observed = [], None + for index, view in enumerate(VIEWS): + reference = references[view] + observed = reference.observe_passes(points, PASS_RADIUS) + start = reference.time[0].to_pydatetime() + end = reference.time[-1].to_pydatetime() + timedelta( + seconds=reference.scan_period + ) + results = score_passes( + points, satellite, index, observed, start, end, reference.gaps + ) + results["swath_width_median"] = score_swath_width( + reference, + satellite.instruments[index], + orbit, + WIDTH_STRIDE, + satellite.attitude, + ) + first, last, compared, covered = observe_orbit( + reference, orbit, grid, 2 * PASS_RADIUS + ) + results["footprint_iou_median"] = score_swath_area( + satellite_for, index, first, last, TIME_STEPS, grid, compared, covered + ) + print(view, json.dumps(results), flush=True) + metrics += [ + {"name": name, "value": float(results[name]), "scope": view} + for name in ( + "pass_recall", + "pass_precision", + "epoch_p95", + "swath_width_median", + "footprint_iou_median", + ) + ] + if view == "NADIR": + nadir_observed = observed + if not write: + return + rng = np.random.default_rng(1) + picks = nadir_observed.iloc[ + rng.choice(len(nadir_observed), FIXTURE_PASSES, replace=False) + ] + points_lat = points.geometry.y.to_numpy() + points_lon = points.geometry.x.to_numpy() + passes = np.stack( + [ + points_lat[picks.point_id], + points_lon[picks.point_id], + (picks.time - pd.Timestamp(day)).dt.total_seconds().to_numpy(), + ], + axis=-1, + ) + update_fixture( + FIXTURE_PATH, tle=np.array(tle), day=np.array(day.isoformat()), passes=passes + ) + nadir = list(VIEWS).index("NADIR") + update_record( + RECORD_PATH, + "bbr", + CONFIGURATION, + { + "digest": entry.configurations[CONFIGURATION].digest, + "evidence": "rerun", + "tatc_version": tatc.__version__, + "source": "docs/validation/validate_catalog_bbr.py", + "reference": f"{PRODUCT} (pixel positions of the shortwave band, every " + "second line)", + "period": f"{day:%Y-%m-%d}", + "platform": PLATFORM, + "holdout_gap_days": get_holdout_gap(day, FIT_DAY), + "metrics": metrics, + "fixture_metrics": recompute_passes(satellite, nadir, day, passes), + }, + ) + print(f"wrote {RECORD_PATH} and {FIXTURE_PATH}") + + +def main() -> None: + """Validates the entry on a day of data, or fits its views.""" + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("directory", type=pathlib.Path) + parser.add_argument("day") + parser.add_argument("--fit", action="store_true") + parser.add_argument( + "--fit-view", + action="store_true", + help="center each view in TAT-C's frame, with the instrument's pitch", + ) + parser.add_argument("--write", action="store_true") + arguments = parser.parse_args() + arguments.directory.mkdir(parents=True, exist_ok=True) + day = datetime.fromisoformat(arguments.day).replace(tzinfo=timezone.utc) + references = load_references(day, arguments.directory) + for view, reference in references.items(): + print( + f"{arguments.day} {view}: {len(reference.time)} lines (every " + f"{LINE_STRIDE}), {len(reference.gaps)} gaps over {GAP_THRESHOLD:g} s, " + f"line period {reference.scan_period:.4f} s", + flush=True, + ) + if arguments.fit: + check_time_scale(PRODUCT, day, "ScienceData/time") + for view, reference in references.items(): + print(f"== {view}") + for frame in ("inertial", "earth_fixed"): + fit(reference, frame) + fit_yaw(reference, frame) + return + if arguments.fit_view: + for view, reference in references.items(): + for frame in ("inertial", "earth_fixed"): + print(f"== {view}") + fit_view(reference, frame, 0.0, VIEWS[view], instrument_pitch=True) + return + tle = read_element_set_file(ELEMENT_SET_FILE, NORAD_ID, day) + print(f"element set: {tle[0][:32]}", flush=True) + orbit = GeneralPerturbationsOrbit.from_tle(tle) + validate(day, tle, get_entry("bbr"), orbit, references, arguments.write) + + +if __name__ == "__main__": + main() diff --git a/docs/validation/validate_catalog_cpr.py b/docs/validation/validate_catalog_cpr.py new file mode 100644 index 0000000..460465b --- /dev/null +++ b/docs/validation/validate_catalog_cpr.py @@ -0,0 +1,108 @@ +""" +Validates the CPR catalog entry against EarthCARE's Level 1B CPR product (CPR_NOM_1B, +of JAXA), using the exact values of the entry through public TAT-C methods. CPR is a +single-beam Doppler cloud radar, pointed near nadir. Its pointing is fitted to the +positions of the profiles on one day (run with `--fit`), from the spacecraft positions +the product records, so the fit needs no element set; running on a day at least 30 +days from it tests the fitted pointing on data held out from the fit. A sample of a +day's profiles is scored as for the profiler class: whether the view observes each +within two minutes of its time, the epoch's difference, and its distance across track +from the predicted track of the view's center. + +Needs the `validation` extra and a MAAP offline token in `ESA_MAAP_KEY`. Only the +profiles' times and positions are read, with range requests: + + python docs/validation/validate_catalog_cpr.py 2026-09-27 --fit + python docs/validation/validate_catalog_cpr.py 2026-11-07 + +With `--write`, it writes the entry's validation record and the reduced fixture from +which unit tests recompute the results. + +@author: Paul T. Grogan +""" + +import argparse +import pathlib +from datetime import datetime, timezone + +import numpy as np + +from tatc.catalog import get_entry +from tatc.schemas import GeneralPerturbationsOrbit +from earthcare_io import ( + Profiles, + check_time_scale, + fit_pointing, + load_day, + to_seconds, + validate_profiler, +) +from validation_io import read_element_set_file + +REPOSITORY = pathlib.Path(__file__).resolve().parents[2] +RECORD_PATH = REPOSITORY / "src" / "tatc" / "resources" / "validation" / "cpr.json" +FIXTURE_PATH = REPOSITORY / "tests" / "catalog" / "fixtures" / "cpr.npz" +NORAD_ID = 59908 +FIT_DAY = datetime(2026, 9, 27, tzinfo=timezone.utc) +ELEMENT_SET_FILE = REPOSITORY / "docs" / "validation" / "earthcare_2026-09-27.3le" +PLATFORM = "earthcare" +CONFIGURATION = "nadir" + + +def read_cpr(f, day: datetime) -> dict: + """Reads the times and positions of a frame's profiles.""" + g = f["ScienceData/Geo"] + return { + "time": to_seconds(g["profileTime"][:], day), + "lat": g["latitude"][:], + "lon": g["longitude"][:], + "sc_position": np.stack( + [g["xPosition"][:], g["yPosition"][:], g["zPosition"][:]], axis=-1 + ), + } + + +def main() -> None: + """Validates the entry on a day of data, or fits its pointing.""" + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("directory", type=pathlib.Path) + parser.add_argument("day") + parser.add_argument("--fit", action="store_true") + parser.add_argument("--write", action="store_true") + arguments = parser.parse_args() + arguments.directory.mkdir(parents=True, exist_ok=True) + day = datetime.fromisoformat(arguments.day).replace(tzinfo=timezone.utc) + data = load_day("CPR_NOM_1B", day, arguments.directory, read_cpr) + profiles = Profiles(day, data) + print( + f"{arguments.day}: {len(profiles.seconds)} profiles from {int(data['frames'])} " + f"frames, {len(profiles.gaps)} gaps over a minute", + flush=True, + ) + if arguments.fit: + check_time_scale("CPR_NOM_1B", day, "ScienceData/Geo/profileTime") + fit_pointing(profiles) + return + tle = read_element_set_file(ELEMENT_SET_FILE, NORAD_ID, day) + print(f"element set: {tle[0][:32]}", flush=True) + orbit = GeneralPerturbationsOrbit.from_tle(tle) + validate_profiler( + get_entry("cpr"), + CONFIGURATION, + PLATFORM, + profiles, + orbit, + tle, + day, + FIT_DAY, + RECORD_PATH, + FIXTURE_PATH, + "docs/validation/validate_catalog_cpr.py", + "CPR_NOM_1B (profile positions and times)", + arguments.write, + ) + + +if __name__ == "__main__": + np.seterr(invalid="ignore") + main() diff --git a/docs/validation/validate_catalog_earthcare_msi.py b/docs/validation/validate_catalog_earthcare_msi.py new file mode 100644 index 0000000..5b71d34 --- /dev/null +++ b/docs/validation/validate_catalog_earthcare_msi.py @@ -0,0 +1,171 @@ +""" +Validates the EarthCARE MSI catalog entry against EarthCARE's Level 1C MSI product +(MSI_RGR_1C, regridded to the pixels of the thermal infrared bands), using the exact +values of the entry through public TAT-C methods. MSI is a pushbroom imager of 150 km, +tilted away from the sun. The product gives each pixel's position and each line's time +but no spacecraft positions, so they are interpolated to the lines' times from those +of the ATLID product of the same day (ATL_NOM_1B), and the fit needs no element set. +The view's angles are fitted to one day (run with `--fit`, then `--fit-view` to center +the view in TAT-C's frame): running on a day at least 30 days from it tests the fitted +angles on data held out from the fit. The swath is scored as for other pushbroom +swaths: passes of points within the lattice of its pixels, the swath width, and the +swath area over the span of the day compared. + +Needs the `validation` extra and a MAAP offline token in `ESA_MAAP_KEY`. Only the +pixels' positions and the lines' times are read, of every fourth orbit, and reduced +to every eighth line and some of the 357 columns of imaged pixels (of the grid's 384), +with range requests: + + python docs/validation/validate_catalog_earthcare_msi.py 2026-09-27 --fit + python docs/validation/validate_catalog_earthcare_msi.py 2026-09-27 --fit-view + python docs/validation/validate_catalog_earthcare_msi.py 2026-11-07 + +With `--write`, it writes the entry's validation record and the reduced fixture from +which unit tests recompute the results. + +@author: Paul T. Grogan +""" + +import argparse +import pathlib +from datetime import datetime, timezone + +import numpy as np + +from tatc.catalog import get_entry +from tatc.schemas import GeneralPerturbationsOrbit +from earthcare_io import check_time_scale, load_day, to_seconds +from gesdisc_scanner import Reference, Setup, fit, fit_view, fit_yaw, validate_swath +from validation_io import TO_GEODETIC, read_element_set_file +from validate_catalog_atlid import read_atlid + +REPOSITORY = pathlib.Path(__file__).resolve().parents[2] +NORAD_ID = 59908 +FIT_DAY = datetime(2026, 9, 27, tzinfo=timezone.utc) +ELEMENT_SET_FILE = REPOSITORY / "docs" / "validation" / "earthcare_2026-09-27.3le" +PRODUCT = "MSI_RGR_1C" +# the product's grid has 384 columns, of which 12 to 368 hold the imaged pixels and +# the others are always fill +FIRST_COLUMN = 12 +PIXELS = 357 +LINE_STRIDE = 8 +COLUMNS = np.r_[0:PIXELS:8, PIXELS - 1] +ORBIT_STRIDE = 4 +# the body's yaw, and the along-track angle at nadir from `--fit` on the day of the +# fit (Earth-fixed frame), from which `--fit-view` centers the view with the +# instrument's pitch; `--fit` gives a slope of the line of -0.106 deg from the +# geodetic nadir, but in TAT-C's frame, rolled and pitched, an unyawed view slopes +# only 0.04 deg, which the entry does not model +FIT_YAW = 0.0 +FIT_PITCH = -0.6198 +SETUP = Setup( + entry_id="earthcare_msi", + platform="earthcare", + swath="swath", + beams="", + size_instrument="", + published_footprints=(), + record_path=REPOSITORY + / "src" + / "tatc" + / "resources" + / "validation" + / "earthcare_msi.json", + fixture_path=REPOSITORY / "tests" / "catalog" / "fixtures" / "earthcare_msi.npz", + source="docs/validation/validate_catalog_earthcare_msi.py", + reference=f"{PRODUCT} (pixel positions of every fourth orbit, every eighth line), " + "with spacecraft positions of ATL_NOM_1B", + published_reference="", + fit_day=FIT_DAY, + time_steps=(10, 30, 120), + pass_radius=20, + point_spacing=100e3, +) + + +def read_msi(f, day: datetime) -> dict: + """Reads a frame's line times and pixel positions, reduced.""" + g = f["ScienceData"] + lines = np.arange(0, g["time"].shape[0], LINE_STRIDE) + return { + "time": to_seconds(g["time"][:], day)[lines], + "lat": g["latitude"][:][lines][:, FIRST_COLUMN + COLUMNS], + "lon": g["longitude"][:][lines][:, FIRST_COLUMN + COLUMNS], + } + + +def load_reference(day: datetime, directory: pathlib.Path) -> Reference: + """ + Loads a reduced day, with the spacecraft's position interpolated, in Earth-fixed + coordinates, from the sensor positions the ATLID product records. + """ + data = load_day(PRODUCT, day, directory, read_msi, orbit_stride=ORBIT_STRIDE) + lidar = load_day("ATL_NOM_1B", day, directory, read_atlid) + order = np.argsort(lidar["time"]) + seconds, position = lidar["time"][order], lidar["sc_position"][order] + near = np.abs( + seconds[np.clip(np.searchsorted(seconds, data["time"]), 0, len(seconds) - 1)] + - data["time"] + ) + within = (data["time"] >= seconds[0]) & (data["time"] <= seconds[-1]) & (near < 5) + data = {k: v[within] for k, v in data.items() if k != "frames"} + interpolated = np.stack( + [np.interp(data["time"], seconds, position[:, axis]) for axis in range(3)], + axis=-1, + ) + lon, lat, height = TO_GEODETIC.transform(*interpolated.T) + data.update( + sc_lat=lat, + sc_lon=lon, + sc_alt=height, + pixel=COLUMNS, + pixels=PIXELS, + line_stride=LINE_STRIDE, + ) + period = float(np.median(np.diff(data["time"]))) + return Reference(day, data, period) + + +def main() -> None: + """Validates the entry on a day of data, or fits its angles.""" + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("directory", type=pathlib.Path) + parser.add_argument("day") + parser.add_argument("--fit", action="store_true") + parser.add_argument( + "--fit-view", + action="store_true", + help="center the view in TAT-C's frame, with the fitted yaw", + ) + parser.add_argument("--write", action="store_true") + arguments = parser.parse_args() + arguments.directory.mkdir(parents=True, exist_ok=True) + day = datetime.fromisoformat(arguments.day).replace(tzinfo=timezone.utc) + reference = load_reference(day, arguments.directory) + print( + f"{arguments.day}: {len(reference.time)} lines (every {LINE_STRIDE}), " + f"{len(reference.gaps)} gaps over a minute, line period " + f"{reference.scan_period:.4f} s", + flush=True, + ) + if arguments.fit: + check_time_scale(PRODUCT, day, "ScienceData/time") + for frame in ("inertial", "earth_fixed"): + fit(reference, frame) + fit_yaw(reference, frame) + return + if arguments.fit_view: + for frame in ("inertial", "earth_fixed"): + fit_view(reference, frame, FIT_YAW, FIT_PITCH, instrument_pitch=True) + return + tle = read_element_set_file(ELEMENT_SET_FILE, NORAD_ID, day) + print(f"element set: {tle[0][:32]}", flush=True) + orbit = GeneralPerturbationsOrbit.from_tle(tle) + entry = get_entry("earthcare_msi") + validate_swath(SETUP, day, tle, entry, orbit, reference, arguments.write) + if arguments.write: + print(f"wrote {SETUP.record_path} and {SETUP.fixture_path}") + + +if __name__ == "__main__": + main() diff --git a/docs/validation/validate_catalog_ssmis.py b/docs/validation/validate_catalog_ssmis.py index 7a2d664..ebc1149 100644 --- a/docs/validation/validate_catalog_ssmis.py +++ b/docs/validation/validate_catalog_ssmis.py @@ -9,7 +9,8 @@ * A point is observed on a pass if it lies in a cell of the lattice of S1 samples, at the time it crosses the cone, from the recorded spacecraft positions. * The swath width is compared with the distance between the first and last samples. -* The swath area over an orbit is compared with the union of the cells. +* The swath area over a span of the day (from noon) is compared with the union of + the cells. Needs the `validation` extra and an Earthdata token in `EARTHDATA_TOKEN`. Only the needed fields of the product's files are read, with range requests: diff --git a/docs/validation/validate_catalog_tmi.py b/docs/validation/validate_catalog_tmi.py new file mode 100644 index 0000000..26b6386 --- /dev/null +++ b/docs/validation/validate_catalog_tmi.py @@ -0,0 +1,551 @@ +""" +Validates the TMI catalog entry against the GPM-format Level 1C TMI product of TRMM, +using the exact values of the entry through public TAT-C methods. The entry's scan is +fitted to the positions of the samples of each group (S1, 10 GHz; S2, 19 to 37 GHz; +S3, 85.5 GHz) on one day (run with `--fit`), from the spacecraft positions the product +records, so the fit needs no element set; running on a day at least 30 days from it +tests the fitted scan on data held out from the fit. Both days are in TRMM's forward +orientation (the product's `SCorientation` of 0) throughout. Element sets are read +from a file of the history of TRMM's element sets. The tests follow those of SSMIS: + +* A point is observed by a feed on a pass if it lies in a cell of the lattice of its + group's samples, at the time it crosses the cone, from the recorded spacecraft positions. +* The swath width is compared with the distance between the first and last samples. +* The swath area over a span of the day (from noon) is compared with the union of + the cells. + +It also validates the entry's sample size configuration, as for AMSR2: sizes at the +center of the scan are compared with the footprints published in the TC PRIMED +documentation, which the gate tests, and the spacing of samples along the arc and +between scans with that measured. + +Needs the `validation` extra and an Earthdata token in `EARTHDATA_TOKEN`. Only the +needed fields of the product's files are read, with range requests: + + python docs/validation/validate_catalog_tmi.py 2013-06-01 --fit + python docs/validation/validate_catalog_tmi.py 2013-06-01 + python docs/validation/validate_catalog_tmi.py 2013-07-10 + +With `--write`, it writes the entry's validation record and the reduced fixture from +which unit tests recompute the results. + +@author: Paul T. Grogan +""" + +import argparse +import json +import pathlib +from datetime import datetime, timedelta, timezone + +import h5py +import numpy as np +import pandas as pd +from pyproj import Geod +from scipy.spatial import cKDTree + +import tatc +from tatc.analysis import compute_sample_sizes +from tatc.catalog import get_entry +from tatc.generation import generate_points_fibonacci_lattice +from tatc.schemas import CircularOrbit, GeneralPerturbationsOrbit +from gesdisc_scanner import Product, Reference, load_day, observe_orbit +from validation_io import ( + TO_GEODETIC, + RemoteFile, + PUBLISHED_EPOCH, + build_grid, + compute_spacing_ratios, + ecef, + get_holdout_gap, + normalize, + read_element_set_file, + recompute_passes, + score_passes, + score_published, + score_swath_area, + to_observations, + up, + update_fixture, + update_record, +) +from validate_catalog_trmm_pr import ELEMENT_SET_FILE, FIT_DAY, NORAD_ID + +REPOSITORY = pathlib.Path(__file__).resolve().parents[2] +RECORD_PATH = REPOSITORY / "src" / "tatc" / "resources" / "validation" / "tmi.json" +FIXTURE_PATH = REPOSITORY / "tests" / "catalog" / "fixtures" / "tmi.npz" +PLATFORM = "trmm" +CONFIGURATION = "feeds" +SAMPLE_CONFIGURATION = "sample_size" +GROUPS = ("S1", "S2", "S3") + + +def read_tmi(_product, url: str, session, day: datetime, _directory) -> dict: + """ + Reads the times of a granule's scans, the spacecraft's positions, and the + positions of the samples of each group, with range requests. + """ + with h5py.File(RemoteFile(url, session)) as f: + g = f["S1"] + date = pd.to_datetime( + pd.DataFrame( + { + "year": g["ScanTime/Year"][:], + "month": g["ScanTime/Month"][:], + "day": g["ScanTime/DayOfMonth"][:], + } + ), + utc=True, + ) + part = { + "time": (date - pd.Timestamp(day)).dt.total_seconds().to_numpy() + + g["ScanTime/SecondOfDay"][:].astype(float), + "sc_lat": g["SCstatus/SClatitude"][:], + "sc_lon": g["SCstatus/SClongitude"][:], + "sc_alt": g["SCstatus/SCaltitude"][:], + "orientation": g["SCstatus/SCorientation"][:], + } + for group in GROUPS: + part[f"lat_{group}"] = f[group]["Latitude"][:] + part[f"lon_{group}"] = f[group]["Longitude"][:] + return part + + +PRODUCT = Product(short_name="GPM_1CTRMMTMI", version="08", read=read_tmi) +# the scan period is measured on the day of the fit +SCAN_PERIOD = 1.899 +TIME_STEPS = (SCAN_PERIOD, 10, 30) +POINT_SPACING = 300e3 +PASS_RADIUS = 60 # km +FIXTURE_PASSES = 80 +# published footprints: instrument, altitude (km), inclination (deg), scan angle +# (deg), and sizes along and across track (km), from the TC PRIMED documentation, +# after TRMM's orbit boost of August 2001, at the center of the scan +PUBLISHED_FOOTPRINTS = ( + ("TMI 10.65 GHz", 403, 35, 0, 68.1, 41.3), + ("TMI 19.35 GHz", 403, 35, 0, 34.6, 20.9), + ("TMI 21.3 GHz", 403, 35, 0, 31.1, 18.9), + ("TMI 37.0 GHz", 403, 35, 0, 18.3, 11.1), + ("TMI 85.5 GHz", 403, 35, 0, 7.8, 4.8), +) +# an instrument of each group, whose spacing is measured +SPACING_INSTRUMENTS = { + "S1": "TMI 10.65 GHz", + "S2": "TMI 19.35 GHz", + "S3": "TMI 85.5 GHz", +} +SPACING_SCAN_STRIDE = 200 +FIXTURE_SPACING_SAMPLES = 100 +GEOD = Geod(ellps="WGS84") + + +def load_references(day: datetime, directory: pathlib.Path) -> dict[str, Reference]: + """Loads a day, as a reference for each group of samples.""" + data = load_day(PRODUCT, day, directory) + orientation = data["orientation"] + print( + "orientation of the scans: " + + ", ".join( + f"{value}: {count}" + for value, count in zip(*np.unique(orientation, return_counts=True)) + ), + flush=True, + ) + references = {} + for group in GROUPS: + part = { + "time": data["time"], + "sc_lat": data["sc_lat"], + "sc_lon": data["sc_lon"], + "sc_alt": data["sc_alt"], + "lat": data[f"lat_{group}"], + "lon": data[f"lon_{group}"], + } + references[group] = Reference(day, part, SCAN_PERIOD) + return references + + +def fit(reference: Reference, group: str) -> None: + """ + Prints the fitted scan of a group: the median angle of the samples from nadir + (the cone angle), and the azimuths of the first and last samples from the + velocity, in the inertial and Earth-fixed frames, with their center by latitude, + and the spacing of samples along the scan. + """ + lon, lat, _ = TO_GEODETIC.transform(*reference.position.T) + nadir = -up(lon, lat) + sight = normalize( + ecef(reference.lon, reference.lat) - reference.position[:, np.newaxis] + ) + cone = np.degrees(np.arccos(np.sum(sight * nadir[:, np.newaxis], axis=-1))) + print( + f"{group} ({reference.beams} samples): cone angle median " + f"{np.median(cone):.4f} deg, p5 {np.percentile(cone, 5):.4f}, p95 " + f"{np.percentile(cone, 95):.4f}" + ) + for frame in ("inertial", "earth_fixed"): + motion = reference.velocity(frame) + forward = normalize(motion - np.sum(motion * nadir, axis=-1)[:, None] * nadir) + # to the left of the motion + left = normalize(np.cross(forward, nadir)) + azimuth = np.degrees( + np.arctan2( + np.sum(sight * left[:, None], axis=-1), + np.sum(sight * forward[:, None], axis=-1), + ) + ) + first, last = np.median(azimuth[:, 0]), np.median(azimuth[:, -1]) + center = (azimuth[:, 0] + azimuth[:, -1]) / 2 + bands = ", ".join( + f"{low:+d}..{low + 15:+d}: " + f"{np.median(center[(np.asarray(lat) >= low) & (np.asarray(lat) < low + 15)]):+.3f}" + for low in range(-45, 45, 15) + if np.any((np.asarray(lat) >= low) & (np.asarray(lat) < low + 15)) + ) + step = np.median(np.abs(np.diff(azimuth, axis=1))) + print( + f" {frame}: first sample {first:+.4f} deg, last {last:+.4f} deg; center " + f"{np.median(center):+.4f} (p5 {np.percentile(center, 5):+.4f}, p95 " + f"{np.percentile(center, 95):+.4f}), half width " + f"{np.median(np.abs(azimuth[:, -1] - azimuth[:, 0]) / 2):.4f} deg; " + f"azimuth step {step:.5f} deg; center by latitude: {bands}" + ) + print( + f" scan period: median {np.median(np.diff(reference.seconds)):.6f} s; " + f"altitude median {np.median(reference.altitude) / 1e3:.2f} km" + ) + + +def cone_crossing(reference: Reference, target, k: int, cone_angle: float) -> float: + """Gets the time (s) a target crosses the cone near scan k, by bisection.""" + + def angle(t: float) -> float: + seconds = reference.seconds + i = int(np.clip(np.searchsorted(seconds, t) - 1, 0, len(seconds) - 2)) + f = (t - seconds[i]) / (seconds[i + 1] - seconds[i]) + position = reference.position[i] + f * ( + reference.position[i + 1] - reference.position[i] + ) + lon, lat, _ = TO_GEODETIC.transform(*position) + return ( + np.degrees(np.arccos(np.dot(normalize(target - position), -up(lon, lat)))) + - cone_angle + ) + + lower, upper = reference.seconds[k] - 8, reference.seconds[k] + 8 + if angle(lower) * angle(upper) > 0: + return np.nan + for _ in range(30): + middle = (lower + upper) / 2 + lower, upper = (middle, upper) if angle(middle) > 0 else (lower, middle) + return (lower + upper) / 2 + + +def observe_passes(reference: Reference, points, cone_angle: float) -> pd.DataFrame: + """ + Finds the passes on which the samples observed points (in a cell of the lattice of + samples), and their times (when they cross the cone). + """ + point_unit = up(points.geometry.x.to_numpy(), points.geometry.y.to_numpy()) + flat = reference.unit.reshape(-1, 3) + scan_of = np.repeat(np.arange(len(reference.seconds)), reference.beams) + rows = [] + for p, hits in enumerate( + cKDTree(flat).query_ball_point( + point_unit, r=2 * np.sin(PASS_RADIUS / 6371 / 2), workers=-1 + ) + ): + if not hits: + continue + hits = np.array(hits) + hits = hits[np.argsort(reference.seconds[scan_of[hits]])] + times = reference.seconds[scan_of[hits]] + for group in np.split(hits, np.nonzero(np.diff(times) > 600)[0] + 1): + k = int( + scan_of[ + group[ + np.argmin(np.linalg.norm(flat[group] - point_unit[p], axis=-1)) + ] + ] + ) + first, last = max(k - 2, 0), min(k + 2, len(reference.seconds) - 1) + if not reference.in_cells(point_unit[[p]], first, last)[0]: + continue + crossing = cone_crossing( + reference, + ecef(points.geometry.x.iloc[p], points.geometry.y.iloc[p]), + k, + cone_angle, + ) + if np.isfinite(crossing): + rows.append({"point_id": p, "seconds": float(crossing)}) + observed = pd.DataFrame(rows).astype({"point_id": "int64"}) + observed["time"] = pd.Timestamp(reference.day) + pd.to_timedelta( + observed.seconds, unit="s" + ) + return observed + + +def score_swath_width(reference: Reference, instrument) -> float: + """ + Gets the median absolute difference (km) of the swath width from the distance + along the surface between the first and last samples of scans. + """ + scans = np.arange(0, len(reference.seconds), 20) + distance = GEOD.inv( + reference.lon[scans, 0], + reference.lat[scans, 0], + reference.lon[scans, -1], + reference.lat[scans, -1], + )[2] + width = np.vectorize(instrument.get_swath_width)(reference.altitude[scans]) + return float(np.median(np.abs(width - distance))) / 1e3 + + +def measure_spacing(reference: Reference) -> np.ndarray: + """ + Measures the spacing of a group's samples as `ValidateSampleSizes` does, from + half the distance between the samples on either side. Returns rows of latitude, + longitude, spacing between scans (km), and spacing along the arc (km), with the + seconds of each row. + """ + scans = reference.contiguous_scans()[::SPACING_SCAN_STRIDE] + position = ecef(reference.lon, reference.lat) + arc = np.linalg.norm(position[scans, 2:] - position[scans, :-2], axis=-1) / 2e3 + between = ( + np.linalg.norm(position[scans + 1, 1:-1] - position[scans - 1, 1:-1], axis=-1) + / 2e3 + ) + rows = np.stack( + [ + reference.lat[scans, 1:-1].ravel(), + reference.lon[scans, 1:-1].ravel(), + between.ravel(), + arc.ravel(), + ], + axis=-1, + ) + seconds = np.repeat(reference.seconds[scans], reference.beams - 2) + return rows, seconds + + +def compute_published_errors(entry) -> np.ndarray: + """ + Gets the relative errors of sample sizes, at the center of the scan, against the + published footprints. Gives two errors for each footprint. + """ + errors = [] + for name, altitude, inclination, _, along, cross in PUBLISHED_FOOTPRINTS: + orbit = CircularOrbit( + altitude=altitude * 1e3, inclination=inclination, epoch=PUBLISHED_EPOCH + ) + satellite = entry.to_satellite( + orbit, SAMPLE_CONFIGURATION, time_step=SCAN_PERIOD, platform=PLATFORM + ) + names = [instrument.name for instrument in satellite.instruments] + time = PUBLISHED_EPOCH + timedelta(minutes=10) + target = satellite.get_instrument(names.index(name)).compute_footprint_center( + orbit.to_gp_orbit().get_orbit_track(time) + ) + sizes = compute_sample_sizes( + to_observations( + satellite, + [name], + [time], + [target.longitude.degrees], + [target.latitude.degrees], + ), + satellite, + ) + errors += [ + sizes.sample_along.iloc[0] / 1e3 / along - 1, + sizes.sample_cross.iloc[0] / 1e3 / cross - 1, + ] + print(f"{name}: {errors[-2]:+.2%} along, {errors[-1]:+.2%} across") + return np.array(errors) + + +def validate_sample_sizes(day, tle, entry, orbit, references, write: bool) -> None: + """Scores the sample size configuration, and writes its results if requested.""" + within, largest = score_published(compute_published_errors(entry)) + print( + f"published dimensions: {within:.1f}% within 3%, largest error {largest:.2f}%" + ) + metrics = [ + {"name": "sample_size_within_3pct", "value": within}, + {"name": "sample_size_largest_error", "value": largest}, + ] + satellite = entry.to_satellite( + orbit, SAMPLE_CONFIGURATION, time_step=SCAN_PERIOD, platform=PLATFORM + ) + rng = np.random.default_rng(2) + fixture_metrics = {"sample_size_within_3pct": within} + reduced = {} + for group, name in SPACING_INSTRUMENTS.items(): + rows, seconds = measure_spacing(references[group]) + times = pd.DatetimeIndex(pd.Timestamp(day) + pd.to_timedelta(seconds, "s")) + # the spacing between scans is along track, and along the arc across track + between, arc = compute_spacing_ratios( + satellite, [name] * len(rows), times, rows + ) + print( + f"{group} spacing, predicted / measured: {arc:.4f} arc, {between:.4f} scans" + ) + metrics += [ + {"name": "spacing_arc_ratio_median", "value": arc, "scope": group}, + {"name": "spacing_scan_ratio_median", "value": between, "scope": group}, + ] + picks = rng.choice(len(rows), FIXTURE_SPACING_SAMPLES, replace=False) + between, arc = compute_spacing_ratios( + satellite, [name] * len(picks), times[picks], rows[picks] + ) + fixture_metrics[f"spacing_arc_ratio_median_{group}"] = arc + fixture_metrics[f"spacing_scan_ratio_median_{group}"] = between + reduced[f"spacing_{group}"] = rows[picks] + reduced[f"spacing_seconds_{group}"] = seconds[picks] + if not write: + return + update_fixture( + FIXTURE_PATH, tle=np.array(tle), day=np.array(day.isoformat()), **reduced + ) + update_record( + RECORD_PATH, + "tmi", + SAMPLE_CONFIGURATION, + { + "digest": entry.configurations[SAMPLE_CONFIGURATION].digest, + "evidence": "rerun", + "tatc_version": tatc.__version__, + "source": "docs/validation/validate_catalog_tmi.py", + "reference": "Footprints of the TC PRIMED documentation; spacing of " + "GPM_1CTRMMTMI version 08", + "period": f"{day:%Y-%m-%d}", + "platform": PLATFORM, + "holdout_gap_days": get_holdout_gap(day, FIT_DAY), + "metrics": metrics, + "fixture_metrics": fixture_metrics, + }, + ) + + +def validate_swath(day, tle, entry, orbit, references, write: bool) -> None: + """ + Scores each feed of the swath configuration on the samples of its group, and + writes the results if requested, with the fixture of the first feed's passes. + """ + + def satellite_for(time_step: float): + return entry.to_satellite( + orbit, CONFIGURATION, time_step=time_step, platform=PLATFORM + ) + + satellite = satellite_for(SCAN_PERIOD) + points = generate_points_fibonacci_lattice(POINT_SPACING) + grid = build_grid() + metrics, first_observed = [], None + for index, group in enumerate(GROUPS): + reference = references[group] + cone_angle = ( + entry.configurations[CONFIGURATION] + .instruments[index] + .parameters["cone_angle"] + ) + observed = observe_passes(reference, points, cone_angle) + start = reference.time[0].to_pydatetime() + end = reference.time[-1].to_pydatetime() + timedelta(seconds=SCAN_PERIOD) + results = score_passes( + points, satellite, index, observed, start, end, reference.gaps + ) + results["swath_width_median"] = score_swath_width( + reference, satellite.instruments[index] + ) + first, last, compared, covered = observe_orbit( + reference, orbit, grid, 2 * PASS_RADIUS + ) + results["footprint_iou_median"] = score_swath_area( + satellite_for, index, first, last, TIME_STEPS, grid, compared, covered + ) + print(group, json.dumps(results), flush=True) + metrics += [ + {"name": name, "value": float(results[name]), "scope": group} + for name in ( + "pass_recall", + "pass_precision", + "epoch_p95", + "swath_width_median", + "footprint_iou_median", + ) + ] + if first_observed is None: + first_observed = observed + if not write: + return + rng = np.random.default_rng(1) + picks = first_observed.iloc[ + rng.choice(len(first_observed), FIXTURE_PASSES, replace=False) + ] + passes = np.stack( + [ + points.geometry.y.to_numpy()[picks.point_id], + points.geometry.x.to_numpy()[picks.point_id], + picks.seconds.to_numpy(), + ], + axis=-1, + ) + update_fixture( + FIXTURE_PATH, tle=np.array(tle), day=np.array(day.isoformat()), passes=passes + ) + update_record( + RECORD_PATH, + "tmi", + CONFIGURATION, + { + "digest": entry.configurations[CONFIGURATION].digest, + "evidence": "rerun", + "tatc_version": tatc.__version__, + "source": "docs/validation/validate_catalog_tmi.py", + "reference": "GPM_1CTRMMTMI version 08 (positions of the S1, S2, and S3 " + "samples)", + "period": f"{day:%Y-%m-%d}", + "platform": PLATFORM, + "holdout_gap_days": get_holdout_gap(day, FIT_DAY), + "metrics": metrics, + "fixture_metrics": recompute_passes(satellite, 0, day, passes), + }, + ) + + +def main() -> None: + """Validates the entry on a day of data, or fits its scan.""" + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("directory", type=pathlib.Path) + parser.add_argument("day") + parser.add_argument("--fit", action="store_true") + parser.add_argument("--sample-sizes-only", action="store_true") + parser.add_argument("--write", action="store_true") + arguments = parser.parse_args() + arguments.directory.mkdir(parents=True, exist_ok=True) + day = datetime.fromisoformat(arguments.day).replace(tzinfo=timezone.utc) + references = load_references(day, arguments.directory) + reference = references["S1"] + print( + f"{arguments.day}: {len(reference.time)} scans, {len(reference.gaps)} gaps " + f"over a minute, median altitude {np.median(reference.altitude) / 1e3:.1f} km", + flush=True, + ) + if arguments.fit: + for group in GROUPS: + fit(references[group], group) + return + tle = read_element_set_file(ELEMENT_SET_FILE, NORAD_ID, day) + print(f"element set: {tle[0][:32]}", flush=True) + orbit = GeneralPerturbationsOrbit.from_tle(tle) + entry = get_entry("tmi") + validate_sample_sizes(day, tle, entry, orbit, references, arguments.write) + if not arguments.sample_sizes_only: + validate_swath(day, tle, entry, orbit, references, arguments.write) + if arguments.write: + print(f"wrote {RECORD_PATH} and {FIXTURE_PATH}") + + +if __name__ == "__main__": + main() diff --git a/docs/validation/validate_catalog_trmm_pr.py b/docs/validation/validate_catalog_trmm_pr.py new file mode 100644 index 0000000..db9f93b --- /dev/null +++ b/docs/validation/validate_catalog_trmm_pr.py @@ -0,0 +1,128 @@ +""" +Validates the TRMM PR catalog entry against the GPM-format Level 2 PR product of TRMM, +using the exact values of the entry through public TAT-C methods. The entry's scan +angles are fitted to the positions of the beams on one day (run with `--fit`), from +the spacecraft positions the product records, so the fit needs no element set: +running on that day checks the fit, while running on a day at least 30 days from it +tests the fitted angles on data held out from the fit. Both days are in TRMM's +forward orientation (the products' `SCorientation` of 0) throughout. Element sets +are read from a file of the history of TRMM's element sets. + +Needs the `validation` extra and an Earthdata token in `EARTHDATA_TOKEN`. Only the +needed fields of the product's files are read, with range requests: + + python docs/validation/validate_catalog_trmm_pr.py 2013-06-01 --fit + python docs/validation/validate_catalog_trmm_pr.py 2013-06-01 + python docs/validation/validate_catalog_trmm_pr.py 2013-07-10 + +It also validates the entry's sample size configuration, following +`ValidateSampleSizes`. The gated metrics compare sizes with footprints published in +the TC PRIMED documentation, and the projected pixels with the beams' positions. + +With `--write`, it writes the entry's validation record and the reduced fixture from +which unit tests recompute the results. A record of the day of the fit has no +holdout, which the entry's validation reports as a gap. + +@author: Paul T. Grogan +""" + +import argparse +import pathlib +from datetime import datetime, timezone + +from tatc.catalog import get_entry +from tatc.schemas import GeneralPerturbationsOrbit +from gesdisc_scanner import ( + Product, + Reference, + Setup, + fit, + load_day, + validate_beams, + validate_swath, +) +from validation_io import read_element_set_file + +REPOSITORY = pathlib.Path(__file__).resolve().parents[2] +NORAD_ID = 25063 +FIT_DAY = datetime(2013, 6, 1, tzinfo=timezone.utc) +ELEMENT_SET_FILE = REPOSITORY / "docs" / "validation" / "trmm_2013-05-20.3le" +PRODUCT = Product( + short_name="GPM_2APR", + version="07", + group="FS", + spacecraft=("navigation/scLat", "navigation/scLon", "navigation/scAlt"), + quality="scanStatus/dataQuality", +) +# the scan period is measured on the day of the fit +SCAN_PERIOD = 0.5997 +# published footprints: instrument, altitude (km), inclination (deg), scan angle +# (deg), and sizes along and across track (km), from the TC PRIMED documentation, +# after TRMM's orbit boost of August 2001; the edge of the scan is at its nominal +# 17 deg +PUBLISHED_FOOTPRINTS = ( + ("PR", 403, 35, 0, 5.0, 5.0), + ("PR", 403, 35, 17.0, 5.0, 5.0), +) +SETUP = Setup( + entry_id="trmm_pr", + platform="trmm", + swath="swath", + beams="beams", + size_instrument="PR", + published_footprints=PUBLISHED_FOOTPRINTS, + record_path=REPOSITORY + / "src" + / "tatc" + / "resources" + / "validation" + / "trmm_pr.json", + fixture_path=REPOSITORY / "tests" / "catalog" / "fixtures" / "trmm_pr.npz", + source="docs/validation/validate_catalog_trmm_pr.py", + reference="GPM_2APR version 07 (beam positions of the full swath)", + published_reference="Footprints of the TC PRIMED documentation; beam positions " + "of GPM_2APR version 07", + fit_day=FIT_DAY, + time_steps=(10, 30, 120), + pass_radius=10, + point_spacing=100e3, + pixel_stride=100, + spacing_stride=150, +) + + +def main() -> None: + """Validates the entry on a day of data, or fits its angles.""" + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("directory", type=pathlib.Path) + parser.add_argument("day") + parser.add_argument("--fit", action="store_true") + parser.add_argument("--sample-sizes-only", action="store_true") + parser.add_argument("--write", action="store_true") + arguments = parser.parse_args() + arguments.directory.mkdir(parents=True, exist_ok=True) + + day = datetime.fromisoformat(arguments.day).replace(tzinfo=timezone.utc) + reference = Reference(day, load_day(PRODUCT, day, arguments.directory), SCAN_PERIOD) + print( + f"{arguments.day}: {len(reference.time)} scans, " + f"{len(reference.gaps)} gaps over a minute", + flush=True, + ) + if arguments.fit: + for frame in ("inertial", "earth_fixed"): + fit(reference, frame) + return + tle = read_element_set_file(ELEMENT_SET_FILE, NORAD_ID, day) + print(f"element set: {tle[0][:32]}", flush=True) + orbit = GeneralPerturbationsOrbit.from_tle(tle) + entry = get_entry("trmm_pr") + validate_beams(SETUP, day, tle, entry, orbit, reference, arguments.write) + if not arguments.sample_sizes_only: + validate_swath(SETUP, day, tle, entry, orbit, reference, arguments.write) + if arguments.write: + print(f"wrote {SETUP.record_path} and {SETUP.fixture_path}") + + +if __name__ == "__main__": + main() diff --git a/docs/validation/validate_catalog_virs.py b/docs/validation/validate_catalog_virs.py new file mode 100644 index 0000000..30167eb --- /dev/null +++ b/docs/validation/validate_catalog_virs.py @@ -0,0 +1,210 @@ +""" +Validates the VIRS catalog entry against the GPM-format Level 1B VIRS product of TRMM, +using the exact values of the entry through public TAT-C methods. The product gives +no spacecraft positions, so they are interpolated to its scans' times from those the +GPM-format Level 2 PR product records for the same spacecraft (every 0.6 s), and the +fit needs no element set. The entry's scan angles are fitted to the positions of the +samples on one day (run with `--fit`): running on that day checks the fit, while +running on a day at least 30 days from it tests the fitted angles on data held out +from the fit. Both days are in TRMM's forward orientation (the PR product's +`SCorientation` of 0) throughout. Element sets are read from a file of the history of +TRMM's element sets. + +Needs the `validation` extra and an Earthdata token in `EARTHDATA_TOKEN`. The positions +of samples are read whole, and reduced to every third scan and some samples: + + python docs/validation/validate_catalog_virs.py 2013-06-01 --fit + python docs/validation/validate_catalog_virs.py 2013-06-01 + python docs/validation/validate_catalog_virs.py 2013-07-10 + +It also validates the entry's sample size configuration, following +`ValidateSampleSizes`. The gated metrics compare sizes with the footprint published in +the TRMM Version 7 README of GES DISC, and the projected pixels with the samples' +positions. + +With `--write`, it writes the entry's validation record and the reduced fixture from +which unit tests recompute the results. A record of the day of the fit has no +holdout, which the entry's validation reports as a gap. + +@author: Paul T. Grogan +""" + +import argparse +import pathlib +from datetime import datetime, timezone + +import h5py +import numpy as np +import pandas as pd + +from tatc.catalog import get_entry +from tatc.schemas import GeneralPerturbationsOrbit +from gesdisc_scanner import ( + Product, + Reference, + Setup, + fit, + load_day, + validate_beams, + validate_swath, +) +from validation_io import ( + TO_GEODETIC, + RemoteFile, + ecef, + read_element_set_file, +) +from validate_catalog_trmm_pr import ELEMENT_SET_FILE, FIT_DAY, NORAD_ID +from validate_catalog_trmm_pr import PRODUCT as PR_PRODUCT + +REPOSITORY = pathlib.Path(__file__).resolve().parents[2] +SAMPLES = 261 +LINE_STRIDE = 3 +COLUMNS = np.r_[0:SAMPLES:4, SAMPLES - 1] + + +def read_virs(_product, url: str, session, day: datetime, _directory) -> dict: + """ + Reads the times and positions of a granule's samples, and reduces them to every + third scan and some samples. The spacecraft's position is added afterward. + """ + with h5py.File(RemoteFile(url, session, block_size=2**20)) as f: + g = f["Swath"] + date = pd.to_datetime( + pd.DataFrame( + { + "year": g["ScanTime/Year"][:], + "month": g["ScanTime/Month"][:], + "day": g["ScanTime/DayOfMonth"][:], + } + ), + utc=True, + ) + seconds = (date - pd.Timestamp(day)).dt.total_seconds().to_numpy() + g[ + "ScanTime/SecondOfDay" + ][:].astype(float) + lat = g["Latitude"][:] + lon = g["Longitude"][:] + keep = np.arange(0, len(seconds), LINE_STRIDE) + return { + "time": seconds[keep], + "lat": lat[keep][:, COLUMNS], + "lon": lon[keep][:, COLUMNS], + } + + +PRODUCT = Product(short_name="GPM_1BVIRS", version="08", read=read_virs) +# the scan period is measured on the day of the fit +SCAN_PERIOD = 0.30467 +# published footprints: instrument, altitude (km), inclination (deg), scan angle +# (deg), and sizes along and across track (km), from the TRMM Version 7 README of GES +# DISC, which gives a horizontal resolution of 2.4 km after TRMM's orbit boost of +# August 2001, identical in both directions, at nadir +PUBLISHED_FOOTPRINTS = (("VIRS", 403, 35, 0, 2.4, 2.4),) +SETUP = Setup( + entry_id="virs", + platform="trmm", + swath="swath", + beams="pixels", + size_instrument="VIRS", + published_footprints=PUBLISHED_FOOTPRINTS, + record_path=REPOSITORY / "src" / "tatc" / "resources" / "validation" / "virs.json", + fixture_path=REPOSITORY / "tests" / "catalog" / "fixtures" / "virs.npz", + source="docs/validation/validate_catalog_virs.py", + reference="GPM_1BVIRS version 08 (sample positions), with spacecraft positions of " + "GPM_2APR version 07", + published_reference="Footprint of the TRMM Version 7 README of GES DISC; sample " + "positions of GPM_1BVIRS version 08", + fit_day=FIT_DAY, + time_steps=(10, 30, 120), + pass_radius=40, + point_spacing=200e3, + pixel_stride=100, + spacing_stride=150, +) + + +def load_reference(day: datetime, directory: pathlib.Path) -> Reference: + """ + Loads a reduced day, with the spacecraft's position interpolated, in Earth-fixed + coordinates, from the positions the PR product records. + """ + data = load_day(PRODUCT, day, directory) + radar = load_day(PR_PRODUCT, day, directory) + altitude = radar["sc_alt"].astype(float) + altitude = altitude * 1e3 if np.median(altitude) < 1e4 else altitude + position = ecef( + radar["sc_lon"].astype(float), radar["sc_lat"].astype(float), altitude + ) + order = np.argsort(radar["time"]) + within = (data["time"] >= radar["time"][order[0]]) & ( + data["time"] <= radar["time"][order[-1]] + ) + data = {k: v[within] for k, v in data.items() if k != "granules"} + interpolated = np.stack( + [ + np.interp(data["time"], radar["time"][order], position[order, axis]) + for axis in range(3) + ], + axis=-1, + ) + lon, lat, height = TO_GEODETIC.transform(*interpolated.T) + data.update( + sc_lat=lat, + sc_lon=lon, + sc_alt=height, + pixel=COLUMNS, + pixels=SAMPLES, + line_stride=LINE_STRIDE, + ) + reference = Reference(day, data, LINE_STRIDE * SCAN_PERIOD) + # scans in gaps of the PR's positions longer than a few of its scans are dropped + gap = np.diff(radar["time"][order]) > 5 + if np.any(gap): + starts, ends = radar["time"][order][:-1][gap], radar["time"][order][1:][gap] + print( + f"{len(starts)} gaps of PR positions over 5 s " + f"(longest {np.max(ends - starts):.1f} s)", + flush=True, + ) + return reference + + +def main() -> None: + """Validates the entry on a day of data, or fits its angles.""" + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("directory", type=pathlib.Path) + parser.add_argument("day") + parser.add_argument("--fit", action="store_true") + parser.add_argument("--sample-sizes-only", action="store_true") + parser.add_argument("--write", action="store_true") + arguments = parser.parse_args() + arguments.directory.mkdir(parents=True, exist_ok=True) + + day = datetime.fromisoformat(arguments.day).replace(tzinfo=timezone.utc) + reference = load_reference(day, arguments.directory) + print( + f"{arguments.day}: {len(reference.time)} scans (every {LINE_STRIDE}), " + f"{len(reference.gaps)} gaps over a minute", + flush=True, + ) + if arguments.fit: + for frame in ("inertial", "earth_fixed"): + fit(reference, frame) + print( + f"scan period of the product: {np.median(np.diff(reference.seconds)) / LINE_STRIDE:.6f} s" + ) + return + tle = read_element_set_file(ELEMENT_SET_FILE, NORAD_ID, day) + print(f"element set: {tle[0][:32]}", flush=True) + orbit = GeneralPerturbationsOrbit.from_tle(tle) + entry = get_entry("virs") + validate_beams(SETUP, day, tle, entry, orbit, reference, arguments.write) + if not arguments.sample_sizes_only: + validate_swath(SETUP, day, tle, entry, orbit, reference, arguments.write) + if arguments.write: + print(f"wrote {SETUP.record_path} and {SETUP.fixture_path}") + + +if __name__ == "__main__": + main() diff --git a/src/tatc/catalog/standard.py b/src/tatc/catalog/standard.py index fa65723..3d204c3 100644 --- a/src/tatc/catalog/standard.py +++ b/src/tatc/catalog/standard.py @@ -13,14 +13,14 @@ from dataclasses import dataclass from enum import Enum -STANDARD_VERSION = 5 +STANDARD_VERSION = 6 """The version of the thresholds in `get_gates`.""" -COMPATIBLE_VERSIONS = (1, 2, 3, 4, 5) +COMPATIBLE_VERSIONS = (1, 2, 3, 4, 5, 6) """ Versions whose results still apply: version 2 only added the lidar class, version 3 -the altimeter class, version 4 the scatterometer class, and version 5 the regional -geostationary class. +the altimeter class, version 4 the scatterometer class, version 5 the regional +geostationary class, and version 6 the profiler class. """ MIN_HOLDOUT_GAP_DAYS = 30 @@ -41,6 +41,7 @@ class InstrumentClass(str, Enum): LIDAR = "lidar" ALTIMETER = "altimeter" SCATTEROMETER = "scatterometer" + PROFILER = "profiler" class Grade(str, Enum): @@ -130,6 +131,10 @@ def is_met(self, value: float) -> bool: # products of nadir altimeters omit measurements by surface and quality, so # predicted measurements that were not made are not errors (no precision gate) InstrumentClass.ALTIMETER: (_SEGMENT_RECALL, _TRACK_OFFSET), + # version 6: single-beam atmospheric profilers (lidar or radar), near nadir, + # with the altimeter's gates; products omit profiles by quality and mode, so + # predicted profiles that were not measured are not errors (no precision gate) + InstrumentClass.PROFILER: (_SEGMENT_RECALL, _TRACK_OFFSET), # version 4: side-looking swaths, as for SAR; wind products omit land and sea # ice, so predicted passes that were not measured are not errors (no precision) InstrumentClass.SCATTEROMETER: ( diff --git a/src/tatc/resources/instruments/atlid.yml b/src/tatc/resources/instruments/atlid.yml new file mode 100644 index 0000000..02078fc --- /dev/null +++ b/src/tatc/resources/instruments/atlid.yml @@ -0,0 +1,62 @@ +id: atlid +name: ATLID +aliases: [EarthCARE ATLID, Atmospheric Lidar] +instrument_class: profiler +selection: High-spectral-resolution atmospheric lidar of ESA and JAXA's EarthCARE, with open profiles of cloud and aerosol backscatter along a single beam, flying with CPR, MSI, and BBR. +platforms: + - id: earthcare + name: EarthCARE + norad_id: 59908 + status: operational + as_of: 2026-11-07 +data_products: + - name: ATL_NOM_1B + provider: ESA MAAP + url: https://earth.esa.int/eogateway/catalog/earthcare-l1-products + access: registration +default_configuration: profile +configurations: + profile: + grade: timing + description: A narrow view about 10 km wide, pointed about 3 deg behind nadir along the ground track, that contains the lidar's footprint, with a view tailored to the analysis time step. + platforms: [earthcare] + velocity_frame: earth_fixed + instruments: + - type: pointed + parameters: + name: ATLID + field_of_regard: 6.2752 + cross_track_field_of_view: 1.432 + along_track_field_of_view: {tailor: time_step} + roll_angle: 0.0282 + pitch_angle: -3.0481 + is_swept: true + is_rectangular: true + provenance: + field_of_regard: + kind: derived + source: Contains the view's cross-track line, rolled and then pitched by its offsets, as the field of regard bounds the period in which a point can be observed + cross_track_field_of_view: + kind: derived + source: 2 atan(5 km / 400 km), a view about 10 km wide at the orbit's altitude, which contains the footprint (about 30 m wide) given the error of an element set near the day + roll_angle: &measured + kind: measured + source: validate_catalog_atlid.py --fit, the median angles of the profiles from the geodetic nadir across and along the ground track (Earth-fixed frame), from the recorded sensor positions + platform: earthcare + period: "2026-09-27" + pitch_angle: *measured + is_swept: {kind: derived, source: "Models the view as sweeping along track, so that its swaths are the strips its cross-track line sweeps, as observations of points do"} + along_track_field_of_view: + kind: derived + source: compute_along_track_field_of_view, from the orbit and time step + is_rectangular: + kind: derived + source: Models the band along the track as a rectangular view + limitations: + - The view's width is not the footprint's; it is wide enough to contain the profiles' positions given the error of an element set near the day of the analysis. + - On the day of the fit, the angles were constant within 0.003 deg along track and 0.007 deg across track (5th to 95th percentiles), at every latitude and in both directions, in the Earth-fixed frame (EarthCARE steers its yaw); in the inertial frame, the angle across track varied by 0.38 deg. + - On data held out on 2026-11-07 (41 days from the fit, with the element set whose epoch is nearest the day's middle, 15:03 UTC), every sampled profile was within the view at its time and epochs were within 0.46 s (95th percentile; +0.18 s median), but the profiles lay 0.72 km (median) across track from the predicted track of the view's center, failing the track offset gate. The profiles' angles that day were those of the fit (-3.0481 deg along track and +0.0282 deg across track, median, Earth-fixed frame); the element set's inclination (97.0160 deg) differs by about 0.01 deg from those of the sets around it (97.006 to 97.008 deg), and its orbit lay up to 1.3 km across track from the recorded positions (95th percentile), against 0.3 km on the day of the fit. + - The same held-out data tested afterward with the day's other element set (epoch 07:20 UTC), whose orbit lay within 0.7 km across track of the recorded positions (95th percentile), had every sampled profile in view, the profiles 0.33 km (median) from the predicted track, and epochs within 0.66 s (95th percentile), passing every gate. The record keeps the element set chosen by the rule (epoch nearest the day's middle), so this result is not counted toward the tier. +limitations: + - The view observes everywhere along its track, whereas products omit profiles by quality and mode. + - EarthCARE's altitude varies from about 398 to 425 km around its orbit, so the footprint lies 21 to 23 km behind the satellite's nadir. diff --git a/src/tatc/resources/instruments/bbr.yml b/src/tatc/resources/instruments/bbr.yml new file mode 100644 index 0000000..edf247a --- /dev/null +++ b/src/tatc/resources/instruments/bbr.yml @@ -0,0 +1,84 @@ +id: bbr +name: BBR +aliases: [EarthCARE BBR, Broadband Radiometer] +instrument_class: pushbroom +selection: Broadband radiometer of EarthCARE, which measures reflected shortwave and emitted longwave radiances in three fixed views along track (about 50 deg aft, nadir, and 50 deg fore) for top-of-atmosphere fluxes, flying with ATLID, CPR, and MSI. +platforms: + - id: earthcare + name: EarthCARE + norad_id: 59908 + status: operational + as_of: 2026-11-07 +data_products: + - name: BBR_SNG_1B + provider: ESA MAAP + url: https://earth.esa.int/eogateway/catalog/earthcare-l1-products + access: registration +default_configuration: views +configurations: + views: + grade: timing + description: The aft, nadir, and fore views (instrument indices 0, 1, and 2), each a line of 30 pixels across track, with a view tailored to the analysis time step. Analyze one at a time with its instrument index; the views observe the same ground about 70 s apart. + platforms: [earthcare] + velocity_frame: earth_fixed + grouping: alternatives + instruments: + - type: pointed + parameters: + name: BBR aft + field_of_regard: 100.7374 + cross_track_field_of_view: 2.4165 + along_track_field_of_view: {tailor: time_step} + roll_angle: 0.0964 + pitch_angle: -50.3554 + is_swept: true + is_rectangular: true + provenance: &provenance + field_of_regard: + kind: derived + source: Contains the view's cross-track line, rolled and then pitched by its offsets, as the field of regard bounds the period in which a point can be observed + cross_track_field_of_view: &measured + kind: measured + source: validate_catalog_bbr.py --fit-view, the view that TAT-C centers on the outermost pixels of the shortwave band, with the instrument's pitch (Earth-fixed frame), from the recorded platform positions + platform: earthcare + period: "2026-09-27" + roll_angle: *measured + pitch_angle: *measured + is_swept: {kind: derived, source: "Models the view as sweeping along track, so that its swaths are the strips its cross-track line sweeps, as observations of points do"} + along_track_field_of_view: + kind: derived + source: compute_along_track_field_of_view, from the orbit and time step + is_rectangular: + kind: derived + source: Models an imaged line as a rectangular view + - type: pointed + parameters: + name: BBR nadir + field_of_regard: 2.4359 + cross_track_field_of_view: 2.4165 + along_track_field_of_view: {tailor: time_step} + roll_angle: 0.0062 + pitch_angle: -0.0913 + is_swept: true + is_rectangular: true + provenance: *provenance + - type: pointed + parameters: + name: BBR fore + field_of_regard: 100.3558 + cross_track_field_of_view: 2.4164 + along_track_field_of_view: {tailor: time_step} + roll_angle: -0.0970 + pitch_angle: 50.1645 + is_swept: true + is_rectangular: true + provenance: *provenance + limitations: + - On the day of the fit, the views' lines were straight across track, with slopes of 0.06 deg (aft), 0.01 deg (nadir), and 0.01 deg (fore) in TAT-C's frame, constant at every latitude and in both directions in the Earth-fixed frame (EarthCARE steers its yaw); in the inertial frame, the lines' yaw varied by about 7 deg. + - The views were fitted to the shortwave band; the longwave band images the same pixels about 0.08 s later. + - The products break for about 4.3 s about every 93 s (about 950 breaks a day, about 5% of the day), so the area they observe is striped across track. The views are scored with breaks over 1 s as periods without data, rather than over 60 s as for other entries; the swath area compared omits cells nearest the lines that border them. This was chosen after a first score on the day of the fit, in which the aft view's swath IoU was 0.943 (with 94.6% of predicted passes observed); with it, the views' swath IoU was 0.990 (aft), 0.983 (nadir), and 0.989 (fore) on that day, with 99.2 to 99.5% of passes predicted. + - On data held out on 2026-11-07 (41 days from the fit, with the element set whose epoch is nearest the day's middle, 15:03 UTC), the views predicted 97.3% (aft), 95.5% (nadir), and 97.9% (fore) of passes, failing the pass recall gate, with swath IoU 0.954, 0.921, and 0.952, the nadir view failing the swath IoU gate; epochs were within 0.52 s (95th percentile; +0.20 s median, against -0.01 s on the day of the fit) and swath width within 0.04 km (median). The same element set put the orbit up to 1.3 km across track from the positions recorded with ATLID's profiles that day (95th percentile), against 0.3 km on the day of the fit. + - The same held-out data tested afterward with the day's other element set (epoch 07:20 UTC) gave swath IoU 0.978 (aft), 0.963 (nadir), and 0.977 (fore), passing that gate, but the views still predicted only 98.6%, 97.5%, and 98.3% of passes, failing the pass recall gate, with epochs within 0.74 s (95th percentile; +0.27 to +0.29 s median) and swath width within 0.03 km (median). The element set alone does not account for the missed passes. The record keeps the element set chosen by the rule (epoch nearest the day's middle), so this result is not counted toward the tier. +limitations: + - The nadir view's swath is about 17 km wide, and the aft and fore views' about 28 km, at the orbit's altitude of about 400 km. + - Public Level 1 products of BBR cover blocks of about five days (as 2026-09-25 to 09-29, 10-15 to 10-19, and 11-04 to 11-08), whereas the views observe whenever a target is in view. diff --git a/src/tatc/resources/instruments/cpr.yml b/src/tatc/resources/instruments/cpr.yml new file mode 100644 index 0000000..5c158f5 --- /dev/null +++ b/src/tatc/resources/instruments/cpr.yml @@ -0,0 +1,51 @@ +id: cpr +name: CPR +aliases: [EarthCARE CPR, Cloud Profiling Radar] +instrument_class: profiler +selection: 94 GHz Doppler cloud profiling radar of JAXA and NICT on EarthCARE, the first spaceborne Doppler cloud radar, with open profiles of reflectivity and vertical motion along a single beam at nadir, flying with ATLID, MSI, and BBR. +platforms: + - id: earthcare + name: EarthCARE + norad_id: 59908 + status: operational + as_of: 2026-11-07 +data_products: + - name: CPR_NOM_1B + provider: ESA MAAP (processed by JAXA) + url: https://earth.esa.int/eogateway/catalog/earthcare-l1-products + access: registration +default_configuration: nadir +configurations: + nadir: + grade: timing + description: A narrow view at nadir, about 10 km wide, that contains the radar's footprint, with a view tailored to the analysis time step. + platforms: [earthcare] + velocity_frame: earth_fixed + instruments: + - type: pointed + parameters: + name: CPR + field_of_regard: 1.432 + cross_track_field_of_view: 1.432 + along_track_field_of_view: {tailor: time_step} + is_swept: true + is_rectangular: true + provenance: + field_of_regard: &width + kind: derived + source: 2 atan(5 km / 400 km), a view about 10 km wide at the orbit's altitude, which contains the footprint (about 0.8 km wide) at nadir given the error of an element set near the day + cross_track_field_of_view: *width + is_swept: {kind: derived, source: "Models the view as sweeping along track, so that its swaths are the strips its cross-track line sweeps, as observations of points do"} + along_track_field_of_view: + kind: derived + source: compute_along_track_field_of_view, from the orbit and time step + is_rectangular: + kind: derived + source: Models the band along the ground track as a rectangular view + limitations: + - The view's width is not the footprint's; it is wide enough to contain the profiles' positions given the error of an element set near the day of the analysis. + - On data held out on 2026-11-07 (41 days from the fit, with the element set whose epoch is nearest the day's middle, 15:03 UTC), every sampled profile was within the view at its time and epochs were within 0.48 s (95th percentile; +0.20 s median), but the profiles lay 0.72 km (median) across track from the predicted ground track, failing the track offset gate. The element set's inclination (97.0160 deg) differs by about 0.01 deg from those of the sets around it (97.006 to 97.008 deg), and its orbit lay up to 1.3 km across track from the recorded positions (95th percentile), against 0.3 km on the day of the fit. + - The same held-out data tested afterward with the day's other element set (epoch 07:20 UTC), whose orbit lay within 0.7 km across track of the recorded positions (95th percentile), had every sampled profile in view, the profiles 0.33 km (median) from the predicted ground track, and epochs within 0.69 s (95th percentile), passing every gate. The record keeps the element set chosen by the rule (epoch nearest the day's middle), so this result is not counted toward the tier. +limitations: + - The product's profile positions lie at the geodetic nadir of the recorded spacecraft positions (within 0.007 deg, 5th to 95th percentiles, on 2026-09-27; validate_catalog_cpr.py --fit), so the track offset tests the element set as much as the view. + - The view observes everywhere along the ground track, whereas products omit profiles by quality and mode. diff --git a/src/tatc/resources/instruments/earthcare_msi.yml b/src/tatc/resources/instruments/earthcare_msi.yml new file mode 100644 index 0000000..03502e6 --- /dev/null +++ b/src/tatc/resources/instruments/earthcare_msi.yml @@ -0,0 +1,59 @@ +id: earthcare_msi +name: EarthCARE MSI +aliases: [EarthCARE Multi-Spectral Imager] +instrument_class: pushbroom +selection: Multi-spectral pushbroom imager of EarthCARE, with seven visible to thermal infrared bands across a 150 km swath tilted away from the sun, which gives the scene around the profiles of ATLID and CPR. +platforms: + - id: earthcare + name: EarthCARE + norad_id: 59908 + status: operational + as_of: 2026-11-07 +data_products: + - name: MSI_RGR_1C + provider: ESA MAAP + url: https://earth.esa.int/eogateway/catalog/earthcare-l1-products + access: registration +default_configuration: swath +configurations: + swath: + grade: timing + description: The swath of the imaged pixels, from about 120 km to the left of the ground track to 39 km to its right, with a view tailored to the analysis time step. + platforms: [earthcare] + velocity_frame: earth_fixed + instruments: + - type: pointed + parameters: + name: EarthCARE MSI + field_of_regard: 33.7128 + cross_track_field_of_view: 22.4603 + along_track_field_of_view: {tailor: time_step} + roll_angle: 5.6148 + pitch_angle: -0.6226 + is_swept: true + is_rectangular: true + provenance: + field_of_regard: + kind: derived + source: Contains the view's cross-track line, rolled and then pitched by its offsets, as the field of regard bounds the period in which a point can be observed + cross_track_field_of_view: &measured + kind: measured + source: validate_catalog_earthcare_msi.py --fit-view, the view that TAT-C centers on the outermost imaged pixels (columns 12 and 368 of MSI_RGR_1C), with the instrument's pitch (Earth-fixed frame), from spacecraft positions of ATL_NOM_1B + platform: earthcare + period: "2026-09-27" + roll_angle: *measured + pitch_angle: *measured + is_swept: {kind: derived, source: "Models the view as sweeping along track, so that its swaths are the strips its cross-track line sweeps, as observations of points do"} + along_track_field_of_view: + kind: derived + source: compute_along_track_field_of_view, from the orbit and time step + is_rectangular: + kind: derived + source: Models an imaged line as a rectangular view + limitations: + - The view is not yawed. In TAT-C's frame, the imaged line slopes 0.04 deg along track on the day of the fit (a yaw of about 0.04 deg straightens it), which places the swath's edges within about 0.1 km along track. + - The swath is that of the 357 imaged columns of the regridded product (MSI_RGR_1C), whose grid of 384 columns is padded with fill. +limitations: + - EarthCARE steers its yaw, so the configuration uses the Earth-fixed frame, in which the fitted line's slope was constant within 0.01 deg at every latitude and in both directions; in the inertial frame, it varied by about 7 deg. + - The visible and near-infrared bands image the sunlit part of each orbit, whereas the view observes whenever a target is in view, unless a solar limit is added. + - On data held out on 2026-11-07 (41 days from the fit, with the element set whose epoch is nearest the day's middle, which lay up to 1.3 km across track from the recorded positions), 99.55% of observed passes were predicted, with epochs within 0.50 s (95th percentile), swath width within 0.22 km (median), and swath IoU 0.989. diff --git a/src/tatc/resources/instruments/tmi.yml b/src/tatc/resources/instruments/tmi.yml new file mode 100644 index 0000000..6fa9937 --- /dev/null +++ b/src/tatc/resources/instruments/tmi.yml @@ -0,0 +1,145 @@ +id: tmi +name: TMI +aliases: [TRMM TMI, TRMM Microwave Imager] +instrument_class: conical +selection: Conically scanning microwave imager of the Tropical Rainfall Measuring Mission, with open precipitation and brightness temperature products from 1997 to 2015, the predecessor of GPM's GMI. +platforms: + - id: trmm + name: TRMM + norad_id: 25063 + status: retired + as_of: 2015-04-15 +data_products: + - name: GPM_1CTRMMTMI + provider: NASA GES DISC + url: https://disc.gsfc.nasa.gov/datasets/GPM_1CTRMMTMI_08/summary + access: registration +default_configuration: feeds +configurations: + feeds: + grade: timing + description: The arcs scanned by the 10 GHz (S1), 19 to 37 GHz (S2), and 85.5 GHz (S3) samples, flying forward, with a view tailored to the analysis time step. Analyze one at a time with its instrument index. + platforms: [trmm] + velocity_frame: inertial + grouping: alternatives + instruments: + - type: conical + parameters: + name: TMI S1 + cone_angle: 49.326 + scan_center_azimuth: -0.322 + scan_half_width: 64.537 + along_track_field_of_view: {tailor: time_step} + provenance: + cone_angle: &measured + kind: measured + source: validate_catalog_tmi.py --fit, from each group's samples and the recorded spacecraft positions (printed to 3 decimals) + platform: trmm + period: "2013-06-01" + scan_center_azimuth: *measured + scan_half_width: *measured + along_track_field_of_view: &tailored + kind: derived + source: compute_along_track_field_of_view, from the orbit and time step + - type: conical + parameters: + name: TMI S2 + cone_angle: 49.179 + scan_center_azimuth: 0.129 + scan_half_width: 64.491 + along_track_field_of_view: {tailor: time_step} + provenance: + cone_angle: *measured + scan_center_azimuth: *measured + scan_half_width: *measured + along_track_field_of_view: *tailored + - type: conical + parameters: + name: TMI S3 + cone_angle: 49.180 + scan_center_azimuth: -0.182 + scan_half_width: 64.802 + along_track_field_of_view: {tailor: time_step} + provenance: + cone_angle: *measured + scan_center_azimuth: *measured + scan_half_width: *measured + along_track_field_of_view: *tailored + limitations: + - TRMM periodically flew backward (yaw maneuvers every two to four weeks, as on 2013-06-15 and 2013-06-28), when TMI scanned behind the satellite. These configurations represent forward flight (the products' SCorientation of 0); supply an attitude schedule for backward flight. + sample_size: + grade: sample_size + description: The beams of TMI's channels at the angles of the feeds configuration, flying forward, whose footprints and spacing `compute_sample_sizes` gives. Analyze one at a time with its instrument index. + platforms: [trmm] + velocity_frame: inertial + grouping: alternatives + instruments: + - type: conical + parameters: + name: TMI 10.65 GHz + cone_angle: 49.326 + scan_center_azimuth: -0.322 + scan_half_width: 64.537 + along_track_field_of_view: {tailor: time_step} + beam_width: 3.68 + scan_sample_spacing: 1.2512 + provenance: + cone_angle: *measured + scan_center_azimuth: *measured + scan_half_width: *measured + along_track_field_of_view: *tailored + beam_width: &beam_width + kind: nominal + source: Kummerow et al. (1998), TMI characteristics (vertical polarization), as reproduced by NOAA MiRS + scan_sample_spacing: &sample_spacing + kind: derived + source: The integration time of 6.6 ms (3.3 ms at 85.5 GHz) of Kummerow et al. (1998), over the scan period of 1.899 s measured by validate_catalog_tmi.py --fit + - type: conical + parameters: &middle_frequency + name: TMI 19.35 GHz + cone_angle: 49.179 + scan_center_azimuth: 0.129 + scan_half_width: 64.491 + along_track_field_of_view: {tailor: time_step} + beam_width: 1.90 + scan_sample_spacing: 1.2512 + provenance: &middle_frequency_provenance + cone_angle: *measured + scan_center_azimuth: *measured + scan_half_width: *measured + along_track_field_of_view: *tailored + beam_width: *beam_width + scan_sample_spacing: *sample_spacing + - type: conical + parameters: + <<: *middle_frequency + name: TMI 21.3 GHz + beam_width: 1.70 + provenance: *middle_frequency_provenance + - type: conical + parameters: + <<: *middle_frequency + name: TMI 37.0 GHz + beam_width: 1.0 + provenance: *middle_frequency_provenance + - type: conical + parameters: + name: TMI 85.5 GHz + cone_angle: 49.180 + scan_center_azimuth: -0.182 + scan_half_width: 64.802 + along_track_field_of_view: {tailor: time_step} + beam_width: 0.42 + scan_sample_spacing: 0.6256 + provenance: + cone_angle: *measured + scan_center_azimuth: *measured + scan_half_width: *measured + along_track_field_of_view: *tailored + beam_width: *beam_width + scan_sample_spacing: *sample_spacing + limitations: + - TRMM periodically flew backward, when TMI scanned behind the satellite. These configurations represent forward flight; supply an attitude schedule for backward flight. +limitations: + - The fitted angles were measured at an altitude of about 400 km, after TRMM's orbit boost of August 2001 and before its descent from late 2014; before the boost, TRMM flew at about 350 km. + - On data held out on 2013-07-10 (39 days from the fit, in forward flight), the feeds predicted 99.66 to 99.80% of observed passes, with 99.85 to 99.95% of predicted passes observed, epochs within 0.75 s (95th percentile), swath width within 2.5 to 2.9 km (median), and swath IoU 0.995 to 0.996. The sample sizes at the center of the scan were within 3% of 90% of the published dimensions (the gate's limit), the largest error 3.7% across track at 85.5 GHz. diff --git a/src/tatc/resources/instruments/trmm_pr.yml b/src/tatc/resources/instruments/trmm_pr.yml new file mode 100644 index 0000000..8468eb3 --- /dev/null +++ b/src/tatc/resources/instruments/trmm_pr.yml @@ -0,0 +1,102 @@ +id: trmm_pr +name: PR +aliases: [TRMM PR, TRMM Precipitation Radar, Precipitation Radar] +instrument_class: cross_track +selection: Cross-track precipitation radar of the Tropical Rainfall Measuring Mission, the first spaceborne precipitation radar, with open three-dimensional precipitation products from 1997 to 2015, the predecessor of GPM's DPR. +platforms: + - id: trmm + name: TRMM + norad_id: 25063 + status: retired + as_of: 2015-04-15 +data_products: + - name: GPM_2APR + provider: NASA GES DISC + url: https://disc.gsfc.nasa.gov/datasets/GPM_2APR_07/summary + access: registration +default_configuration: swath +configurations: + swath: + grade: timing + description: The swath scanned between the outermost beam centers, with a view tailored to the analysis time step. + platforms: [trmm] + velocity_frame: inertial + instruments: + - type: pointed + parameters: + name: PR + field_of_regard: 33.9791 + cross_track_field_of_view: 33.9791 + along_track_field_of_view: {tailor: time_step} + is_swept: true + is_rectangular: true + provenance: + field_of_regard: &measured_extent + kind: measured + source: validate_catalog_trmm_pr.py --fit, between the outermost beams (printed to 4 decimals) + platform: trmm + period: "2013-06-01" + cross_track_field_of_view: *measured_extent + is_swept: {kind: derived, source: "Models the view as sweeping along track, so that its swaths are the strips its cross-track line sweeps, as observations of points do"} + along_track_field_of_view: + kind: derived + source: compute_along_track_field_of_view, from the orbit and time step + is_rectangular: + kind: derived + source: Models a scanned swath as a rectangular view + limitations: + - The view is centered on nadir. The outermost beams measure 16.96 deg to the left and 17.02 deg to the right. + beams: + grade: sample_size + description: The 49 beam positions of a scan, whose footprints and spacing `compute_sample_sizes` gives. + platforms: [trmm] + velocity_frame: inertial + instruments: + - type: pointed + parameters: + name: PR + field_of_regard: 34.6935 + cross_track_field_of_view: 34.6935 + along_track_field_of_view: 0.70803 + cross_track_pixels: 49 + roll_angle: -0.0269 + is_rectangular: true + cross_track_oversampling: 0.002775 + along_track_oversampling: 0.002775 + scan_period: 0.5997 + provenance: + field_of_regard: &measured_spacing + kind: measured + source: validate_catalog_trmm_pr.py --fit, a fitted spacing of 0.70803 deg over 49 beams + platform: trmm + period: "2013-06-01" + cross_track_field_of_view: *measured_spacing + along_track_field_of_view: *measured_spacing + cross_track_pixels: + kind: nominal + source: The PR scans 49 angle bins (JAXA PR Instruction Manual, Version 7) + roll_angle: + kind: measured + source: validate_catalog_trmm_pr.py --fit, the offset of the fitted beam angles + platform: trmm + period: "2013-06-01" + is_rectangular: + kind: derived + source: Models a scan line as a rectangular view + cross_track_oversampling: &oversampling + kind: derived + source: One minus the fitted spacing divided by the beam width of 0.71 deg, published in Table 0-2 of the JAXA PR Instruction Manual, Version 7 + along_track_oversampling: *oversampling + scan_period: + kind: measured + source: validate_catalog_trmm_pr.py --fit, the median time between scans + platform: trmm + period: "2013-06-01" + limitations: + - TAT-C projects all pixels of a scan at one instant, at the time the product gives for the scan. + - The published footprint (TC PRIMED documentation, after the orbit boost) is 5.0 km at nadir and at the scan's edge, whereas the beam width (0.71 deg) gives about 5.4 km across track at the edge; on data held out on 2013-07-10 (39 days from the fit), 75% of the published dimensions were within 3% (largest error 7.9%, across track at the edge), failing the sample size gate, while the projected beams were within 1.43 km (median) of the product's and the spacing within 0.1%. +limitations: + - TRMM periodically flew backward (yaw maneuvers every two to four weeks). The scan is nearly symmetric, so the swath is unchanged, but the small roll of the beams configuration changes sign. + - The fitted angles were measured at an altitude of about 400 km, after TRMM's orbit boost of August 2001 and before its descent from late 2014; before the boost, TRMM flew at about 350 km, with a narrower swath. + - Products report precipitation only where the radar detects it; these configurations describe where the radar samples, not where it detects precipitation. + - On data held out on 2013-07-10 (39 days from the fit, in forward flight), the swath predicted 99.89% of observed passes, with 99.73% of predicted passes observed, epochs within 0.48 s (95th percentile), swath width within 0.07 km (median), and swath IoU 0.997. diff --git a/src/tatc/resources/instruments/virs.yml b/src/tatc/resources/instruments/virs.yml new file mode 100644 index 0000000..46b46de --- /dev/null +++ b/src/tatc/resources/instruments/virs.yml @@ -0,0 +1,99 @@ +id: virs +name: VIRS +aliases: [TRMM VIRS, Visible and Infrared Scanner] +instrument_class: cross_track +selection: Cross-track visible and infrared scanner of the Tropical Rainfall Measuring Mission, with open calibrated radiances from 1997 to 2014, flying with the PR and TMI for cloud context of precipitation. +platforms: + - id: trmm + name: TRMM + norad_id: 25063 + status: retired + as_of: 2015-04-15 +data_products: + - name: GPM_1BVIRS + provider: NASA GES DISC + url: https://disc.gsfc.nasa.gov/datasets/GPM_1BVIRS_08/summary + access: registration +default_configuration: swath +configurations: + swath: + grade: timing + description: The swath scanned between the outermost samples, with a view tailored to the analysis time step. + platforms: [trmm] + velocity_frame: inertial + instruments: + - type: pointed + parameters: + name: VIRS + field_of_regard: 89.7298 + cross_track_field_of_view: 89.7298 + along_track_field_of_view: {tailor: time_step} + is_swept: true + is_rectangular: true + provenance: + field_of_regard: &measured_extent + kind: measured + source: validate_catalog_virs.py --fit, between the outermost samples (printed to 4 decimals) + platform: trmm + period: "2013-06-01" + cross_track_field_of_view: *measured_extent + is_swept: {kind: derived, source: "Models the view as sweeping along track, so that its swaths are the strips its cross-track line sweeps, as observations of points do"} + along_track_field_of_view: + kind: derived + source: compute_along_track_field_of_view, from the orbit and time step + is_rectangular: + kind: derived + source: Models a scanned swath as a rectangular view + limitations: + - The view is centered on nadir. The outermost samples measure 44.74 deg to the left and 44.99 deg to the right. + pixels: + grade: sample_size + description: The 261 samples of a scan line, whose sizes and spacing `compute_sample_sizes` gives. + platforms: [trmm] + velocity_frame: inertial + instruments: + - type: pointed + parameters: + name: VIRS + field_of_regard: 90.3173 + cross_track_field_of_view: 90.0737 + along_track_field_of_view: 0.34511 + cross_track_pixels: 261 + roll_angle: -0.1218 + is_rectangular: true + scan_period: 0.30467 + provenance: + field_of_regard: + kind: derived + source: The rolled view, so that every pixel can be observed + cross_track_field_of_view: &measured_spacing + kind: measured + source: validate_catalog_virs.py --fit, a fitted spacing of 0.34511 deg over 261 samples + platform: trmm + period: "2013-06-01" + along_track_field_of_view: + kind: derived + source: The fitted spacing across track, as the TRMM Version 7 README of GES DISC gives VIRS's horizontal resolution as identical in both directions + cross_track_pixels: + kind: nominal + source: The GPM-format VIRS product has 261 samples per scan + roll_angle: + kind: measured + source: validate_catalog_virs.py --fit, the offset of the fitted sample angles + platform: trmm + period: "2013-06-01" + is_rectangular: + kind: derived + source: Models a scan line as a rectangular view + scan_period: + kind: measured + source: validate_catalog_virs.py --fit, the median time between scans + platform: trmm + period: "2013-06-01" + limitations: + - TAT-C projects all pixels of a scan at one instant, at the time the product gives for the scan. +limitations: + - The products give no spacecraft positions, so the fit took them from the PR product of the same spacecraft, interpolated to the scans' times. + - On data held out on 2013-07-10 (39 days from the fit, in forward flight), 99.81% of observed passes were predicted and 99.74% of predicted passes observed, with epochs within 0.59 s (95th percentile), swath width within 0.24 km (median), and swath IoU 0.994; the pixels were within 2.19 km (median) of the product's. + - TRMM periodically flew backward (yaw maneuvers every two to four weeks). The scan is nearly symmetric, so the swath is nearly unchanged, but the roll of the pixels configuration changes sign. The configurations were fitted and tested in forward flight. + - The fitted angles were measured at an altitude of about 400 km, after TRMM's orbit boost of August 2001; before the boost, TRMM flew at about 350 km, with a swath of about 720 km rather than 833 km. VIRS products end on 2014-03-21. diff --git a/src/tatc/resources/validation/atlid.json b/src/tatc/resources/validation/atlid.json new file mode 100644 index 0000000..bda4d29 --- /dev/null +++ b/src/tatc/resources/validation/atlid.json @@ -0,0 +1,38 @@ +{ + "entry_id": "atlid", + "configurations": { + "profile": { + "digest": "e5519e6a3649052d584f93a14cd30790cceb1d49489a3d023983e02f5d6ee636", + "evidence": "rerun", + "tatc_version": "3.6.0", + "source": "docs/validation/validate_catalog_atlid.py", + "reference": "ATL_NOM_1B (profile positions and times)", + "period": "2026-11-07", + "platform": "earthcare", + "holdout_gap_days": 41, + "metrics": [ + { + "name": "segment_recall", + "value": 100.0 + }, + { + "name": "track_offset_median", + "value": 0.7199765593224472 + }, + { + "name": "epoch_p95", + "value": 0.4611468649 + }, + { + "name": "epoch_median", + "value": 0.176493774 + } + ], + "fixture_metrics": { + "passes_found": 100.0, + "epoch_p95": 0.4253327837999999 + } + } + }, + "standard_version": 6 +} diff --git a/src/tatc/resources/validation/bbr.json b/src/tatc/resources/validation/bbr.json new file mode 100644 index 0000000..f7b8e27 --- /dev/null +++ b/src/tatc/resources/validation/bbr.json @@ -0,0 +1,97 @@ +{ + "entry_id": "bbr", + "configurations": { + "views": { + "digest": "6287376998a9ec6e1230e2850df062d2266f5336b5e7d8c4d2601a4d98de31e5", + "evidence": "rerun", + "tatc_version": "3.6.0", + "source": "docs/validation/validate_catalog_bbr.py", + "reference": "BBR_SNG_1B (pixel positions of the shortwave band, every second line)", + "period": "2026-11-07", + "platform": "earthcare", + "holdout_gap_days": 41, + "metrics": [ + { + "name": "pass_recall", + "value": 97.33395696913003, + "scope": "AFT" + }, + { + "name": "pass_precision", + "value": 97.06156716417911, + "scope": "AFT" + }, + { + "name": "epoch_p95", + "value": 0.517491556, + "scope": "AFT" + }, + { + "name": "swath_width_median", + "value": 0.0399950705478841, + "scope": "AFT" + }, + { + "name": "footprint_iou_median", + "value": 0.954000722926982, + "scope": "AFT" + }, + { + "name": "pass_recall", + "value": 95.46153846153847, + "scope": "NADIR" + }, + { + "name": "pass_precision", + "value": 95.09578544061303, + "scope": "NADIR" + }, + { + "name": "epoch_p95", + "value": 0.485210016, + "scope": "NADIR" + }, + { + "name": "swath_width_median", + "value": 0.022892851818534836, + "scope": "NADIR" + }, + { + "name": "footprint_iou_median", + "value": 0.9211915996174782, + "scope": "NADIR" + }, + { + "name": "pass_recall", + "value": 97.88732394366197, + "scope": "FORE" + }, + { + "name": "pass_precision", + "value": 97.06703910614524, + "scope": "FORE" + }, + { + "name": "epoch_p95", + "value": 0.5146054552, + "scope": "FORE" + }, + { + "name": "swath_width_median", + "value": 0.03932505477282029, + "scope": "FORE" + }, + { + "name": "footprint_iou_median", + "value": 0.9518515080382464, + "scope": "FORE" + } + ], + "fixture_metrics": { + "passes_found": 96.66666666666667, + "epoch_p95": 0.501839136 + } + } + }, + "standard_version": 6 +} diff --git a/src/tatc/resources/validation/cpr.json b/src/tatc/resources/validation/cpr.json new file mode 100644 index 0000000..45afd0d --- /dev/null +++ b/src/tatc/resources/validation/cpr.json @@ -0,0 +1,38 @@ +{ + "entry_id": "cpr", + "configurations": { + "nadir": { + "digest": "c71562f90b481806dbdbe5d458988cfe622d6e7d4708514f6b7edb1471ab5bcd", + "evidence": "rerun", + "tatc_version": "3.6.0", + "source": "docs/validation/validate_catalog_cpr.py", + "reference": "CPR_NOM_1B (profile positions and times)", + "period": "2026-11-07", + "platform": "earthcare", + "holdout_gap_days": 41, + "metrics": [ + { + "name": "segment_recall", + "value": 100.0 + }, + { + "name": "track_offset_median", + "value": 0.7189287950122534 + }, + { + "name": "epoch_p95", + "value": 0.48488375245 + }, + { + "name": "epoch_median", + "value": 0.2038715585 + } + ], + "fixture_metrics": { + "passes_found": 100.0, + "epoch_p95": 0.4574536675499999 + } + } + }, + "standard_version": 6 +} diff --git a/src/tatc/resources/validation/earthcare_msi.json b/src/tatc/resources/validation/earthcare_msi.json new file mode 100644 index 0000000..fa1ab46 --- /dev/null +++ b/src/tatc/resources/validation/earthcare_msi.json @@ -0,0 +1,42 @@ +{ + "entry_id": "earthcare_msi", + "configurations": { + "swath": { + "digest": "b686125d467695ed4e9e8819886ed578b9b5b4450bf6a5cf152ec7eb72067dc4", + "evidence": "rerun", + "tatc_version": "3.6.0", + "source": "docs/validation/validate_catalog_earthcare_msi.py", + "reference": "MSI_RGR_1C (pixel positions of every fourth orbit, every eighth line), with spacecraft positions of ATL_NOM_1B", + "period": "2026-11-07", + "platform": "earthcare", + "holdout_gap_days": 41, + "metrics": [ + { + "name": "pass_recall", + "value": 99.54560207724765 + }, + { + "name": "pass_precision", + "value": 99.54560207724765 + }, + { + "name": "epoch_p95", + "value": 0.4999694812 + }, + { + "name": "swath_width_median", + "value": 0.22029766902091796 + }, + { + "name": "footprint_iou_median", + "value": 0.989315821762553 + } + ], + "fixture_metrics": { + "passes_found": 100.0, + "epoch_p95": 0.5024910009499999 + } + } + }, + "standard_version": 6 +} diff --git a/src/tatc/resources/validation/tmi.json b/src/tatc/resources/validation/tmi.json new file mode 100644 index 0000000..136e97c --- /dev/null +++ b/src/tatc/resources/validation/tmi.json @@ -0,0 +1,156 @@ +{ + "entry_id": "tmi", + "configurations": { + "sample_size": { + "digest": "d3202819e316ccb7d2d81f515f2e37255dee46024cd2ba668b0e046bcc138a36", + "evidence": "rerun", + "tatc_version": "3.6.0", + "source": "docs/validation/validate_catalog_tmi.py", + "reference": "Footprints of the TC PRIMED documentation; spacing of GPM_1CTRMMTMI version 08", + "period": "2013-07-10", + "platform": "trmm", + "holdout_gap_days": 39, + "metrics": [ + { + "name": "sample_size_within_3pct", + "value": 90.0 + }, + { + "name": "sample_size_largest_error", + "value": 3.6684429733183865 + }, + { + "name": "spacing_arc_ratio_median", + "value": 1.0064354081074307, + "scope": "S1" + }, + { + "name": "spacing_scan_ratio_median", + "value": 1.0167542466015138, + "scope": "S1" + }, + { + "name": "spacing_arc_ratio_median", + "value": 1.0073094442553039, + "scope": "S2" + }, + { + "name": "spacing_scan_ratio_median", + "value": 1.016750635214927, + "scope": "S2" + }, + { + "name": "spacing_arc_ratio_median", + "value": 1.0072878236752607, + "scope": "S3" + }, + { + "name": "spacing_scan_ratio_median", + "value": 1.0167702165622625, + "scope": "S3" + } + ], + "fixture_metrics": { + "sample_size_within_3pct": 90.0, + "spacing_arc_ratio_median_S1": 1.0063197849779906, + "spacing_scan_ratio_median_S1": 1.0179568283375442, + "spacing_arc_ratio_median_S2": 1.0080807886389849, + "spacing_scan_ratio_median_S2": 1.020637233614014, + "spacing_arc_ratio_median_S3": 1.0071425417335256, + "spacing_scan_ratio_median_S3": 1.013955665952739 + } + }, + "feeds": { + "digest": "06706e6a6316ae9b6c8492e66e39647c96d8019283648a55f030b901a44bce48", + "evidence": "rerun", + "tatc_version": "3.6.0", + "source": "docs/validation/validate_catalog_tmi.py", + "reference": "GPM_1CTRMMTMI version 08 (positions of the S1, S2, and S3 samples)", + "period": "2013-07-10", + "platform": "trmm", + "holdout_gap_days": 39, + "metrics": [ + { + "name": "pass_recall", + "value": 99.66197944835046, + "scope": "S1" + }, + { + "name": "pass_precision", + "value": 99.85098889189922, + "scope": "S1" + }, + { + "name": "epoch_p95", + "value": 0.747224621, + "scope": "S1" + }, + { + "name": "swath_width_median", + "value": 2.925942876422545, + "scope": "S1" + }, + { + "name": "footprint_iou_median", + "value": 0.9964058124529312, + "scope": "S1" + }, + { + "name": "pass_recall", + "value": 99.68715995647443, + "scope": "S2" + }, + { + "name": "pass_precision", + "value": 99.945452066003, + "scope": "S2" + }, + { + "name": "epoch_p95", + "value": 0.7481998721999997, + "scope": "S2" + }, + { + "name": "swath_width_median", + "value": 2.474207290029386, + "scope": "S2" + }, + { + "name": "footprint_iou_median", + "value": 0.9964799455541511, + "scope": "S2" + }, + { + "name": "pass_recall", + "value": 99.79616795760293, + "scope": "S3" + }, + { + "name": "pass_precision", + "value": 99.87760097919217, + "scope": "S3" + }, + { + "name": "epoch_p95", + "value": 0.7477911938499995, + "scope": "S3" + }, + { + "name": "swath_width_median", + "value": 2.4538273128502768, + "scope": "S3" + }, + { + "name": "footprint_iou_median", + "value": 0.9953404613800938, + "scope": "S3" + } + ], + "fixture_metrics": { + "passes_found": 100.0, + "epoch_p95": 0.7493399012999999 + } + } + }, + "standard_version": 6 +} diff --git a/src/tatc/resources/validation/trmm_pr.json b/src/tatc/resources/validation/trmm_pr.json new file mode 100644 index 0000000..ceaf134 --- /dev/null +++ b/src/tatc/resources/validation/trmm_pr.json @@ -0,0 +1,84 @@ +{ + "entry_id": "trmm_pr", + "configurations": { + "beams": { + "digest": "dd262ee432d302cd5b1c611723d72397ef984a2e7243c409ba50494a2f44a364", + "evidence": "rerun", + "tatc_version": "3.6.0", + "source": "docs/validation/validate_catalog_trmm_pr.py", + "reference": "Footprints of the TC PRIMED documentation; beam positions of GPM_2APR version 07", + "period": "2013-07-10", + "platform": "trmm", + "holdout_gap_days": 39, + "metrics": [ + { + "name": "sample_size_within_3pct", + "value": 75.0 + }, + { + "name": "sample_size_largest_error", + "value": 7.852917384362312 + }, + { + "name": "pixel_position_median", + "value": 1.4305026963940388 + }, + { + "name": "pixel_position_p95", + "value": 3.3162060306343313 + }, + { + "name": "spacing_along_ratio_median", + "value": 1.0004575792433081 + }, + { + "name": "spacing_cross_ratio_median", + "value": 0.9999036149143976 + } + ], + "fixture_metrics": { + "sample_size_within_3pct": 75.0, + "pixel_position_median": 1.4943282339928428, + "spacing_along_ratio_median": 1.000529865219386, + "spacing_cross_ratio_median": 0.9995917448877449 + } + }, + "swath": { + "digest": "4b6091eef521f2b0a097a5111d95f16de01347d9b1acf2bee3b165b9dd6f0191", + "evidence": "rerun", + "tatc_version": "3.6.0", + "source": "docs/validation/validate_catalog_trmm_pr.py", + "reference": "GPM_2APR version 07 (beam positions of the full swath)", + "period": "2013-07-10", + "platform": "trmm", + "holdout_gap_days": 39, + "metrics": [ + { + "name": "pass_recall", + "value": 99.89159304027318 + }, + { + "name": "pass_precision", + "value": 99.73481978569109 + }, + { + "name": "epoch_p95", + "value": 0.48247243139999985 + }, + { + "name": "swath_width_median", + "value": 0.07483880740018503 + }, + { + "name": "footprint_iou_median", + "value": 0.9972156199996317 + } + ], + "fixture_metrics": { + "passes_found": 100.0, + "epoch_p95": 0.5281053159499999 + } + } + }, + "standard_version": 6 +} diff --git a/src/tatc/resources/validation/virs.json b/src/tatc/resources/validation/virs.json new file mode 100644 index 0000000..bde921f --- /dev/null +++ b/src/tatc/resources/validation/virs.json @@ -0,0 +1,84 @@ +{ + "entry_id": "virs", + "configurations": { + "pixels": { + "digest": "b8688736d1951d0235a24974b3cfaf6564f6b7f8f268d8cf26c8e1bb7eb70093", + "evidence": "rerun", + "tatc_version": "3.6.0", + "source": "docs/validation/validate_catalog_virs.py", + "reference": "Footprint of the TRMM Version 7 README of GES DISC; sample positions of GPM_1BVIRS version 08", + "period": "2013-07-10", + "platform": "trmm", + "holdout_gap_days": 39, + "metrics": [ + { + "name": "sample_size_within_3pct", + "value": 100.0 + }, + { + "name": "sample_size_largest_error", + "value": 1.0091652868270962 + }, + { + "name": "pixel_position_median", + "value": 2.189287027937991 + }, + { + "name": "pixel_position_p95", + "value": 4.026097199506415 + }, + { + "name": "spacing_along_ratio_median", + "value": 1.0000837999522356 + }, + { + "name": "spacing_cross_ratio_median", + "value": 0.9995835694555084 + } + ], + "fixture_metrics": { + "sample_size_within_3pct": 100.0, + "pixel_position_median": 2.263626748871494, + "spacing_along_ratio_median": 0.9999832018870378, + "spacing_cross_ratio_median": 0.9995535402351696 + } + }, + "swath": { + "digest": "61cd341ff4c2a8cc972c0690743595a8c5181eec53f0efcef70d09e1911bc8ae", + "evidence": "rerun", + "tatc_version": "3.6.0", + "source": "docs/validation/validate_catalog_virs.py", + "reference": "GPM_1BVIRS version 08 (sample positions), with spacecraft positions of GPM_2APR version 07", + "period": "2013-07-10", + "platform": "trmm", + "holdout_gap_days": 39, + "metrics": [ + { + "name": "pass_recall", + "value": 99.80697464933728 + }, + { + "name": "pass_precision", + "value": 99.74279835390946 + }, + { + "name": "epoch_p95", + "value": 0.5919176145499999 + }, + { + "name": "swath_width_median", + "value": 0.24420979602454462 + }, + { + "name": "footprint_iou_median", + "value": 0.993953665594313 + } + ], + "fixture_metrics": { + "passes_found": 100.0, + "epoch_p95": 0.6144587818 + } + } + }, + "standard_version": 6 +} diff --git a/tests/catalog/fixtures/NOTICE.md b/tests/catalog/fixtures/NOTICE.md index 21c5eea..f9efd78 100644 --- a/tests/catalog/fixtures/NOTICE.md +++ b/tests/catalog/fixtures/NOTICE.md @@ -44,6 +44,13 @@ underlying data, whose providers' terms apply. | `ascat.npz` | Times of lattice points within wind vector cells of the MetOp-C ASCAT Level 2 25 km ocean surface wind vector product (`ASCATC-L2-25km`), 8 November 2026. Contains modified EUMETSAT OSI SAF MetOp-C ASCAT Level 2 25.0 km Ocean Surface Wind Vectors 2026; copyright 2026 EUMETSAT, used under CC BY 4.0. | [NASA PO.DAAC](https://podaac.jpl.nasa.gov/dataset/ASCATC-L2-25km), [EUMETSAT OSI SAF](https://osi-saf.eumetsat.int/licensing-and-attribution) | `docs/validation/validate_catalog_ascat.py` | | `tempo.npz` | Grid points near and away from the edges of the area imaged by a full scan of the TEMPO Level 1 radiance product (`TEMPO_RAD_L1`, version V04), 8 November 2026, with whether each was imaged | [NASA Langley ASDC](https://asdc.larc.nasa.gov/project/TEMPO) | `docs/validation/validate_catalog_tempo.py` | | `emit.npz` | Pixel positions and line times of the EMIT Level 1B observation geometry (`EMITL1BRAD`, version 002), 8 November 2026 | [NASA LP DAAC](https://lpdaac.usgs.gov/products/emitl1bradv002/) | `docs/validation/validate_catalog_emit.py` | +| `trmm_pr.npz` | Beam positions and scan times of `GPM_2APR` version 07 (full swath), 10 July 2013; footprint sizes published in the TC PRIMED documentation | [NASA GES DISC](https://disc.gsfc.nasa.gov/datasets/GPM_2APR_07/summary) | `docs/validation/validate_catalog_trmm_pr.py` | +| `virs.npz` | Pixel positions and scan times of `GPM_1BVIRS` version 08, 10 July 2013; footprint size published in the GES DISC TRMM Version 7 documentation | [NASA GES DISC](https://disc.gsfc.nasa.gov/datasets/GPM_1BVIRS_08/summary) | `docs/validation/validate_catalog_virs.py` | +| `tmi.npz` | Sample positions and scan times of `GPM_1CTRMMTMI` version 08, 10 July 2013; footprint sizes published in the TC PRIMED documentation | [NASA GES DISC](https://disc.gsfc.nasa.gov/datasets/GPM_1CTRMMTMI_08/summary) | `docs/validation/validate_catalog_tmi.py` | +| `atlid.npz` | Profile positions and times of the EarthCARE ATLID Level 1B nominal product (`ATL_NOM_1B`), 7 November 2026. Original data provided by ESA (European Space Agency). | [ESA MAAP](https://earth.esa.int/eogateway/catalog/earthcare-l1-products) | `docs/validation/validate_catalog_atlid.py` | +| `earthcare_msi.npz` | Times of points in the lattice of imaged pixels of the EarthCARE MSI Level 1C regridded product (`MSI_RGR_1C`), 7 November 2026. Original data provided by ESA (European Space Agency). | [ESA MAAP](https://earth.esa.int/eogateway/catalog/earthcare-l1-products) | `docs/validation/validate_catalog_earthcare_msi.py` | +| `cpr.npz` | Profile positions and times of the EarthCARE CPR Level 1B nominal product (`CPR_NOM_1B`), 7 November 2026. Original data provided by JAXA/NICT (Japan Aerospace Exploration Agency, and National Institute of Information and Communications Technology). | [ESA MAAP](https://earth.esa.int/eogateway/catalog/earthcare-l1-products) | `docs/validation/validate_catalog_cpr.py` | +| `bbr.npz` | Times of points in the lattice of pixels of the nadir view of the EarthCARE BBR Level 1B single-pixel product (`BBR_SNG_1B`), 7 November 2026. Original data provided by ESA (European Space Agency). | [ESA MAAP](https://earth.esa.int/eogateway/catalog/earthcare-l1-products) | `docs/validation/validate_catalog_bbr.py` | | `gedi.npz` | Shot positions and times of the GEDI Level 1B geolocated waveform product (`GEDI01_B`, version 003), 8 June 2026 | [NASA LP DAAC](https://lpdaac.usgs.gov/products/gedi01_bv003/) | `docs/validation/validate_catalog_gedi.py` | Each fixture also holds two-line element sets, used to propagate the satellite's diff --git a/tests/catalog/fixtures/atlid.npz b/tests/catalog/fixtures/atlid.npz new file mode 100644 index 0000000000000000000000000000000000000000..6808418fa04e51297f260aaffd00dce1c911831d GIT binary patch literal 2912 zcmZ9OXH-*58-;_?q&G>BCMZY`0)n7)MKrWfRZ0i~(pyj@AH9UmrASdiQBaD2hA5yQ z(wh)Ep@X3}>0QhvitBzj>&%%yXV1KApY`r}^dP6n#Q^{S_0i-5T=(1u6ORWKfDPd3 zWFz6?=1m4*0_2@K`r>HJ{9XX*dY5TxRhYO;VVF_jMy4wf8ct42Y-w!9EL!zyhAbFn z*taknOJHnPOduS54U0e=j7=>r7Y9>i6c;{MU!Ebbdq4lEGO~7me34M{rQhbJl@U5k zgb9z1G@YL5=A=4Qu~;YKxyhISX9BdC$x_LhlQ>U@lSMy$U@megLy$rennC^HmP>(G zYT4d^Po5$#hTqvf8w|3$5@U0jHzN$0oGiN$XEz4B#_Wo6Eg5NRy5uq?9e93}p((eO^-kC$V`~%@tU>-T;ODCY1V7hE6PZ?k2cG3d6nhD>R??^oSl`C3^UY!nhMN>Jx!oV zaD%i7>-0hOz&K4YO`|gX&dy$Fo>3OL8^>iyNsy$ZWPqJCB_*Z#(Nq_r#Hf1A(9zNH z>B&-?ezSC(WTFC`EOJtLHvCVKG)Mo?4URzAApX>Op7M8r$>hJ+^rr{9i6&f);~Ldk z5p{uI0UzEn3xhl@L(iXA)XPs(V;-t)ym^0^|Vb=JarW zpoFrCMz+MTg}!?^5`)sF)Q00Uf^}93zRFN&_)?2X&Dck7z7&!b;+F|IOBMERyo9(T z7Y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{R)Io(eQW$e-s3!{dkgCiCZr0bR z8=Q7ySYH6Inv-;)jIm@pR-AX5_?6mZN+Lriw$36|PS?b~#;m-y&bKlo#XSbUM(sMG zT^U-o#xT}Ewadi&?SW5_?izN`?{c)|mo;Q2l&P#Nu58GGx=X;*@HWsKLVgi>|bE;a8Yt50Od zs(h6sk>cb9!KpqS{Krn(|LpwROXg!w)0;;jiEys4wP!al?@#k_H`qnZJ;Tr-FPq|A z(tdX9&n}ya^dY;SQN3xw^1&tAhk}ei&+alUsPfa@_I85W_TOICMg z*O@#3d#3wLIN-!vTSQ|L`kHaHXKhVCUYs*jyJJ(5WppOVxJ4r3p|){;ZM5#o2HXAu za?_-{&g`Bd?PKOcH;P(c>=UOjTSe29glPR)SS?DkN;dr}=LXWHI_Z()EPTNaVo&Kl z^Yg%gI+lStE&OT}8u7`}cpYy)0J3dVuOGC8nS#yCv8i#l(XW<;-voa^9Qw^Iny19y zM2ka8UCLc&Z!EzHZ5%@qHSmrPjFL|2{oH&wx@%IyFD?vlq-&$M6vK;yL~-E{B!`C! zoB43}@w*}uT7yAU3&>K9tc?y#p&7wR1e;Ic;G#^cGT*c$d%=BM!5$(W?Ul4U(X#Ws z{5rwOa-;JM$eGx88j<;??wx3HXLSTNZq6Y{_@4~FkTPrKP#?k)7HS_BvE0Z!0ICET zsGvW0DN6*N!G9SK?#pE38(2^;OWmv7id;?=NE)2En^|CmcK<=AhYC6%os-tD&h_g&XJmx*E9Hn90&@&Usb`^A z-5M%2%q^*WlU;wP?Np(OKa@uRx1T-69rCR@s%Mo~4?=cI9B>jENmNK8M5^EY_v;<- zs~L|G@^29drAVwq;--@#-XqyDSp6*`p$!RKNDxDF;-vZ`(SM-xw~iDbq-Y?;1j7kk t^3hHwK7h6#PC;-5t!=!&z_%BoKCg1=7 literal 0 HcmV?d00001 diff --git a/tests/catalog/fixtures/bbr.npz b/tests/catalog/fixtures/bbr.npz new file mode 100644 index 0000000000000000000000000000000000000000..82a62ea3c8d82b7d2f554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git a/tests/catalog/fixtures/trmm_pr.npz b/tests/catalog/fixtures/trmm_pr.npz new file mode 100644 index 0000000000000000000000000000000000000000..2469b00ab777f2895fcf0cc6393bba68d2bb6c2b GIT binary patch literal 15349 zcmZ8oWmua_x5c$B?i7lZQYcbf1I3D4u_D1~ad)RU1&S6g#ogWArML$O?hqgZ0=ez? zopbL!=Y5{Z{76=2XXj1!nl*c=DxjjhK|(^p`aS57KE6e#NBnhRA`v6G*qF21Id~!? z;Ug8H{C>sn>*&7|Ql?sKWREJo=*k_*j6wgam%l#sSx^a^rxR-t^3?SIj1T{MOLE^k z8Yt*MQ2O)hM{^vd@W_!yp57`sq|?eu$=KB3-pZOI>4w*cr!3^`?;l!bQm> z=f0v+N#`R#0V6{61OengH$r-g#EnFRgdRXGzEexswQ4!0fs`$#kvAdtd{V@1eATnq z8TZVR!2kFT=U`Yksw#n>>x%kJqh)Z`bUW=PXgoKwX6R^5iET?Y!Fx2!C$uReK_S{} z(-73{o0`x1bWKUDthoCl`Q`VW+{_RHS%joddldCe8QHhk(}B!KB-MZ92=(bT#{bWe znX%{JIokd!H=qBS(~rpxsqlw~R0mYcv*JHy=;ztx|F9#nGApUb{gIUn{Gguroh%!e z7>^V0pfJXwJg270G4Y=5y=J5O)YPn6k>(FH2MR7uPIAuQwNtT^?M!h zrHHPuZ8|W|E#KM7^#d_BLB7)4mvmoVwUJwLkC4kKQ+?F{iwM0iWGR#)mN#Km6T(W8 zKWxpqKDE5}17!mc$D?)zlaR9dQ`buG@`u4&mPh37*Jgqd+^Iy>JU$T-43=9W3+sK+ z+^Mafza|SB|Y`U7-Yyq!@6=PUh_${UKp!J>E#GTB^ZH{|c zaVETD#OBT&&w9x@B$G)*zUA6^yBazhBjtvC*M7Y3=~eO2IIeL>?AF3*mYvC7`R@EI zBZTN7QF{>`m2NK4bUx=O*PJl|jt=Hx!Y3PshLFhu1x(C|d;e*gX+R zN?C51{FR3Y8)GWC?NBIA2#kYkoy4GoWRh*80cUj`TZkS2X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BWNnUqy6p=fAw6=kyBQnx32 zfyQspEn?*}N|Zkm;ID4Ju>plH_hv1zo{U@w_zI4j1NswE-Pm4->eK`A#H@M3>n)ZR zexlFDxRB=Mwft@l`O($rN?rPT1&?z7`B^I3M)~&@ zk|3Km(nRetk+GS0*5=eMbT5i#g*nz0-*vn?CYw|Iv5`-5^3r!aHF(?PC`2cl+o~{9utup02_| zC*Cx$UTXdRn}!cRt9syJV-HgW?`+I0DTgCg_al5sQX2bhn@0QH3|<=82PyTtZh(#m zxqr(ql^D^~=Y(_SGd@TczW4E*HiueS?+bjz1wp{Qk+|2$oMn~H^)DM3dRzz;O%f{% z;Q1IMmY+BCl4#Xj6C2oVsCtc{HAGOT>f?4v!{L6ywQONDRe{ij)e7vGNazC|#m~#) z_fGRVAo0mhX!d*&HE>>S`~cmfcV9m_fw{Ad8%$AJ!j zdtUo_-j)PWD&i23b?g@SBOZUJgfq%{SQ{U6kp7qeX?CLrHR3nlLPmLm^iN;tALHjA z6Da0?Db;@-1O7t^{&I=_8}!F0`Ns+Q#})Zc5aVyyU$)7AgZ_9I|2Px>xD;{zvC_bA z(Em9Z|Bd_8q4THx=1(gQ?muwkWJv$NU+3SzKWf4siJ j@2LNoCN`emY5Lz%tg3+ipF)iF+u%F=dm&PxKN0>9mkLjc literal 0 HcmV?d00001 diff --git a/tests/catalog/fixtures/virs.npz b/tests/catalog/fixtures/virs.npz new file mode 100644 index 0000000000000000000000000000000000000000..2960d73094d0d12de227192fc1a44e9a59966dc1 GIT binary patch literal 15305 zcmZ8obyyqQx5c5jLvd?yFD@w*DMee{-HN*t3I$5h;x5HooZ=GP-CJCP2ZxYAUip_Z`DBGn;&QP=-9@l)&_8LW5o zgP1GPcRXCd-t57ZVMybzz!PcLL1vn))2WE!aBb~m##-0bA5D$Y5Z;s8O*3PJr>aE( ztg2d7&j6r|5hZnkFy%!zLlQs|L?S^#521OvTTk4zVmqdZlqaoOG@(R0Dd|1F;#cm0 z1FKYgzQmsn%w0Z-nW;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O>WS2l3k@h>XIG z^iQwnA2a74V<+Z+snvgeL;gbz{&If)8}!Hg_{ZJ&$LaV_5X*1aUslL}gZ}st|F{kR zI1jP^G1I_r(Eqs;|Bd_8dh@5R=1-3e&OdM@6iENS5$E5)KVS5JKGVB?7p}kha{dDk zLB8hrU*P}$zW?_h{9&bk_~sw(iT{t8-T8js=07;$G2`gc literal 0 HcmV?d00001 diff --git a/tests/catalog/test_entries.py b/tests/catalog/test_entries.py index 7fe36c8..4cc1be0 100644 --- a/tests/catalog/test_entries.py +++ b/tests/catalog/test_entries.py @@ -117,13 +117,15 @@ def test_list_filters(self): """ self.assertEqual( [e.id for e in list_entries(instrument_class="conical")], - ["amsr2", "gmi", "smap_radiometer", "ssmis"], + ["amsr2", "gmi", "smap_radiometer", "ssmis", "tmi"], ) self.assertEqual( [e.id for e in list_entries(instrument_class="geostationary")], ["abi", "ahi"], ) - self.assertEqual([e.id for e in list_entries("conical", "validated")], ["gmi"]) + self.assertEqual( + [e.id for e in list_entries("conical", "validated")], ["gmi", "tmi"] + ) self.assertEqual( [e.id for e in list_entries("conical", "partial")], ["amsr2", "smap_radiometer", "ssmis"], @@ -137,8 +139,11 @@ def test_list_filters(self): "amsr2", "amsua", "atlas", + "atlid", "avhrr", + "bbr", "ceres", + "cpr", "cris", "csar", "ecostress", @@ -152,6 +157,7 @@ def test_list_filters(self): "omps_nm", "smap_radiometer", "ssmis", + "trmm_pr", ], ) with self.assertRaises(ValueError): @@ -1008,6 +1014,96 @@ def test_emit_entry_partial_on_shifted_swath(self): ) self.assertEqual(swath.record.holdout_gap_days, 35) + def test_virs_entry_validated(self): + """ + Test that the TRMM VIRS entry passes with its fitted values on data held out 39 + days from the fit. + """ + validation = get_entry("virs").validation + self.assertEqual(validation.tier, Tier.VALIDATED) + for key in ("swath", "pixels"): + configuration = validation.configurations[key] + self.assertEqual(configuration.tier, Tier.VALIDATED, key) + self.assertEqual(configuration.record.holdout_gap_days, 39, key) + + def test_tmi_entry_validated(self): + """ + Test that the TRMM TMI entry passes with its fitted feeds on data held out 39 + days from the fit, as alternatives scored one at a time. + """ + entry = get_entry("tmi") + self.assertEqual(entry.instrument_class, InstrumentClass.CONICAL) + self.assertEqual(entry.validation.tier, Tier.VALIDATED) + self.assertEqual(entry.configurations["feeds"].grouping, "alternatives") + for key in ("feeds", "sample_size"): + configuration = entry.validation.configurations[key] + self.assertEqual(configuration.tier, Tier.VALIDATED, key) + self.assertEqual(configuration.record.holdout_gap_days, 39, key) + + def test_trmm_pr_entry_partial_on_published_footprint(self): + """ + Test that the TRMM PR entry is partial because its published footprint at the + scan's edge does not meet the sample size gate, with its swath validated on data + held out 39 days from the fit. + """ + validation = get_entry("trmm_pr").validation + self.assertEqual(validation.tier, Tier.PARTIAL) + self.assertEqual(validation.configurations["swath"].tier, Tier.VALIDATED) + beams = validation.configurations["beams"] + self.assertEqual( + [r.gate.metric for r in beams.gates if not r.passed], + ["sample_size_within_3pct"], + ) + self.assertEqual(beams.record.holdout_gap_days, 39) + + def test_earthcare_msi_entry_validated(self): + """ + Test that the EarthCARE MSI entry passes with its fitted view on data held out + 41 days from the fit. + """ + validation = get_entry("earthcare_msi").validation + self.assertEqual(validation.tier, Tier.VALIDATED) + swath = validation.configurations["swath"] + self.assertEqual(swath.record.holdout_gap_days, 41) + + def test_earthcare_profilers_partial_on_track_offset(self): + """ + Test that the ATLID and CPR entries, of the profiler class added in version 6 + of the standard, are partial because of their track offset alone on data held + out 41 days from the fit. + """ + for entry_id, key in (("atlid", "profile"), ("cpr", "nadir")): + entry = get_entry(entry_id) + self.assertEqual(entry.instrument_class, InstrumentClass.PROFILER) + self.assertEqual(entry.validation.tier, Tier.PARTIAL, entry_id) + self.assertGreaterEqual(entry.record.standard_version, 6) + configuration = entry.validation.configurations[key] + self.assertEqual( + [r.gate.metric for r in configuration.gates if not r.passed], + ["track_offset_median"], + entry_id, + ) + self.assertEqual(configuration.record.holdout_gap_days, 41, entry_id) + + def test_bbr_entry_partial_on_held_out_day(self): + """ + Test that the BBR entry, whose three views are alternatives scored on data + held out 41 days from the fit, is partial on pass recall and footprint IoU + (the gates take the worst view) and passes its width and epoch gates. + """ + entry = get_entry("bbr") + self.assertEqual(entry.instrument_class, InstrumentClass.PUSHBROOM) + self.assertEqual(entry.validation.tier, Tier.PARTIAL) + views = entry.validation.configurations["views"] + self.assertEqual( + sorted(r.gate.metric for r in views.gates if not r.passed), + ["footprint_iou_median", "pass_recall"], + ) + self.assertEqual(views.record.holdout_gap_days, 41) + self.assertEqual( + {m.scope for m in views.record.metrics}, {"AFT", "NADIR", "FORE"} + ) + def test_oco2_glint_builds_glint_attitude(self): """ Test that OCO-2's glint configuration builds the glint attitude it declares, diff --git a/tests/catalog/test_scanner_fixtures.py b/tests/catalog/test_scanner_fixtures.py index 1301eee..cff5ccd 100644 --- a/tests/catalog/test_scanner_fixtures.py +++ b/tests/catalog/test_scanner_fixtures.py @@ -8,8 +8,11 @@ `docs/validation/validate_catalog_dpr.py`, `docs/validation/validate_catalog_mhs.py`, `docs/validation/validate_catalog_airs.py`, -`docs/validation/validate_catalog_amsua.py`, and -`docs/validation/validate_catalog_avhrr.py`. +`docs/validation/validate_catalog_amsua.py`, +`docs/validation/validate_catalog_avhrr.py`, +`docs/validation/validate_catalog_trmm_pr.py`, and +`docs/validation/validate_catalog_virs.py`, and of other swaths and narrow views +written by their validation scripts. These detect changes in TAT-C's results without network access. They do not themselves establish agreement with the reference data, which the scripts do. @@ -66,6 +69,7 @@ class _SwathFixture: fixture_name: str | None = None swath_key = "swath" platform = "noaa-20" + instrument_index = 0 @classmethod def setUpClass(cls): @@ -109,6 +113,7 @@ def test_passes(self): satellite, time - timedelta(minutes=10), time + timedelta(minutes=10), + self.instrument_index, ) differences.append( min( @@ -535,6 +540,41 @@ def time_step(self) -> float: return 10 +class TestTrmmPrFixture(_BeamScannerFixture, unittest.TestCase): + """ + Regression tests of the TRMM PR entry, whose published footprint at the scan's edge + does not meet the gate. + """ + + entry_id = "trmm_pr" + sizes_key = "beams" + size_instrument = "PR" + platform = "trmm" + meets_published_gate = False + footprints = ( + ("PR", 403, 35, 0, 5.0, 5.0), + ("PR", 403, 35, 17.0, 5.0, 5.0), + ) + + def time_step(self) -> float: + return 10 + + +class TestVirsFixture(_BeamScannerFixture, unittest.TestCase): + """ + Regression tests of the TRMM VIRS entry. + """ + + entry_id = "virs" + sizes_key = "pixels" + size_instrument = "VIRS" + platform = "trmm" + footprints = (("VIRS", 403, 35, 0, 2.4, 2.4),) + + def time_step(self) -> float: + return 10 + + class TestCrisFixture(_ScannerFixture, unittest.TestCase): """ Regression tests of the CrIS entry, whose pixels do not meet the gates, so that @@ -686,5 +726,45 @@ class TestPoseidon4Fixture(_StepSwathFixture, unittest.TestCase): platform = "sentinel-6a" +class TestEarthcareMsiFixture(_StepSwathFixture, unittest.TestCase): + """ + Regression tests of the EarthCARE MSI entry's swath, rolled away from the sun. + """ + + entry_id = "earthcare_msi" + platform = "earthcare" + + +class TestAtlidFixture(_StepSwathFixture, unittest.TestCase): + """ + Regression tests of the ATLID entry's view, pointed behind nadir. + """ + + entry_id = "atlid" + swath_key = "profile" + platform = "earthcare" + + +class TestCprFixture(_StepSwathFixture, unittest.TestCase): + """ + Regression tests of the CPR entry's nadir view. + """ + + entry_id = "cpr" + swath_key = "nadir" + platform = "earthcare" + + +class TestBbrFixture(_StepSwathFixture, unittest.TestCase): + """ + Regression tests of the BBR entry's nadir view (instrument index 1). + """ + + entry_id = "bbr" + swath_key = "views" + platform = "earthcare" + instrument_index = 1 + + if __name__ == "__main__": unittest.main() diff --git a/tests/catalog/test_standard.py b/tests/catalog/test_standard.py index ada5ba9..2592898 100644 --- a/tests/catalog/test_standard.py +++ b/tests/catalog/test_standard.py @@ -20,8 +20,20 @@ # (metric, limit, at most) by class and grade. These thresholds are frozen: they # must test new instruments rather than follow their results. A change needs a # new STANDARD_VERSION, with its reason, in docs/validation/standard.rst. -FROZEN_VERSION = 5 +FROZEN_VERSION = 6 FROZEN_GATES = { + # version 6 added the profiler class, with the gates of the altimeter class, + # and changed no other gate + ("profiler", "coverage"): [ + ("segment_recall", 99, False), + ("track_offset_median", 0.5, True), + ("epoch_p95", 3, True), + ], + ("profiler", "timing"): [ + ("segment_recall", 99, False), + ("track_offset_median", 0.5, True), + ("epoch_p95", 1, True), + ], # version 5 added the regional geostationary class, and changed no other gate ("geostationary_regional", "coverage"): [("field_of_regard_iou", 0.95, False)], # version 4 added the scatterometer class, with the gates of the sar class, and diff --git a/tests/catalog/test_tmi_fixture.py b/tests/catalog/test_tmi_fixture.py new file mode 100644 index 0000000..8d213ce --- /dev/null +++ b/tests/catalog/test_tmi_fixture.py @@ -0,0 +1,213 @@ +""" +Regression tests that recompute the TRMM TMI entry's results from a reduced fixture, +written by `docs/validation/validate_catalog_tmi.py`. + +These detect changes in TAT-C's results without network access. They do not +themselves establish agreement with the reference data, which the script does. + +@author: Paul T. Grogan +""" + +import pathlib +import unittest +from datetime import datetime, timedelta, timezone + +import geopandas as gpd +import numpy as np +import pandas as pd + +from tatc.analysis import collect_observations, compute_sample_sizes +from tatc.catalog import get_entry, get_gates +from tatc.catalog.metrics import summarize +from tatc.schemas import CircularOrbit, GeneralPerturbationsOrbit, Point + +from .common import use_fixture_earth_orientation + +FIXTURE = pathlib.Path(__file__).parent / "fixtures" / "tmi.npz" +MAX_FIXTURE_BYTES = 200e3 +SCAN_PERIOD = 1.899 +PLATFORM = "trmm" +# published footprints at the center of the scan: instrument, altitude (km), and +# sizes along and across track (km) +FOOTPRINTS = ( + ("TMI 10.65 GHz", 403, 68.1, 41.3), + ("TMI 19.35 GHz", 403, 34.6, 20.9), + ("TMI 21.3 GHz", 403, 31.1, 18.9), + ("TMI 37.0 GHz", 403, 18.3, 11.1), + ("TMI 85.5 GHz", 403, 7.8, 4.8), +) +SPACING_INSTRUMENTS = { + "S1": "TMI 10.65 GHz", + "S2": "TMI 19.35 GHz", + "S3": "TMI 85.5 GHz", +} + + +def _observe(satellite, names, times, longitude, latitude): + return gpd.GeoDataFrame( + { + "satellite": satellite.name, + "instrument": names, + "epoch": pd.DatetimeIndex(times), + }, + geometry=gpd.points_from_xy(longitude, latitude), + crs="EPSG:4326", + ) + + +class _TmiFixture: + """ + Loads the fixture and the entry. + """ + + key: str + + @classmethod + def setUpClass(cls): + with np.load(FIXTURE, allow_pickle=False) as data: + use_fixture_earth_orientation(cls, data) + cls.data = {key: data[key] for key in data.files} + cls.entry = get_entry("tmi") + cls.day = datetime.fromisoformat(str(cls.data["day"])) + cls.recorded = cls.entry.record.configurations[cls.key].fixture_metrics + + def build(self, orbit): + """ + Gets the configuration's satellite on an orbit. + """ + return self.entry.to_satellite( + orbit, self.key, time_step=SCAN_PERIOD, platform=PLATFORM + ) + + +class TestTmiFixture(_TmiFixture, unittest.TestCase): + """ + Regression tests of the TMI entry's feeds, from passes of the first feed (S1). + """ + + key = "feeds" + + def test_fixture_size(self): + """ + Test that the fixture stays small, as it is part of the repository. + """ + self.assertLess(FIXTURE.stat().st_size, MAX_FIXTURE_BYTES) + + def test_passes(self): + """ + Test that the recorded passes are predicted with epochs that meet the gate of + the configuration, and that this does not move. + """ + satellite = self.build( + GeneralPerturbationsOrbit.from_tle(self.data["tle"].tolist()) + ) + differences = [] + for latitude, longitude, seconds in self.data["passes"]: + time = self.day + timedelta(seconds=float(seconds)) + found = collect_observations( + Point(latitude=float(latitude), longitude=float(longitude)), + satellite, + time - timedelta(minutes=10), + time + timedelta(minutes=10), + 0, + ) + differences.append( + min( + ((e - pd.Timestamp(time)).total_seconds() for e in found.epoch), + key=abs, + ) + if not found.empty + else np.nan + ) + differences = np.array(differences, dtype=float) + p95 = float(summarize(differences)["p95"]) + self.assertEqual( + 100 * float(np.isfinite(differences).mean()), self.recorded["passes_found"] + ) + gates = get_gates( + self.entry.instrument_class, self.entry.configurations[self.key].grade + ) + self.assertLessEqual( + p95, next(g.limit for g in gates if g.metric == "epoch_p95") + ) + self.assertAlmostEqual(p95, self.recorded["epoch_p95"], places=4) + + +class TestTmiSampleSizeFixture(_TmiFixture, unittest.TestCase): + """ + Regression tests of the TMI entry's sample size configuration. + """ + + key = "sample_size" + + def test_published_dimensions(self): + """ + Test that the share of published footprint dimensions within 3% does not move, + and that it meets the gate, as the record states. + """ + epoch = datetime(2026, 10, 1, tzinfo=timezone.utc) + time = epoch + timedelta(minutes=10) + errors = [] + for name, altitude, along, cross in FOOTPRINTS: + orbit = CircularOrbit(altitude=altitude * 1e3, inclination=35, epoch=epoch) + satellite = self.build(orbit) + names = [instrument.name for instrument in satellite.instruments] + target = satellite.get_instrument( + names.index(name) + ).compute_footprint_center(orbit.to_gp_orbit().get_orbit_track(time)) + sizes = compute_sample_sizes( + _observe( + satellite, + [name], + [time], + [target.longitude.degrees], + [target.latitude.degrees], + ), + satellite, + ) + errors += [ + abs(sizes.sample_along.iloc[0] / 1e3 / along - 1), + abs(sizes.sample_cross.iloc[0] / 1e3 / cross - 1), + ] + within = 100 * float(np.mean(np.array(errors) <= 0.03)) + self.assertEqual(within, self.recorded["sample_size_within_3pct"]) + gates = get_gates( + self.entry.instrument_class, self.entry.configurations[self.key].grade + ) + self.assertGreaterEqual(within, gates[0].limit) + + def test_spacing(self): + """ + Test that the reported spacing of the samples of each group, between scans and + along the scan's arc, does not move. + """ + satellite = self.build( + GeneralPerturbationsOrbit.from_tle(self.data["tle"].tolist()) + ) + for group, name in SPACING_INSTRUMENTS.items(): + rows = self.data[f"spacing_{group}"] + seconds = self.data[f"spacing_seconds_{group}"] + sizes = compute_sample_sizes( + _observe( + satellite, + [name] * len(rows), + [self.day + timedelta(seconds=float(s)) for s in seconds], + rows[:, 1], + rows[:, 0], + ), + satellite, + ) + self.assertAlmostEqual( + float(np.nanmedian(sizes.spacing_along.to_numpy() / 1e3 / rows[:, 2])), + self.recorded[f"spacing_scan_ratio_median_{group}"], + places=4, + ) + self.assertAlmostEqual( + float(np.nanmedian(sizes.spacing_cross.to_numpy() / 1e3 / rows[:, 3])), + self.recorded[f"spacing_arc_ratio_median_{group}"], + places=4, + ) + + +if __name__ == "__main__": + unittest.main()