diff --git a/CHANGELOG.md b/CHANGELOG.md index bee821b6..1637da38 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,17 @@ Added: - Optional fields `performance` (`schemas.InstrumentPerformance`: a ground sample distance and signal-to-noise ratio at a reference altitude, scaled to other altitudes by declared power laws, with `get_noise_scale` for observation errors) and `resources` (`schemas.InstrumentResources`: mass, power, and data rate, with `get_data_volume` and `total`) of instruments, which do not affect observations. - Optional field `resources` of space systems (`schemas.SpacecraftResources`: launch and dry mass, power, design life, storage, and downlink rate), which constellations give their members, and `SpaceSystem.get_payload_resources`, the totals of its instruments. - Catalog instruments and spacecraft give nominal performance and resources with the source of each value (`InstrumentEntry.performance` and `resources`, which a configuration may replace, `get_performance`, `get_resources`, and `Spacecraft.resources`), listed on the catalog's pages; they are not part of the digests of configurations. `InstrumentEntry.build` gives every instrument the performance and the instrument analyzed by default the resources, so that a satellite's totals count each instrument once, and `SatelliteSystem.build` gives satellites their spacecraft's resources. + - Catalog sample size configurations of MWS (`beams`, one instrument for each group of channels) and TROPICS (`beams_tropics_0n`, each satellite's 118 GHz band), whose published footprints at nadir and the scan's edge are gated, and of CERES (`beams_noaa_20`, `beams_suomi_npp`), ECOSTRESS and OCI (`beams`, OCI's with the tilt schedule of its swath), and IASI-NG (`fields_of_regard`), whose only published footprints are at nadir, so that they are compared without the gate and the configurations stay partial. Validation scripts can compare published footprints without recording the gate's metric (`scanner.Setup.gate_published`) and project the pixels of a line within a scan of several lines (`scanner.Reference.line`). + - Version 8 of the validation standard adds the sample size grade to the pushbroom class, with the gates of cross-track scanners. The grade is optional: pushbroom entries do not need it to be validated, and their sample size configurations have their own tiers, which do not set the entry's (`standard.get_required_grades`; `standard.is_compatible` takes a grade, as results of a grade added to a class apply from the version that added it). + - Catalog sample size configurations (`pixels`) of the pushbroom imagers BBR (gated by the published footprints of its nadir and slanted views), EMIT and TROPOMI (whose only published pixels are at nadir), and OLI and MSI (nominal, from published values, as no reference data locate their detectors). Published footprints of the validation scripts can give the angle along track of a view pointed fore or aft. + - Version 9 of the validation standard adds an optional sample size grade to the lidar, profiler, and altimeter classes, gated by published footprints and by the spacing of samples along track against that measured (`spacing_along_error`, the error of the median ratio, at most 3%). + - Catalog sample size configurations (`footprints`) of GEDI, ATLID, and CPR, from their published divergences and beam widths, whose spacing along track is gated and published footprints compared without the gate, and of ATLAS (nominal, as its reference data hold segments rather than shots). Validation scripts of beam instruments score them with `validation_io.validate_footprints`. + - `ViewGeometry.SCAN_ALONG_FIRST`: a `PointedInstrument` view in angles with the along-track angle first (its cross-track angular extent constant along track), as the fixed grid of a geostationary imager that sweeps about the y axis (CGMS's convention, as AHI's and FCI's); `ViewGeometry.SCAN` in the inertial frame is that of a grid that sweeps about the x axis (as ABI's). `ViewGeometry.is_scan` tells either from `FRAME`, and `compute_view_angles` takes `along_first`. `compute_sample_sizes` gives the sizes of a geostationary platform's pixels east-west (along track) and north-south (across track) in the inertial frame. + - Version 10 of the validation standard adds an optional sample size grade to the geostationary class, with the gates of cross-track scanners. Catalog sample size configurations (`pixels`) of ABI, AHI, and FCI: the fixed grids of their infrared bands, whose published sizes at the sub-satellite point are compared without the gate, as the grids' angles define them, with pixels and spacing compared with the products' grids (`validation_io.validate_fixed_grid`). Every configuration of ABI, AHI, and FCI uses the inertial frame, in which a geostationary satellite's along-track direction is east (the coverage configurations, cones about nadir, are unchanged by it), as the configurations of an entry on a platform share its velocity frame. + - `PointedInstrument` fields `range_resolution` (meters, in slant range, divided by the sine of the incidence angle at a target, or on the ground, `range_resolution_frame`) and `azimuth_resolution` (meters), which replace the sizes of a pixel's angles in `compute_sample_size` (and `compute_sample_sizes`), as for the resolution cells of a radar; their spacing is not modeled (`NaN`). Function `utils.compute_incidence_angle`: the incidence angle at a target on the ellipsoid. + - Version 11 of the validation standard adds an optional sample size grade to the SAR and scatterometer classes, gated by published resolutions. Catalog sample size configurations of Sentinel-1's IW mode (`resolution_iw`, its three sub-swaths' resolutions derived from the look bandwidths and windows of its ground range detected product, compared with the Product Definition's), and nominal ones of NISAR's single-look complex products of each bandwidth, and of the 2 km product of KaRIn and the 25 km product of ASCAT (`resolution`). + - `catalog.list_entries` takes a `grade`: the entries with a configuration for that use, whose `tier` is then the entry's for the grade (`InstrumentEntry.get_tier`, the lowest tier of its configurations that serve the grade), so that entries partial only at another grade, such as the sample size grade, can be listed as validated for coverage (`list_entries(tier="validated", grade="coverage")`). + - `catalog.list_systems` takes a `grade` as well: the systems with a configuration for that use, whose `tier` is then the system's for the grade (`SystemEntry.get_tier`), so that, for example, systems partial for the planes of their orbits can be listed as validated for their ground tracks (`list_systems(tier="validated", grade="ground_track")`). - `tradespace.Criteria` take statistics themselves as objectives, tolerances, and rules of `Across`, and `Requirement` a statistic in place of its name (such as `Requirement(Quantile("cost", 0.7), "<=", 150)`), each named by its conventional name (`cost p70`), so that criteria need not repeat the names of statistics given in `statistics`. Type aliases `criteria.Objectives` (the objectives that functions judging designs take in place of criteria), `criteria.Direction`, `criteria.Rule`, `statistics.Operator`, `simulation.Sampling`, `attribution.Share`, and `utility.Form`, and `Literal` types of the other arguments that take one of a few strings (such as `errors` of `Study` and `method` of `DesignSpace.sample`), by which editors check and complete them. Changed: @@ -28,6 +39,7 @@ Changed: - A function of a study's results (such as the `evaluate` of a `tradespace.Study`, or the metrics of an `ObservationStudy`) whose first parameter is named `design` is given what it is of (such as what a design builds) in it, rather than raising a `TypeError`; a later parameter named `design` is given the realized design, as before. Fixed: + - Sample sizes of `PointedInstrument` views in scan angles away from their scan line: a step of the cross-track angle moves the line of sight by the cosine of the target's along-track angle, along the axes of the view rotated to the target. Pixels off the scan line, such as those of a geostationary imager's fixed grid, were up to about 0.4% too wide across track within 5 deg of it (unchanged on the scan line). - `GeosynchronousOrbit` placed its satellite off its `longitude` by up to about 0.04 deg, by the date: its node used the apparent rather than the mean sidereal time of SGP4's TEME frame, and SGP4's deep-space (lunar and solar) terms displace the satellite at its epoch from its mean elements. The node is now solved so that the sub-satellite point at epoch is at the longitude (rotated by the argument of latitude), within 1e-6 deg; within each day of the repeat cycle, the longitude still drifts by up to about 0.006 deg. GOES's slot record is updated (its longitude error had been 0.037 deg). - Catalog values of sourced models (such as a spacecraft's resources) set to `None`, as a model dumped with its defaults gives them, needed a provenance, so a system's record could not be written. - `analysis.collect_footprint_observations` failed for the footprints of radar stations with pandas 3. diff --git a/docs/validation/catalog_page.py b/docs/validation/catalog_page.py index 8341b508..a9d8e320 100644 --- a/docs/validation/catalog_page.py +++ b/docs/validation/catalog_page.py @@ -10,11 +10,30 @@ import re from tatc.catalog import STANDARD_VERSION, get_entry, get_entry_ids -from tatc.catalog.standard import MIN_HOLDOUT_GAP_DAYS +from tatc.catalog.standard import MIN_HOLDOUT_GAP_DAYS, get_required_grades, serves REPOSITORY = "https://github.com/code-lab-org/tatc/blob/main/" +def is_optional(entry, grade) -> bool: + """ + Checks whether a configuration's grade is optional for its entry's class: it + serves none of the grades the class requires, so its tier does not set the + entry's. + + Args: + entry (InstrumentEntry): The entry. + grade (Grade): The configuration's grade. + + Returns: + bool: `True`, if the grade is optional. + """ + return not any( + serves(grade, required) + for required in get_required_grades(entry.instrument_class) + ) + + def escape(text: str) -> str: """ Escapes reStructuredText markup in plain text. @@ -131,7 +150,9 @@ def render_configuration(entry, key: str) -> str: parts = [ heading(f"``{key}``{default}", "-"), f"**Tier:** `{validation.tier.value}`. **Grade:** " - f"`{configuration.grade.value}`. **Tested on:** " + f"`{configuration.grade.value}`" + + (" (optional)" if is_optional(entry, configuration.grade) else "") + + ". **Tested on:** " + ", ".join(names[p] for p in configuration.platforms) + ".\n", escape(configuration.description) + "\n", @@ -332,8 +353,9 @@ def render() -> str: f"``{e.instrument_class.value}``", f"`{e.validation.tier.value}`", ", ".join( - f"``{key}`` ({c.grade.value}, " - f"{e.validation.configurations[key].tier.value})" + f"``{key}`` ({c.grade.value}" + + (", optional" if is_optional(e, c.grade) else "") + + f", {e.validation.configurations[key].tier.value})" for key, c in e.configurations.items() ), ", ".join(p.name for p in e.get_spacecraft()), @@ -358,7 +380,11 @@ def render() -> str: An entry's tier is computed from its results and the thresholds of :doc:`standard` (version {STANDARD_VERSION}), and cannot be declared. Values fitted to reference data are tested on data at least {MIN_HOLDOUT_GAP_DAYS} days from -their fitting data. A `partial` entry can still be useful within its +their fitting data. An entry's tier is set by its configurations at the +grades its class requires; configurations at an optional grade (the sample size +grade of the pushbroom, lidar, profiler, altimeter, geostationary, SAR, and +scatterometer classes) have their own tiers, which do not set the entry's. An entry's tier for a use is that of its weakest +configuration at the use's grade (`get_tier`), by which entries can be listed. A `partial` entry can still be useful within its limitations, which each configuration lists below; a `validated` entry also has limitations. @@ -367,6 +393,7 @@ def render() -> str: from tatc.catalog import get_entry, list_entries list_entries(tier="validated") + list_entries(tier="validated", grade="coverage") # validated for coverage entry = get_entry("atms") entry.validation # tier, gate results, and gaps of each configuration satellite = entry.to_satellite(orbit, time_step=10, platform="noaa-21") diff --git a/docs/validation/standard.rst b/docs/validation/standard.rst index 43e1f6a7..9c70049c 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 7 of the standard. The thresholds of version 1 were drafted from +This is version 11 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. @@ -72,6 +72,52 @@ Versions geolocation; :doc:`limb_and_space/ValidateROCOSMIC2`: every recorded occultation predicted, with tangent points within about 0.4 km), and frozen before any data were analyzed for the catalog. + * - 8 + - Adds the sample size grade to the pushbroom class, with the gates of + cross-track scanners: at least 90% of published footprint dimensions within + 3%, and pixels projected within 6 km of the product's (median). The grade is + optional: a pushbroom entry does not need it to be validated, and its sample + size configurations have their own tiers, which do not set the entry's, as + the pixel sizes of pushbroom imagers are rarely published away from nadir + (of the eleven entries of the class, only BBR's footprints are published at + more than one viewing angle). No threshold of earlier versions changed, so + their results still apply; results of the pushbroom sample size grade apply + from version 8. The gates were adopted before any pushbroom sample sizes + were analyzed. The pixel position gate is loose for imagers of tens of + meters, and is kept the same as that of scanners so that one threshold + serves both. + * - 9 + - Adds the sample size grade to the lidar, profiler, and altimeter classes, + whose beams point near nadir: at least 90% of published footprint + dimensions within 3%, and the median ratio of predicted to measured spacing + of samples along track within 3% of one. Their positions are tested at the + coverage grade (beam spacing and track offset), so the grade tests + spacing rather than pixel positions, which would test footprints of 10 m + to a few kilometers against 6 km. As for the pushbroom class, the grade is + optional, and its configurations have their own tiers. No threshold of + earlier versions changed, so their results still apply; results of these + grades apply from version 9. The gates were adopted before any of their + sample sizes were analyzed. + * - 10 + - Adds the sample size grade to the geostationary class, whose imagers sample + fixed grids of scan angles, with the gates of cross-track scanners: at + least 90% of published pixel dimensions within 3%, and pixels projected + within 6 km of the product's (median). As for the other classes added + since version 8, the grade is optional, and its configurations have their + own tiers. No threshold of earlier versions changed, so their results + still apply; results of this grade apply from version 10. The gates were + adopted before any geostationary sample sizes were analyzed. + * - 11 + - Adds the sample size grade to the SAR and scatterometer classes, whose + samples are resolution cells (a resolution in range, projected to the + ground by the incidence angle, and in azimuth) rather than angular pixels: + at least 90% of published resolutions within 3%. Their products locate + resolution cells only through published tables, so the grade has no gate of + positions or spacing. As for the other classes added since version 8, the + grade is optional, and its configurations have their own tiers. No + threshold of earlier versions changed, so their results still apply; + results of these grades apply from version 11. The gate was adopted before + any resolutions were analyzed. Rules ===== @@ -109,8 +155,10 @@ Tiers - Meaning * - `validated` - All applicable gates pass under the rules above. An entry is validated only - if every configuration is, and it has configurations at the grades its - class requires. + if every configuration at a grade its class requires is, and it has + configurations at those grades. Configurations at an optional grade (the + sample size grade of every class but cross-track and conical) have their own + tiers, which do not set the entry's; their gaps are listed with the entry's. * - `partial` - Some gates are unmet or untested, or the evidence is incomplete. The entry lists each gap. @@ -122,7 +170,10 @@ Gates A configuration's grade states its use. Coverage and timing differ only in the 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 +sample size grade. The sample size grades of the other classes (versions 8 to 11) +are optional: their configurations are gated, but an entry does not need them to +be validated, as published sample sizes of these instruments are rarely given +away from nadir, or only as approximate values of their products. Orbit error against recorded positions is reported but not gated, because it grades the element set rather than the instrument. What each metric measures, and how, is stated under `Metrics`_. @@ -157,6 +208,12 @@ observes a track displaced from the ground track by the Earth's rotation: * - Epoch, 95th percentile (timing) - ≤ 1 s - ≤ 1 s + * - Dimensions within 3% (sample size, optional) + - ≥ 90% + - ≥ 90% + * - Spacing along track, error of the median (sample size, optional) + - ≤ 3% + - ≤ 3% .. list-table:: :header-rows: 1 @@ -216,18 +273,19 @@ observes a track displaced from the ground track by the Earth's rotation: - - ≥ 0.90 - - * - Pixel position, median (sample size) + * - Pixel position, median (sample size; optional but for cross-track) + - ≤ 6 km - ≤ 6 km - - - - - - - * - Dimensions within 3% (sample size) + - ≤ 6 km + * - Dimensions within 3% (sample size; optional but for cross-track and + conical) + - ≥ 90% + - ≥ 90% + - ≥ 90% - ≥ 90% - - - ≥ 90% - - - - * - Product limit of local zenith angle - - @@ -454,13 +512,31 @@ Sample size Published footprint dimensions, along and across track at stated scan angles, are compared with the sample sizes that `compute_sample_sizes` predicts for a satellite in a circular orbit at the published altitude and inclination, observing at those -scan angles. Each footprint gives two dimensions, and the metric is the share whose -relative error is within 3%. +scan angles (and, for a view pointed fore or aft, at its angle along track). Each +footprint gives two dimensions, and the metric is the share whose relative error is +within 3%. For a radar, the sizes are its resolutions (`range_resolution` and +`azimuth_resolution`), compared with published resolutions. Published dimensions +that cannot test a configuration are compared without the gate: those from which +its values come (such as a footprint at nadir from which a pixel's angle is +derived, or a geostationary grid's sampling distance at the sub-satellite point), +those whose definitions differ from the configuration's, or those only at nadir or +only approximate. Their record gives the largest error +(`sample_size_largest_error`) rather than the share within 3%, so the gate is +untested and the configuration partial, as its limitations state. **Pixel position, median** tests where samples fall within the swath. At a sample of scans, the position that the instrument projects for each pixel at the middle of the scan (`compute_projected_pixel_position`) is compared with the geolocated center -of the same sample in the product. The gate takes the median distance, in km. +of the same sample in the product. The gate takes the median distance, in km. The +pixels of a geostationary imager's fixed grid are projected from the grid's nominal +position (a geosynchronous orbit at its longitude), to which the products are +navigated, and compared with the grid's positions. + +**Spacing along track, error of the median** tests the spacing of a beam's samples +(shots or profiles) along its track: the median ratio of the spacing that +`compute_sample_sizes` predicts to that measured between consecutive samples in the +product, whose error from one is gated, in percent. The positions of the beams +are tested at the coverage grade. Back-Test ========= diff --git a/docs/validation/summary.rst b/docs/validation/summary.rst index 83f716f3..bbb51758 100644 --- a/docs/validation/summary.rst +++ b/docs/validation/summary.rst @@ -135,7 +135,8 @@ Instruments and Pointing (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`) + * - Side-looking SAR (`PointedInstrument` with roll, `roll_angle_profile`, `range_resolution`, + `azimuth_resolution`) - NISAR, Sentinel-1C - NISAR's swath edges within 5 to 7 km across track (95th percentile) (:doc:`instruments/ValidateSARNISAR`); roll steering profiles bring Sentinel-1C's within 6 to 7 km (:doc:`instruments/ValidateSARSentinel1`). @@ -147,7 +148,8 @@ Instruments and Pointing within 12.1 km (95th percentile) with a fixed field of view, and swath IoU 0.974 (:doc:`catalog`). NISAR's 77 MHz mode, on four held-out days with an element set of each day: 99.01% of passes predicted, edges within 3.1 km and epochs within 0.13 s (95th percentile); with an element set 3 to 7 days later, edges within 8.9 km and epochs within 1.28 s, as it lay 1.7 to 9.2 km ahead of the products' - orbits along track (:doc:`catalog`) + orbits along track (:doc:`catalog`). Sentinel-1's IW resolutions, derived from the look bandwidths and windows + of its ground range detected product, within 0.4% of its Product Definition's in each sub-swath (:doc:`catalog`) * - Wide-swath interferometer (two rolled instruments) - SWOT KaRIn - Every pixel 11 to 59 km from the ground track observed by the instrument on its side, none in the nadir gap; @@ -182,12 +184,16 @@ Instruments and Pointing 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 + - GOES-19 ABI, Himawari-9 AHI, Meteosat-12 FCI, TEMPO - A 17.4 deg field of regard observes the full disk; elevation angles within 0.0004 deg; product coverage limits within 0.36 deg of local zenith angle; on held-out AHI cloud top heights, the product's limit within 0.70 deg (:doc:`catalog`). TEMPO's region, as a rectangular view fitted to the edges of a full scan: field of regard IoU 0.994 with the area a held-out scan imaged; the hourly - east-west sweep is not modeled (:doc:`catalog`) + east-west sweep is not modeled (:doc:`catalog`). Fixed grids of scan angles (`ViewGeometry.SCAN`, sweeping + about the x axis as ABI's; `ViewGeometry.SCAN_ALONG_FIRST`, about the y axis as AHI's and FCI's) projected + from the grid's nominal position: pixels within 0.43 (ABI), 0.51 (AHI), and 0.92 km (FCI) of the products' grids + (median), most of it from the latitude to which SGP4's lunar and solar terms move the nominal orbit (0.004 to + 0.006 deg), and spacing within 0.1% (:doc:`catalog`) * - Tilted scanners (`pitch_angle_profile`), sun glint (`compute_glint_angle`) - PACE OCI - Pixels within 0.8 km near nadir and 9 km at the edges (median); epochs within 0.15 s (median) with a daily tilt diff --git a/docs/validation/systems_page.py b/docs/validation/systems_page.py index 892a47d7..30fd7122 100644 --- a/docs/validation/systems_page.py +++ b/docs/validation/systems_page.py @@ -262,7 +262,9 @@ def render() -> str: A system's tier is computed from its results and the thresholds of the :ref:`system standard ` (version {SYSTEM_STANDARD_VERSION}), and cannot be declared. Values fitted to reference data are tested on data at -least {MIN_HOLDOUT_GAP_DAYS} days from their fitting data. +least {MIN_HOLDOUT_GAP_DAYS} days from their fitting data. A system's tier for a +use is that of its weakest configuration at the use's grade (`get_tier`), by +which systems can be listed. .. code-block:: python @@ -270,6 +272,7 @@ def render() -> str: jpss = get_system("jpss") jpss.validation # tier, gate results, and gaps of each configuration + list_systems(tier="validated", grade="ground_track") # validated for tracks # the planes of the orbits, at an epoch, with their cataloged instruments satellites = jpss.build(epoch=start, time_step=10) # orbits maintained on JPSS's repeat ground track, at any epoch diff --git a/src/tatc/analysis/point_sampling.py b/src/tatc/analysis/point_sampling.py index 924b620e..2646e327 100644 --- a/src/tatc/analysis/point_sampling.py +++ b/src/tatc/analysis/point_sampling.py @@ -884,7 +884,7 @@ def residual(seconds: np.ndarray, index: np.ndarray) -> TimeRequest: t = _to_time_from_offsets(reference, seconds) yield t orbit_track = orbit.get_orbit_track_at_time(t) - if instrument.view_geometry == ViewGeometry.SCAN: + if ViewGeometry(instrument.view_geometry).is_scan: # the target crosses the scan plane (tilted by the pitch angle) position, _, along, _ = _compute_view_frame( orbit_track, diff --git a/src/tatc/analysis/sample_sizes.py b/src/tatc/analysis/sample_sizes.py index aa9c8d61..cd8eb52a 100644 --- a/src/tatc/analysis/sample_sizes.py +++ b/src/tatc/analysis/sample_sizes.py @@ -98,7 +98,12 @@ def compute_sample_sizes( `ConicalInstrument.compute_sample_size` and `ConicalInstrument.compute_sample_spacing`, `NaN` unless its `beam_width` and `scan_sample_spacing` are given), and `NaN` for other - instruments, whose samples are not defined. + instruments, whose samples are not defined. Along and across track are those + of the instrument's velocity frame: for a geostationary platform, whose + velocity is east in the inertial frame (and nearly zero in the Earth-fixed + frame), a `PointedInstrument` in the inertial frame gives the sizes east-west + (`sample_along`) and north-south (`sample_cross`), as of the pixels of a fixed + grid of scan angles. Also computes the platform's slant range from the target (`platform_range`, meters) and the target's scan angle (`scan_angle`, diff --git a/src/tatc/catalog/loader.py b/src/tatc/catalog/loader.py index eb87f0e1..c5c5bfd9 100644 --- a/src/tatc/catalog/loader.py +++ b/src/tatc/catalog/loader.py @@ -29,7 +29,7 @@ _read_table, parse_system, ) -from .system_standard import SystemClass +from .system_standard import SystemClass, SystemGrade _RESOURCES = pathlib.Path(__file__).parents[1] / "resources" _ENTRIES = _RESOURCES / "instruments" @@ -100,16 +100,24 @@ def list_entries( tier: Tier | str | None = None, *, platform: str | None = None, + grade: Grade | str | None = None, ) -> list[InstrumentEntry]: """ - Lists catalog entries, optionally of one class or validation tier, or that - list a platform. + Lists catalog entries, optionally of one class or validation tier, that list + a platform, or that have a configuration for a use (a grade). With a grade, + the tier is the entry's for that use (see `InstrumentEntry.get_tier`): the + lowest tier of its configurations that serve the grade, so that, for + example, `list_entries(tier="validated", grade="coverage")` gives the + entries validated for coverage, whatever their tier at other grades. Args: instrument_class (InstrumentClass | str | None): The class, if any. - tier (Tier | str | None): The validation tier, if any. + tier (Tier | str | None): The validation tier, if any: the entry's, or, + with a grade, the entry's for the grade. platform (str | None): The identifier of a spacecraft of the catalog's systems (see `get_spacecraft`) that the entries list, if any. + grade (Grade | str | None): The grade of a use that the entries have a + configuration for, if any. Returns: list[InstrumentEntry]: Copies of the entries, sorted by identifier. @@ -118,13 +126,21 @@ def list_entries( None if instrument_class is None else InstrumentClass(instrument_class) ) wanted_tier = None if tier is None else Tier(tier) - return [ - entry.model_copy(deep=True) - for entry in map(_load_entry, get_entry_ids()) - if (wanted_class is None or entry.instrument_class == wanted_class) - and (platform is None or platform in entry.platforms) - and (wanted_tier is None or entry.validation.tier == wanted_tier) - ] + wanted_grade = None if grade is None else Grade(grade) + selected = [] + for entry in map(_load_entry, get_entry_ids()): + if wanted_class is not None and entry.instrument_class != wanted_class: + continue + if platform is not None and platform not in entry.platforms: + continue + if wanted_grade is not None or wanted_tier is not None: + entry_tier = entry.get_tier(wanted_grade) + if entry_tier is None or ( + wanted_tier is not None and entry_tier != wanted_tier + ): + continue + selected.append(entry.model_copy(deep=True)) + return selected def build_payload( @@ -291,29 +307,46 @@ def list_systems( tier: Tier | str | None = None, *, satellite: bool | None = None, + grade: SystemGrade | str | None = None, ) -> list[SystemEntry]: """ - Lists catalog systems, optionally of one class or validation tier, or only - satellite systems (or only networks). + Lists catalog systems, optionally of one class or validation tier, only + satellite systems (or only networks), or those with a configuration for a + use (a grade). With a grade, the tier is the system's for that use (see + `SystemEntry.get_tier`): the lowest tier of its configurations that serve + the grade, so that, for example, `list_systems(tier="validated", + grade="ground_track")` gives the systems validated for their ground tracks, + whatever their tier at other grades. Args: system_class (SystemClass | str | None): The class, if any. - tier (Tier | str | None): The validation tier, if any. + tier (Tier | str | None): The validation tier, if any: the system's, or, + with a grade, the system's for the grade. satellite (bool | None): `True` for satellite systems only, `False` for networks only, or `None` (the default) for both. + grade (SystemGrade | str | None): The grade of a use that the systems + have a configuration for, if any. Returns: list[SystemEntry]: Copies of the systems, sorted by identifier. """ wanted_class = None if system_class is None else SystemClass(system_class) wanted_tier = None if tier is None else Tier(tier) - return [ - entry - for entry in map(get_system, get_system_ids()) - if (wanted_class is None or entry.system_class == wanted_class) - and (satellite is None or entry.system_class.is_satellite() == satellite) - and (wanted_tier is None or entry.validation.tier == wanted_tier) - ] + wanted_grade = None if grade is None else SystemGrade(grade) + selected = [] + for entry in map(get_system, get_system_ids()): + if wanted_class is not None and entry.system_class != wanted_class: + continue + if satellite is not None and entry.system_class.is_satellite() != satellite: + continue + if wanted_grade is not None or wanted_tier is not None: + entry_tier = entry.get_tier(wanted_grade) + if entry_tier is None or ( + wanted_tier is not None and entry_tier != wanted_tier + ): + continue + selected.append(entry) + return selected @functools.lru_cache(maxsize=None) diff --git a/src/tatc/catalog/schemas.py b/src/tatc/catalog/schemas.py index 1b07ead2..db5de1a2 100644 --- a/src/tatc/catalog/schemas.py +++ b/src/tatc/catalog/schemas.py @@ -53,6 +53,7 @@ EntryValidation, Grade, InstrumentClass, + Tier, evaluate_entry, get_gates, serves, @@ -1196,6 +1197,33 @@ def validation(self) -> EntryValidation: """ return evaluate_entry(self) + def get_tier(self, grade: Grade | str | None = None) -> Tier | None: + """ + Gets the tier of this entry for a use: the entry's tier (see + `validation`), or, for a grade, the lowest tier of its configurations + that serve the grade (as a configuration at the timing grade serves the + coverage grade, see `tatc.catalog.standard.serves`), whether or not the + grade is one its class requires, as an entry is only as strong as its + weakest configuration. An entry that is partial for a grade it cannot yet + meet (such as the sample size grade) may be validated for coverage. + + Args: + grade (Grade | str | None): The grade of the use, or `None` for the + entry's tier. + + Returns: + Tier | None: The tier, or `None` if no configuration serves the grade. + """ + validation = self.validation + if grade is None: + return validation.tier + tiers = [ + validation.configurations[key].tier + for key, configuration in self.configurations.items() + if configuration.serves(grade) + ] + return min(tiers, key=lambda tier: tier.rank) if tiers else None + def get_spacecraft(self) -> list[Spacecraft]: """ Gets the spacecraft that carry this instrument, from the catalog's diff --git a/src/tatc/catalog/standard.py b/src/tatc/catalog/standard.py index a320cec6..9fdf453e 100644 --- a/src/tatc/catalog/standard.py +++ b/src/tatc/catalog/standard.py @@ -22,7 +22,7 @@ from .records import ConfigurationRecord from .schemas import InstrumentEntry -STANDARD_VERSION = 7 +STANDARD_VERSION = 11 """The version of the thresholds in `get_gates`.""" _LAST_THRESHOLD_CHANGE = 1 @@ -189,6 +189,11 @@ def format_value(self, value: float) -> str: _PRODUCT_LIMIT = Gate( "product_limit", 0.5, True, "deg", "Product limit of local zenith angle" ) +# version 9: the error (%) of the median ratio of predicted to measured spacing of +# samples along track, of the beams of lidars, profilers, and altimeters +_SPACING_ALONG = Gate( + "spacing_along_error", 3, True, "%", "Spacing along track, error of the median" +) # version 2: the share of beam segments within the views at their times, where # the beams follow their reference tracks, and the error of the spacing of beams _SEGMENT_RECALL = Gate("segment_recall", 99, False, "%", "Segment recall") @@ -271,7 +276,57 @@ def format_value(self, value: float) -> str: (InstrumentClass.GEOSTATIONARY_REGIONAL, Grade.COVERAGE): (_FIELD_OF_REGARD_IOU,), (InstrumentClass.CROSS_TRACK, Grade.SAMPLE_SIZE): (_SAMPLE_SIZE, _PIXEL_POSITION), (InstrumentClass.CONICAL, Grade.SAMPLE_SIZE): (_SAMPLE_SIZE,), + # version 8: the sample sizes of pushbroom imagers, with the gates of + # cross-track scanners + (InstrumentClass.PUSHBROOM, Grade.SAMPLE_SIZE): (_SAMPLE_SIZE, _PIXEL_POSITION), + # version 9: the footprints and spacing of the beams of lidars, profilers, and + # altimeters, whose positions the coverage grade tests + **{ + (instrument_class, Grade.SAMPLE_SIZE): (_SAMPLE_SIZE, _SPACING_ALONG) + for instrument_class in ( + InstrumentClass.LIDAR, + InstrumentClass.PROFILER, + InstrumentClass.ALTIMETER, + ) + }, + # version 10: the pixels of geostationary imagers' fixed grids, with the gates + # of cross-track scanners + (InstrumentClass.GEOSTATIONARY, Grade.SAMPLE_SIZE): ( + _SAMPLE_SIZE, + _PIXEL_POSITION, + ), + # version 11: the resolution cells of SAR and scatterometers, whose products + # locate them only through published tables of resolution + (InstrumentClass.SAR, Grade.SAMPLE_SIZE): (_SAMPLE_SIZE,), + (InstrumentClass.SCATTEROMETER, Grade.SAMPLE_SIZE): (_SAMPLE_SIZE,), +} +# the versions of the standard that added a grade to a class that had others +_GRADE_VERSIONS: dict[tuple[InstrumentClass, Grade], int] = { + (InstrumentClass.PUSHBROOM, Grade.SAMPLE_SIZE): 8, + (InstrumentClass.LIDAR, Grade.SAMPLE_SIZE): 9, + (InstrumentClass.PROFILER, Grade.SAMPLE_SIZE): 9, + (InstrumentClass.ALTIMETER, Grade.SAMPLE_SIZE): 9, + (InstrumentClass.GEOSTATIONARY, Grade.SAMPLE_SIZE): 10, + (InstrumentClass.SAR, Grade.SAMPLE_SIZE): 11, + (InstrumentClass.SCATTEROMETER, Grade.SAMPLE_SIZE): 11, } +# grades whose configurations are gated but that an entry does not need to be +# validated: the sample sizes of pushbroom imagers, whose published pixel sizes are +# rarely given away from nadir (version 8), of the beams of lidars, profilers, and +# altimeters (version 9), of geostationary imagers (version 10), and of SAR and +# scatterometers (version 11) +_OPTIONAL_GRADES: frozenset[tuple[InstrumentClass, Grade]] = frozenset( + (instrument_class, Grade.SAMPLE_SIZE) + for instrument_class in ( + InstrumentClass.PUSHBROOM, + InstrumentClass.LIDAR, + InstrumentClass.PROFILER, + InstrumentClass.ALTIMETER, + InstrumentClass.GEOSTATIONARY, + InstrumentClass.SAR, + InstrumentClass.SCATTEROMETER, + ) +) def get_gates(instrument_class: InstrumentClass, grade: Grade) -> tuple[Gate, ...]: @@ -300,8 +355,11 @@ def get_gates(instrument_class: InstrumentClass, grade: Grade) -> tuple[Gate, .. def get_required_grades(instrument_class: InstrumentClass) -> tuple[Grade, ...]: """ Gets the grades that an entry needs to be validated: the coverage grade, and - the sample size grade if its class has one. A configuration at the timing - grade also meets the coverage grade, as timing also tests coverage. + the sample size grade if its class has one that is not optional (those of + the pushbroom, lidar, profiler, altimeter, geostationary, SAR, and + scatterometer classes are optional). A + configuration at the timing grade also meets the coverage grade, as timing + also tests coverage. Args: instrument_class (InstrumentClass): The class of the instrument. @@ -309,32 +367,42 @@ def get_required_grades(instrument_class: InstrumentClass) -> tuple[Grade, ...]: Returns: tuple[Grade, ...]: The required grades. """ + instrument_class = InstrumentClass(instrument_class) return tuple( grade for grade in (Grade.COVERAGE, Grade.SAMPLE_SIZE) - if (InstrumentClass(instrument_class), grade) in _GATES + if (instrument_class, grade) in _GATES + and (instrument_class, grade) not in _OPTIONAL_GRADES ) -def is_compatible(instrument_class: InstrumentClass, version: int) -> bool: +def is_compatible( + instrument_class: InstrumentClass, version: int, grade: Grade | None = None +) -> bool: """ Checks whether results tested under a version of the standard apply to a - class: the version is compatible and has the class's gates. Version 2 added - the lidar class, 3 the altimeter class, 4 the scatterometer class, 5 the - regional geostationary class, 6 the profiler class, and 7 the limb and - occultation classes. + class (and, if given, a grade): the version is compatible and has the gates + of the class at the grade. Version 2 added the lidar class, 3 the altimeter + class, 4 the scatterometer class, 5 the regional geostationary class, 6 the + profiler class, 7 the limb and occultation classes, 8 the sample size grade + of the pushbroom class, 9 that of the lidar, profiler, and altimeter + classes, 10 that of the geostationary class, and 11 that of the SAR and + scatterometer classes. Args: instrument_class (InstrumentClass): The class of the instrument. version (int): The version of the standard. + grade (Grade | None): The grade of the results, or `None` for any grade + of the class. Returns: bool: `True`, if the results apply. """ - return ( - version in COMPATIBLE_VERSIONS - and version >= _CLASS_VERSIONS[InstrumentClass(instrument_class)] - ) + instrument_class = InstrumentClass(instrument_class) + added = _CLASS_VERSIONS[instrument_class] + if grade is not None: + added = max(added, _GRADE_VERSIONS.get((instrument_class, Grade(grade)), 0)) + return version in COMPATIBLE_VERSIONS and version >= added def serves(configuration_grade: Grade | str, grade: Grade | str) -> bool: @@ -422,7 +490,11 @@ class EntryValidation: """ The validation status of an entry, computed from its records and the standard: of each configuration, and the grades of its class that no - configuration serves (`missing_grades`). + configuration serves (`missing_grades`). Its tier is set by the + configurations at the grades its class requires (see + `get_required_grades`); those at an optional grade (the sample size grade + of most classes) have their own tiers, and their gaps are listed with the + others'. """ tier: Tier @@ -595,11 +667,18 @@ def _evaluate_configuration( record = None if entry.record is None else entry.record.configurations.get(key) gaps = () if record is not None and not is_compatible( - entry.instrument_class, record.standard_version + entry.instrument_class, record.standard_version, configuration.grade ): + # the grade, if the version applies to the class but not to the grade + what = ( + f"the {Grade(configuration.grade).value} grade of the " + f"{entry.instrument_class.value} class" + if is_compatible(entry.instrument_class, record.standard_version) + else f"the {entry.instrument_class.value} class" + ) gaps = ( f"version {record.standard_version} of the standard, of the test, " - f"does not apply to the {entry.instrument_class.value} class", + f"does not apply to {what}", ) return _evaluate_record( configuration.grade, @@ -620,7 +699,10 @@ def evaluate_entry(entry: InstrumentEntry) -> EntryValidation: Applies the standard to an entry's records. An entry is only as strong as its weakest configuration, needs configurations that serve the grades of its class (see `get_required_grades`), and is partial rather than nominal if any - configuration was compared with reference data. + configuration was compared with reference data. Configurations at a grade + that is optional for the class (the sample size grade of the pushbroom, + lidar, profiler, altimeter, geostationary, SAR, and scatterometer classes) + have their own tiers, which do not set the entry's. Args: entry (InstrumentEntry): The entry. @@ -636,4 +718,20 @@ class (see `get_required_grades`), and is partial rather than nominal if any for grade in get_required_grades(entry.instrument_class) if not any(c.serves(grade) for c in entry.configurations.values()) ) - return _combine(configurations, missing) + instrument_class = InstrumentClass(entry.instrument_class) + counted = { + key: validation + for key, validation in configurations.items() + if (instrument_class, Grade(validation.grade)) not in _OPTIONAL_GRADES + } + if counted: + tier = _combine(counted, missing).tier + else: + # only optional configurations: partial (a grade is missing) if any was + # compared with reference data + tier = ( + Tier.PARTIAL + if any(c.tier != Tier.NOMINAL for c in configurations.values()) + else Tier.NOMINAL + ) + return EntryValidation(tier, configurations, missing) diff --git a/src/tatc/catalog/system_schemas.py b/src/tatc/catalog/system_schemas.py index be723246..f031f9e1 100644 --- a/src/tatc/catalog/system_schemas.py +++ b/src/tatc/catalog/system_schemas.py @@ -628,6 +628,33 @@ def validation(self) -> EntryValidation: """ return evaluate_system(self) + def get_tier(self, grade: SystemGrade | str | None = None) -> Tier | None: + """ + Gets the tier of this system for a use: the system's tier (see + `validation`), or, for a grade, the lowest tier of its configurations + that serve the grade (as a configuration at the ground track grade serves + the plane grade, see `tatc.catalog.system_standard.serves_system`), as a + system is only as strong as its weakest configuration. A system that is + partial for one use may be validated for another (such as its ground + track). + + Args: + grade (SystemGrade | str | None): The grade of the use, or `None` for + the system's tier. + + Returns: + Tier | None: The tier, or `None` if no configuration serves the grade. + """ + validation = self.validation + if grade is None: + return validation.tier + tiers = [ + validation.configurations[key].tier + for key, configuration in self.configurations.items() + if configuration.serves(grade) + ] + return min(tiers, key=lambda tier: tier.rank) if tiers else None + def get_digest(self, configuration: str) -> str: """ Gets the digest of the values of a configuration that affect analysis diff --git a/src/tatc/resources/instruments/abi.yml b/src/tatc/resources/instruments/abi.yml index cdd82271..9820777c 100644 --- a/src/tatc/resources/instruments/abi.yml +++ b/src/tatc/resources/instruments/abi.yml @@ -51,7 +51,7 @@ configurations: grade: coverage description: The Earth's disk, as imaged by a full-disk scan. platforms: [goes-19] - velocity_frame: earth_fixed + velocity_frame: inertial instruments: - type: instrument parameters: @@ -67,7 +67,7 @@ configurations: grade: coverage description: Where the sea surface temperature product is of good quality (local zenith angle up to 67 degrees). platforms: [goes-19] - velocity_frame: earth_fixed + velocity_frame: inertial instruments: - type: instrument parameters: @@ -81,7 +81,7 @@ configurations: grade: coverage description: Where the land surface temperature product is of good quality (local zenith angle up to 55 degrees). platforms: [goes-19] - velocity_frame: earth_fixed + velocity_frame: inertial instruments: - type: instrument parameters: @@ -91,6 +91,45 @@ configurations: field_of_regard: kind: derived source: compute_field_of_regard(35786e3, 90 - 55), from the bound declared by the product + pixels: + grade: sample_size + description: The fixed grid of the infrared bands (2 km), 5424 pixels square of 56 urad in scan angles, whose sizes and spacing `compute_sample_sizes` gives (east-west along track, north-south across track). Analyze it on a geosynchronous orbit at the grid's longitude (-75.2 deg), to which the products are navigated. + platforms: [goes-19] + velocity_frame: inertial + instruments: + - type: pointed + parameters: + name: ABI + field_of_regard: 20 + cross_track_field_of_view: 17.403249 + along_track_field_of_view: 17.403249 + cross_track_pixels: 5424 + along_track_pixels: 5424 + view_geometry: scan + is_rectangular: true + provenance: + field_of_regard: + kind: derived + source: Contains the Earth's disk + cross_track_field_of_view: &grid + kind: nominal + source: "GOES-R Product Definition and Users' Guide, Vol. 3 (L1b), Rev 2.3, section 5.1.2.2: \"The ABI native spatial resolutions are 0.5, 1.0, and 2.0 km at nadir... angular separation between imagery data points, which are 14, 28, and 56 microradians\" (https://www.ospo.noaa.gov/Organization/Documents/PUG/GS%20Series%20416-R-PUG-L1B-0347%20Vol%203%20Rev%202.3.pdf); the 5,424 pixels of 56 urad" + along_track_field_of_view: *grid + cross_track_pixels: &size + kind: nominal + source: "GOES-R Product Definition and Users' Guide, Vol. 3, Table 5.1.2.6: 5424 pixels square at 2 km for the full disk" + along_track_pixels: *size + view_geometry: + kind: derived + source: "The fixed grid's north-south angle is a rotation about the x axis, and its east-west angle about the rotated y axis (GOES-R Product Definition and Users' Guide, Vol. 3, section 5.1.2.1), the angles of a scan view in the inertial frame" + is_rectangular: + kind: derived + source: Models the fixed grid as a rectangular view + limitations: + - Only sizes at the sub-satellite point are published, which the grid's angle defines, so the sample size gate is not applied. + - The products are navigated to the grid seen from the nominal position, whereas a satellite's element sets lie up to a few hundredths of a degree from it, which moves a view projected from the satellite's position by kilometers. The configuration's along-track and cross-track directions are east and north only in the inertial frame. + - "The grid is that of the infrared bands. The visible and near-infrared bands' grids are two (28 urad) and four (14 urad) times as fine; the detectors' instantaneous fields of view differ from the grid's angle (GOES-R Series Data Book, Table 3-1)." limitations: + - A geostationary satellite barely moves relative to the Earth, so every configuration uses the inertial frame, in which its motion, and so the along-track direction, is east (the coverage configurations, whose views are cones about nadir, do not depend on it). - The scan is not modeled. Every point is available at any time, without the 10 minute cadence of a full-disk scan or the mesoscale and CONUS sectors. - On GOES-18 (GOES-West, 137.2 deg W), recorded as a transfer (full-disk products of 2026-11-17 at 12:00 UTC, with a public element set), every imaged pixel was observed, with elevation angles within 0.0006 deg, and the product limits were within 0.37 deg (sea surface temperature) and 0.25 deg (land surface temperature). Using the configurations on GOES-18 warns, as for any platform on which they were not validated. diff --git a/src/tatc/resources/instruments/ahi.yml b/src/tatc/resources/instruments/ahi.yml index 20d0fadb..8a775403 100644 --- a/src/tatc/resources/instruments/ahi.yml +++ b/src/tatc/resources/instruments/ahi.yml @@ -43,7 +43,7 @@ configurations: grade: coverage description: The Earth's disk, as imaged by a full-disk scan. platforms: [himawari-9] - velocity_frame: earth_fixed + velocity_frame: inertial instruments: - type: instrument parameters: @@ -59,7 +59,7 @@ configurations: grade: coverage description: Where the cloud top height product is retrieved (local zenith angle up to about 79.4 degrees). platforms: [himawari-9] - velocity_frame: earth_fixed + velocity_frame: inertial instruments: - type: instrument parameters: @@ -74,5 +74,44 @@ configurations: limitations: - The product declares no bound of local zenith angle; the bound is measured as the greatest angle at which it retrieves a height, which it does only for cloudy pixels. - On the held-out scan of 2026-11-08T12:00Z, the product retrieved heights up to 79.384 deg (0.005 deg from the fit), but the boundary of predicted observations lay up to 0.70 deg from it, beyond the gate's 0.5 deg. A field of regard is a cone about nadir, and so near the limb it meets the flattened Earth at local zenith angles that vary with latitude, from about 79.1 deg in the tropics to 79.9 deg at high latitudes. + pixels: + grade: sample_size + description: The fixed grid of the infrared bands (2 km at the sub-satellite point), 5500 pixels square of 55.888 urad in scan angles, whose sizes and spacing `compute_sample_sizes` gives (east-west along track, north-south across track). Analyze it on a geosynchronous orbit at the grid's longitude (140.7 deg), to which the products are navigated. + platforms: [himawari-9] + velocity_frame: inertial + instruments: + - type: pointed + parameters: + name: AHI + field_of_regard: 20 + cross_track_field_of_view: 17.611803 + along_track_field_of_view: 17.611803 + cross_track_pixels: 5500 + along_track_pixels: 5500 + view_geometry: scan_along_first + is_rectangular: true + provenance: + field_of_regard: + kind: derived + source: Contains the Earth's disk + cross_track_field_of_view: &grid + kind: derived + source: "The angle of 2 km at the sub-satellite point (JMA, Himawari Standard Data User's Guide v1.3, Table 3: \"Spatial resolution at SSP (sub satellite point) [km]\" of 2 for the infrared bands, https://www.data.jma.go.jp/mscweb/en/himawari89/space_segment/hsd_sample/HS_D_users_guide_en_v13.pdf) from the projection's distance of 42,164 km from the Earth's center (35,785.863 km above the equator), 55.888 urad" + along_track_field_of_view: *grid + cross_track_pixels: &size + kind: nominal + source: "JMA, Himawari Standard Data User's Guide v1.3, Table 3: 5,500 pixels square at 2 km for the full disk" + along_track_pixels: *size + view_geometry: + kind: derived + source: "The Normalized Geostationary Projection of the LRIT/HRIT Global Specification (Himawari Standard Data User's Guide, section 3), whose east-west angle precedes its north-south angle (a sweep about the y axis), the angles of a scan view along track first in the inertial frame" + is_rectangular: + kind: derived + source: Models the fixed grid as a rectangular view + limitations: + - Only sizes at the sub-satellite point are published, which the grid's angle defines, so the sample size gate is not applied. + - The products are navigated to the grid seen from the nominal position, whereas a satellite's element sets lie up to a few hundredths of a degree from it, which moves a view projected from the satellite's position by kilometers. The configuration's along-track and cross-track directions are east and north only in the inertial frame. + - "The grid is that of the infrared bands. The visible and near-infrared bands' grids are two and four times as fine." limitations: + - A geostationary satellite barely moves relative to the Earth, so every configuration uses the inertial frame, in which its motion, and so the along-track direction, is east (the coverage configurations, whose views are cones about nadir, do not depend on it). - The scan is not modeled. Every point is available at any time, without the 10 minute cadence of a full-disk scan or the Japan and target sectors. diff --git a/src/tatc/resources/instruments/ascat.yml b/src/tatc/resources/instruments/ascat.yml index 71cc00a3..3d96c225 100644 --- a/src/tatc/resources/instruments/ascat.yml +++ b/src/tatc/resources/instruments/ascat.yml @@ -75,6 +75,55 @@ configurations: - On data held out on 2026-11-08 (34 days from the fit), 99.83% of passes were predicted, the edges were within 7.2 km (95th percentile), the swaths' intersection over union was 0.983 (median) and 0.976 (5th percentile) at time steps of 10 to 120 s, as the swaths are the strips the views' cross-track lines sweep (is_swept), and epochs were within 1.91 s (95th percentile). A pass is observed within half a cell (12.5 km) of a cell, which leaves the cells' corners out, so 85.9% of predicted passes were observed; precision is not gated for this class. - Rescored after swept swaths (is_swept) were added, on the same data, with the other results unchanged; with views tailored to the time step, the swaths' intersection over union had been 0.991 (median; 0.983 at the 5th percentile) at 10 s, 0.992 (0.984) at 30 s, and 0.973 (0.964) at 120 s. - The product stores the times of rows to 128 s; they are recovered as rows 3.75 s apart, within 0.375 s of the stored times' rounding. On the fitting day, the edges lay 0.16 deg ahead of the plane across track at the recovered times (about 0.4 s), which is not modeled. + resolution: + grade: sample_size + description: The 25 km product's cells (resolution of about 50 km) in the left and right swaths (one at a time, by instrument index), whose sizes `compute_sample_sizes` gives, from published values; not compared with reference data. + platforms: [metop-c] + velocity_frame: earth_fixed + grouping: alternatives + instruments: + - type: pointed + parameters: &resolution_parameters + name: ASCAT left + field_of_regard: 90 + cross_track_field_of_view: 21.3587 + along_track_field_of_view: 1.0 + roll_angle: 34.1656 + is_rectangular: true + range_resolution: 50000 + range_resolution_frame: ground + azimuth_resolution: 50000 + provenance: &resolution_provenance + field_of_regard: + kind: derived + source: Contains the swaths + cross_track_field_of_view: *left + along_track_field_of_view: + kind: placeholder + source: An extent of the view along track, which the resolutions replace + roll_angle: *left + is_rectangular: + kind: derived + source: Models a swath as a rectangular view + range_resolution: &resolution + kind: nominal + source: "EUMETSAT ASCAT User Guide (EUM/OPS-EPS/MAN/04/0028 v6), section 4.4.1.2: \"approximately 50 km and 30 km horizontal resolution on grids of 25 km and 12.5 km\", the width at 50% of the spatial filter in the along-track and across-track directions (https://user.eumetsat.int/s3/eup-strapi-media/ASCAT_User_Guide_1618a3d741.pdf)" + range_resolution_frame: + kind: derived + source: The product's resolution is constant on the ground + azimuth_resolution: *resolution + - type: pointed + parameters: + <<: *resolution_parameters + name: ASCAT right + cross_track_field_of_view: 21.3596 + roll_angle: -34.1649 + provenance: + <<: *resolution_provenance + cross_track_field_of_view: *right + roll_angle: *right + limitations: + - The resolution is that of the 25 km product, an approximate published value, so the configuration is nominal; the 12.5 km product's is about 25 km near the nadir gap to 34 km far from it. The grid's spacing (25 km) is not modeled. limitations: - Winds are retrieved over the ocean, without sea ice; the swaths are those of the cells' geometry, which the product gives everywhere. - The swaths were fitted and tested on Metop-C. On Metop-B, recorded as a transfer (2026-11-17, from ASCATB-L2-25km, with a public element set), they met the gates of the coverage grade as on Metop-C (pass recall 99.83%, edges within 6.7 km at the 95th percentile, IoU 0.983 at the median and 0.977 at the 5th percentile, epochs within 1.91 s at the 95th percentile). Using the configuration on Metop-B warns, as for any platform on which it was not validated. diff --git a/src/tatc/resources/instruments/atlas.yml b/src/tatc/resources/instruments/atlas.yml index 29f62f35..2d8bd6b1 100644 --- a/src/tatc/resources/instruments/atlas.yml +++ b/src/tatc/resources/instruments/atlas.yml @@ -94,5 +94,50 @@ configurations: - Each pair's strong and weak beams, about 90 m apart across track and 2.5 km along track, share one view. - On held-out data (4 November 2026, with an element set of 8 November, about 4 days from the data), the views contained every sampled segment, but TAT-C's epochs preceded the segments' times by 5.5 s (median), failing the timing gate. This is consistent with an along-track error of the element set, such as after an orbit adjustment that it does not represent, as ValidateLidarICESat2 also found; epochs are only as accurate as the element set along track. - The same held-out data tested afterward with the element set of the day (epoch nearest its middle, from validation/catalog/elements/icesat2_2026-11-04.3le; validate_catalog_atlas.py --same-day-element-set) had every sampled segment within its pair's view, the pairs' spacing within 0.021 km, and epochs within 0.37 s (95th percentile; +0.03 s median), passing the timing gate. The record keeps the element set a few days from the data, the age for which the views' widths were fitted, so this result is not counted toward the tier. + footprints: + grade: sample_size + description: The footprints of the three beam pairs' centers, at the angles of the beam pairs configuration, whose sizes and spacing along track `compute_sample_sizes` gives, from published values; not compared with reference data. + platforms: [icesat-2] + velocity_frame: earth_fixed + grouping: alternatives + instruments: + - type: pointed + parameters: &footprint_parameters + name: ATLAS beam pair 1 + field_of_regard: 2 + cross_track_field_of_view: 0.001375 + along_track_field_of_view: 0.001375 + roll_angle: 0.3507 + is_rectangular: false + scan_period: 0.0001 + provenance: &footprint_provenance + field_of_regard: + kind: derived + source: Contains the footprint + cross_track_field_of_view: &divergence + kind: nominal + source: "Martino et al. (2023), Proc. SPIE 12512, Table 1: \"Transmitted Beam divergence (85% enclosed energy) 24 µR\", typical values that vary from beam to beam and with temperature (https://ntrs.nasa.gov/api/citations/20230010087/downloads/Martino_12512-17v2.pdf)" + along_track_field_of_view: *divergence + roll_angle: *measured + is_rectangular: + kind: derived + source: Models a footprint as a circular view + scan_period: + kind: nominal + source: "Neumann et al. (2019), Remote Sensing of Environment 233, 111325, Table 1: a pulse repetition rate of 10 kHz, footprints \"spaced ~0.7 m along track\" (https://pmc.ncbi.nlm.nih.gov/articles/PMC6839705)" + - type: pointed + parameters: + <<: *footprint_parameters + name: ATLAS beam pair 2 + roll_angle: -0.0511 + provenance: *footprint_provenance + - type: pointed + parameters: + <<: *footprint_parameters + name: ATLAS beam pair 3 + roll_angle: -0.4511 + provenance: *footprint_provenance + limitations: + - The footprint is that of the typical divergence (about 12 m at 496 km, 85% enclosed energy), whereas footprints measured with retroreflectors average 10.9 m (Magruder et al., 2021); the strong and weak beams of a pair, about 90 m apart, share their pair's center. The reference data of the entry (ATL08 segments of 100 m) do not give the spacing of shots, so the configuration is nominal. limitations: - TAT-C does not find ICESat-2's 91-day repeat cycle from an element set; declare it as a maintained orbit (see ValidateLidarICESat2). diff --git a/src/tatc/resources/instruments/atlid.yml b/src/tatc/resources/instruments/atlid.yml index 2525580f..61d11d01 100644 --- a/src/tatc/resources/instruments/atlid.yml +++ b/src/tatc/resources/instruments/atlid.yml @@ -80,6 +80,40 @@ configurations: - 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. + footprints: + grade: sample_size + description: The footprint of the laser, at the angles of the profile configuration, whose size and spacing along track `compute_sample_sizes` gives. + platforms: [earthcare] + velocity_frame: earth_fixed + instruments: + - type: pointed + parameters: + name: ATLID + field_of_regard: 6.2752 + cross_track_field_of_view: 0.002063 + along_track_field_of_view: 0.002063 + roll_angle: 0.0282 + pitch_angle: -3.0481 + is_rectangular: false + scan_period: 0.039216 + provenance: + field_of_regard: + kind: derived + source: That of the profile configuration + cross_track_field_of_view: &divergence + kind: nominal + source: "Wehr et al. (2023), Atmos. Meas. Tech. 16, 3581, section 5.1: a \"divergence of 36 µrad after the × 6.7 beam expander\" (https://doi.org/10.5194/amt-16-3581-2023)" + along_track_field_of_view: *divergence + roll_angle: *measured + pitch_angle: *measured + is_rectangular: + kind: derived + source: Models a footprint as a circular view + scan_period: + kind: derived + source: "Two shots at 51 Hz, accumulated on board (do Carmo et al. (2021), Atmosphere 12, 76: \"51 Hz, corresponding to about 285 m spatial sampling for a local accumulation of two shots\", https://www.mdpi.com/2073-4433/12/1/76)" + limitations: + - The footprint is that of the laser's divergence (about 14 m at 393 km); the receiver's field of view is wider (66.5 µrad, about 26 m), and the published footprints (15 m for the laser, and at most 30 m for the receiver, on ESA's pages) do not state their definition, so they are compared without the gate. 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 index f41cb023..6bbe3ee8 100644 --- a/src/tatc/resources/instruments/bbr.yml +++ b/src/tatc/resources/instruments/bbr.yml @@ -84,6 +84,73 @@ configurations: - 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. + pixels: + grade: sample_size + description: The aft, nadir, and fore views (instrument indices 0, 1, and 2), each a line of 30 pixels across track at the angles of the views configuration, whose sizes and spacing `compute_sample_sizes` gives. Analyze one at a time with its instrument index. + platforms: [earthcare] + velocity_frame: earth_fixed + grouping: alternatives + instrument_index: 1 + instruments: + - type: pointed + parameters: &pixel_parameters + name: BBR aft + field_of_regard: 100.7374 + cross_track_field_of_view: 2.49983 + along_track_field_of_view: 0.093306 + cross_track_pixels: 30 + roll_angle: 0.0964 + pitch_angle: -50.3554 + is_rectangular: true + cross_track_oversampling: 0.106944 + scan_period: 0.1532 + provenance: &pixel_provenance + field_of_regard: + kind: derived + source: That of the view in the views configuration + cross_track_field_of_view: + kind: derived + source: The 30 pixels of a line at the spacing of the view's measured field of view between its outermost pixels (2.4165 deg over 29 intervals, 0.083328 deg) + along_track_field_of_view: &pixel_width + kind: derived + source: "The angle of the nadir footprint at 393 km, the mission's nominal mean spherical altitude, from Wehr et al. (2023), Atmos. Meas. Tech. 16, 3581, section 5.4: \"the instantaneous field of view is nominally 0.64 km × 0.64 km at nadir\" (https://doi.org/10.5194/amt-16-3581-2023)" + cross_track_pixels: + kind: nominal + source: "Wehr et al. (2023): a line of 30 pixels for each view; Clerbaux et al., 2nd ESA-JAXA EarthCARE Validation Workshop (2025): \"30 detectors for each view\"" + roll_angle: *measured + pitch_angle: *measured + is_rectangular: + kind: derived + source: Models an imaged line as a rectangular view + cross_track_oversampling: + kind: derived + source: One minus the spacing of pixels (0.083328 deg) divided by the pixel width of the nadir footprint (0.093306 deg) + scan_period: + kind: nominal + source: "Clerbaux et al., 2nd ESA-JAXA EarthCARE Validation Workshop (2025), B-SNG sampling: \"dt = 0.1532 sec\" (https://gerb.oma.be/public/nic/Prodex_BRAVO/presentation_2nd_Validation_Workshop_Clerbaux.pdf)" + - type: pointed + parameters: + <<: *pixel_parameters + name: BBR nadir + field_of_regard: 2.4359 + cross_track_field_of_view: 2.49983 + roll_angle: 0.0062 + pitch_angle: -0.0913 + provenance: *pixel_provenance + - type: pointed + parameters: + <<: *pixel_parameters + name: BBR fore + field_of_regard: 100.3558 + cross_track_field_of_view: 2.499724 + roll_angle: -0.0970 + pitch_angle: 50.1645 + cross_track_oversampling: 0.10698 + provenance: *pixel_provenance + limitations: + - The pixel width comes from the published nadir footprint, so that comparison is not independent; the footprints of the slanted views (1.876 km along by 1.069 km across track, in Wehr et al. (2023), for both views at their nominal 50 deg) are the independent ones. + - Pixel positions and spacing are compared on the nadir view. + - The pixels of the slanted views are 3.0% (aft) and 4.0% (fore) shorter along track, and 1.8% and 2.3% narrower across track, than the published footprints, so the published dimensions fail the gate (4 of 6 within 3%). The published footprints are one value for both views at their nominal angle, whereas the views' fitted angles differ (50.36 deg aft, 50.16 deg fore), and they state no altitude other than the nominal one. 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/ceres.yml b/src/tatc/resources/instruments/ceres.yml index eb6f37ed..e14c784e 100644 --- a/src/tatc/resources/instruments/ceres.yml +++ b/src/tatc/resources/instruments/ceres.yml @@ -59,6 +59,43 @@ configurations: - On data held out on 2026-09-30, 99.6% of observed passes were predicted and 99.4% of predicted passes observed, with epochs within 0.29 s (95th percentile) and the swath's intersection over union 0.9995 (0.998 with views tailored to the time step, before swept swaths were added; rescored on the same data), but the swath width, which a field of regard gives on a spherical Earth, differed by 7.9 km (median) from that between the outermost footprints, beyond the gate's 5 km. The difference grows toward the horizon, which the swath's edges, 60 deg from nadir, approach. - The field of regard was fitted with both sweeps of each record, whose footprints are offset by about 0.075 deg across track toward the end of each sweep, and was not fitted again when the script took the first sweep alone. On the fitting day, the first sweep alone measures 60.0639 deg left and 59.9074 deg right of the geodetic nadir (a field of regard of 119.9713 deg, centered 0.0786 deg to the left), and the second sweep 59.9138 deg left and 60.0574 deg right (centered 0.0718 deg to the right). The view is centered on nadir, as the mean of both sweeps is (0.0047 deg to the left), so the first sweep, which the record tests, lies about 0.08 deg to the left of the view. - The validation script was changed twice before its recorded run, without changing the entry. A run on the fitting day took both sweeps of each record as scans, whose cells crossed, and was replaced by the first sweep alone; a first run on 2026-09-30 kept every fourth footprint of a sweep, too sparse at the swath's edges to find the passes there (55.99% of predicted passes found), and was replaced by every footprint. + beams_noaa_20: + grade: sample_size + description: The 191 footprints of the first Earth sweep of each record of CERES on NOAA-20, whose sizes and spacing `compute_sample_sizes` gives. + platforms: [noaa-20] + velocity_frame: inertial + instruments: + - type: pointed + parameters: &beam_parameters + name: CERES + field_of_regard: 120.597018 + cross_track_field_of_view: 120.597018 + along_track_field_of_view: 2.6 + cross_track_pixels: 191 + is_rectangular: true + cross_track_oversampling: 0.514309 + scan_period: 6.6 + provenance: &beam_provenance + field_of_regard: &sampling + kind: derived + source: "The footprints of the Earth sweep (191, between the outermost of the swath's field of regard) at the spacing of the scan rate over the 10 ms sampling interval, 0.631398 deg, from CERES Software Bulletin 96-04: \"Normal Scan Rate 63.1398 deg/sec\" and \"660 measurements per 6.6-sec scan\" (https://webarchive.library.unt.edu/eot2008/20090825090144id_/http://asd-www.larc.nasa.gov/ceres/sw_bull/CERES_SB_96-04.pdf)" + cross_track_field_of_view: *sampling + cross_track_pixels: *sampling + along_track_field_of_view: + kind: nominal + source: "CERES ATBD Subsystem 4.4 (Release 2.2), section 4.4.2.2: \"The optical field-of-view (FOV) is a truncated diamond (or hexagon) and is 1.3o in the along-scan direction and 2.6o in the across-scan direction\" (https://ceres.larc.nasa.gov/documents/ATBD/pdf/r2_2/ceres-atbd2.2-s4.4.pdf)" + is_rectangular: + kind: derived + source: Models a sweep as a rectangular view + cross_track_oversampling: + kind: derived + source: One minus the sample spacing of 0.631398 deg divided by the optical field of view of 1.3 deg along the scan (CERES ATBD Subsystem 4.4) + scan_period: + kind: nominal + source: "CERES Software Bulletin 96-04: \"660 measurements per 6.6-sec scan\", a record of two sweeps, of which the first is compared" + limitations: + - &ceres_optical Only footprints at nadir are published (the optical field of view's, in the CERES ATBD, for TRMM at 350 km and EOS at 705 km, none for this orbit), so the sample size gate is not applied. Pixels are the optical field of view, a rectangle of 1.3 by 2.6 deg in place of its hexagon, whereas the footprint weighted by the point spread function is larger (17 by 27 km at half power at nadir from 705 km), and its centroid trails the optical axis by about 1 deg along the scan. + - &ceres_sweeps Pixels are projected at the time of the middle of the sweep, whereas CERES samples its footprints up to about 1 s before or after it, and scans are spaced by the 6.6 s record, of whose two sweeps the first is compared. swath_suomi_npp: grade: coverage description: The swath of CERES's cross-track scan on Suomi NPP, between the outermost footprint centers, with a view tailored to the analysis time step. @@ -99,7 +136,28 @@ configurations: - The product places footprints at the top of the atmosphere (30 km); they are compared on the ellipsoid, projected along the line of sight from the spacecraft. - On data held out on 2026-06-20, with an element set from a file of the history of Suomi NPP's element sets (NOAA's archive has none before 2026-08-19), 99.996% of observed passes were predicted and 99.8% of predicted passes observed, with epochs within 1.49 s (95th percentile), the swath width within 0.71 km (median), and the swath's intersection over union 0.9999. The yaw was given to the body's attitude when tested, and then to the instrument, which gives the same views; the record was rescored on the same held-out data, with the swath width, now measured with the instrument's yaw, 15 m wider than 0.70 km, and every other result unchanged. - The product ends on 2026-07-31, and Suomi NPP was retired on 2026-11-02. + beams_suomi_npp: + grade: sample_size + description: The 191 footprints of the first Earth sweep of each record of CERES on Suomi NPP, at the yaw and roll of its swath, whose sizes and spacing `compute_sample_sizes` gives. + platforms: [suomi-npp] + velocity_frame: inertial + instruments: + - type: pointed + parameters: + <<: *beam_parameters + yaw_angle: -0.2725 + roll_angle: 0.1317 + provenance: + <<: *beam_provenance + roll_angle: *measured_suomi_npp + yaw_angle: + kind: measured + source: validate_catalog_ceres.py --fit, the slope of the footprints' along-track on their cross-track tangents (inertial frame) + platforms: [suomi-npp] + period: "2026-07-25" + limitations: + - *ceres_optical + - *ceres_sweeps limitations: - NOAA-20 and Suomi NPP do not steer their yaw, so the configurations use the inertial frame. - Only the cross-track mode is modeled. CERES instruments also scan in other modes (rotating azimuth plane or along track) on some days, and those on Terra and Aqua differ. - - No configuration gives sample sizes, as no published footprint size was used. diff --git a/src/tatc/resources/instruments/cpr.yml b/src/tatc/resources/instruments/cpr.yml index 7167a1b4..9126f24e 100644 --- a/src/tatc/resources/instruments/cpr.yml +++ b/src/tatc/resources/instruments/cpr.yml @@ -69,6 +69,34 @@ configurations: - 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. + footprints: + grade: sample_size + description: The footprint of the radar's beam at nadir, whose size and spacing along track `compute_sample_sizes` gives. + platforms: [earthcare] + velocity_frame: earth_fixed + instruments: + - type: pointed + parameters: + name: CPR + field_of_regard: 1.432 + cross_track_field_of_view: 0.095 + along_track_field_of_view: 0.095 + is_rectangular: false + scan_period: 0.069151 + provenance: + field_of_regard: *width + cross_track_field_of_view: &beamwidth + kind: nominal + source: "ESA, EarthCARE CPR: \"Beam width | 0.095 degree\" (https://earth.esa.int/eogateway/instruments/cpr); JAXA CPR L1b Product Definition Document, beamwidthAT and beamwidthCT of 0.095" + along_track_field_of_view: *beamwidth + is_rectangular: + kind: derived + source: Models a footprint as a circular view + scan_period: + kind: derived + source: "The time to travel the integration length of 500 m (Wehr et al. (2023), section 5.2: \"Horizontally averaged data along track are produced with the minimum pixel size of 500 m\") at the ground speed of a circular orbit at 393 km (7.23 km/s)" + limitations: + - Published footprints differ by definition and altitude (about 650 m across and 1 km along track on eoPortal; about 750 m at a maximum altitude of 450 km in Wehr et al. (2023); 765 m by 840 m for the product in JAXA's product definition), so they are compared without the gate. The beam width gives about 650 m at 393 km. 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/csar.yml b/src/tatc/resources/instruments/csar.yml index 9f2c171e..66b68d43 100644 --- a/src/tatc/resources/instruments/csar.yml +++ b/src/tatc/resources/instruments/csar.yml @@ -138,6 +138,113 @@ configurations: - The swath is the strip the view's cross-track line sweeps (is_swept), so it does not depend on the time step. On data held out on 2026-11-10 (39 days from the fit), 99.16% of observed points were predicted, with the swath edges within 7.6 km (near range) and 9.5 km (far range) at the 95th percentile, epochs within 0.34 s (95th percentile), and the swath's intersection over union 0.989 (median; 0.976 at the 5th percentile) at time steps of 10 to 120 s. - Swept swaths were added after the configuration's first holdout, on 2026-08-12, where views tailored to the time step reached beyond the swath at long time steps; the swath's intersection over union was 0.978 (5th percentile 0.968) at 10 s and 0.955 (0.923) at 30 s, but 0.818 (0.741) at 120 s, failing the standard's 0.90. Rescored with swept swaths, it was 0.990 (0.983) at every time step, with the other results unchanged (99.53% of points predicted, edges within 5.5 km and 4.7 km); the configuration was then tested on 2026-11-10, a day not used before, which its record holds. - Images are formed in the plane perpendicular to the Earth-fixed velocity (zero-Doppler geometry), so a user-supplied attitude should keep the Earth-fixed frame. + resolution_iw: + grade: sample_size + description: The resolution cells of the IW mode's ground range detected high resolution (GRDH) product, in its three sub-swaths (one at a time, by instrument index; IW2 by default), each looking at the incidence angle of the product definition, whose sizes `compute_sample_sizes` gives. + platforms: [sentinel-1c] + velocity_frame: earth_fixed + grouping: alternatives + instrument_index: 1 + instruments: + - type: pointed + parameters: + name: C-SAR IW1 + field_of_regard: 84.0596 + cross_track_field_of_view: 4.4178 + along_track_field_of_view: 1.0 + roll_angle: -29.3332 + is_rectangular: true + range_resolution: 11.1144 + azimuth_resolution: 22.4857 + provenance: + field_of_regard: + kind: derived + source: That of the IW configuration + cross_track_field_of_view: + kind: derived + source: A third of the IW configuration's field of view (13.2534 deg), as the sub-swaths' bounds are not modeled + along_track_field_of_view: + kind: placeholder + source: An extent of the view along track, which the resolutions replace + roll_angle: + kind: derived + source: "The look angle, from a spherical Earth of 6,371 km at 693 km, of the incidence angle of 32.9 deg of the Sentinel-1 Product Definition (S1-RS-MDA-52-7440 v2.13), Table 7-6 (https://sentiwiki.copernicus.eu/__attachments/a_343020cd67157ee306363c81c9963d6e0ed60b436ea1d5e9bace1595d8ab40b9/S1-RS-MDA-52-7440_Sentinel-1-Product-Definition-v2.13.pdf), looking right" + is_rectangular: + kind: derived + source: Models a sub-swath as a rectangular view + range_resolution: + kind: derived + source: "The 3 dB width of the impulse response in slant range, 0.886 c / (2 B) broadened by 1.18 for the Hamming coefficient of 0.7 (Sentinel-1 Product Definition, Table A-1), of the range look bandwidth B of 14.1 MHz of the Sentinel-1 Product Definition, Table 7-6" + azimuth_resolution: + kind: derived + source: "The 3 dB width of the impulse response in azimuth, 0.886 v / B broadened by 1.18 for the Hamming coefficient of 0.7 (Table A-1), of the azimuth look bandwidth B of 315 Hz (Table 7-6) and the ground speed v of a circular orbit at 693 km (6,774.9 m/s)" + - type: pointed + parameters: + name: C-SAR IW2 + field_of_regard: 84.0596 + cross_track_field_of_view: 4.4178 + along_track_field_of_view: 1.0 + roll_angle: -33.9851 + is_rectangular: true + range_resolution: 12.6223 + azimuth_resolution: 22.5344 + provenance: + field_of_regard: + kind: derived + source: That of the IW configuration + cross_track_field_of_view: + kind: derived + source: A third of the IW configuration's field of view (13.2534 deg), as the sub-swaths' bounds are not modeled + along_track_field_of_view: + kind: placeholder + source: An extent of the view along track, which the resolutions replace + roll_angle: + kind: derived + source: "The look angle, from a spherical Earth of 6,371 km at 693 km, of the incidence angle of 38.3 deg of the Sentinel-1 Product Definition (S1-RS-MDA-52-7440 v2.13), Table 7-6 (https://sentiwiki.copernicus.eu/__attachments/a_343020cd67157ee306363c81c9963d6e0ed60b436ea1d5e9bace1595d8ab40b9/S1-RS-MDA-52-7440_Sentinel-1-Product-Definition-v2.13.pdf), looking right" + is_rectangular: + kind: derived + source: Models a sub-swath as a rectangular view + range_resolution: + kind: derived + source: "The 3 dB width of the impulse response in slant range, 0.886 c / (2 B) broadened by 1.15 for the Hamming coefficient of 0.73 (Sentinel-1 Product Definition, Table A-1), of the range look bandwidth B of 12.1 MHz of the Sentinel-1 Product Definition, Table 7-6" + azimuth_resolution: + kind: derived + source: "The 3 dB width of the impulse response in azimuth, 0.886 v / B broadened by 1.13 for the Hamming coefficient of 0.75 (Table A-1), of the azimuth look bandwidth B of 301 Hz (Table 7-6) and the ground speed v of a circular orbit at 693 km (6,774.9 m/s)" + - type: pointed + parameters: + name: C-SAR IW3 + field_of_regard: 84.0596 + cross_track_field_of_view: 4.4178 + along_track_field_of_view: 1.0 + roll_angle: -38.0423 + is_rectangular: true + range_resolution: 14.0255 + azimuth_resolution: 22.5344 + provenance: + field_of_regard: + kind: derived + source: That of the IW configuration + cross_track_field_of_view: + kind: derived + source: A third of the IW configuration's field of view (13.2534 deg), as the sub-swaths' bounds are not modeled + along_track_field_of_view: + kind: placeholder + source: An extent of the view along track, which the resolutions replace + roll_angle: + kind: derived + source: "The look angle, from a spherical Earth of 6,371 km at 693 km, of the incidence angle of 43.1 deg of the Sentinel-1 Product Definition (S1-RS-MDA-52-7440 v2.13), Table 7-6 (https://sentiwiki.copernicus.eu/__attachments/a_343020cd67157ee306363c81c9963d6e0ed60b436ea1d5e9bace1595d8ab40b9/S1-RS-MDA-52-7440_Sentinel-1-Product-Definition-v2.13.pdf), looking right" + is_rectangular: + kind: derived + source: Models a sub-swath as a rectangular view + range_resolution: + kind: derived + source: "The 3 dB width of the impulse response in slant range, 0.886 c / (2 B) broadened by 1.13 for the Hamming coefficient of 0.75 (Sentinel-1 Product Definition, Table A-1), of the range look bandwidth B of 10.7 MHz of the Sentinel-1 Product Definition, Table 7-6" + azimuth_resolution: + kind: derived + source: "The 3 dB width of the impulse response in azimuth, 0.886 v / B broadened by 1.13 for the Hamming coefficient of 0.75 (Table A-1), of the azimuth look bandwidth B of 301 Hz (Table 7-6) and the ground speed v of a circular orbit at 693 km (6,774.9 m/s)" + limitations: + - The resolutions are those of the product's processing (its look bandwidths and windows), and the sub-swaths' views are a third of the swath each, so a sub-swath's resolution applies across its third rather than its exact bounds. The spacing of the product's pixels (10 m) is not modeled. + - The EW mode's products are not modeled, as the Product Definition gives their resolutions but not the look bandwidths of the ground range detected products, from which the resolutions would be derived independently of them. limitations: - The fitted values were measured on Sentinel-1C. On Sentinel-1D, they are a transfer that warns on use; on 2026-11-05, results were like Sentinel-1C's, with 98.6% (IW) and 98.7% (EW) of points found, edges within 7.8 km (IW) and 11.1 km (EW) at the 95th percentile, and the swath's intersection over union 0.974 (IW) and 0.988 (EW) at every time step. - The Stripmap and Wave modes are not represented, and the roll angles within a mode, which the mission sets by its beam and plans, are taken as those of the fitting day. diff --git a/src/tatc/resources/instruments/earthcare_msi.yml b/src/tatc/resources/instruments/earthcare_msi.yml index b700caef..af7991ef 100644 --- a/src/tatc/resources/instruments/earthcare_msi.yml +++ b/src/tatc/resources/instruments/earthcare_msi.yml @@ -76,3 +76,4 @@ 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. + - No configuration gives sample sizes. The product compared (MSI_RGR_1C) is regridded, no instantaneous field of view is published, and the published 500 m is a requirement on the sampling at the highest altitude of the orbit, not the size of a pixel. diff --git a/src/tatc/resources/instruments/ecostress.yml b/src/tatc/resources/instruments/ecostress.yml index 40632a6b..09d225fc 100644 --- a/src/tatc/resources/instruments/ecostress.yml +++ b/src/tatc/resources/instruments/ecostress.yml @@ -77,9 +77,59 @@ configurations: - On data held out on 2026-11-08 (35 days from the fit), 98.87% of observed passes were predicted, below the gate's 99%, and 98.40% of predicted passes observed, with epochs within 0.72 s (95th percentile) and the swath width within 0.62 km (median). The swath's intersection over union was 0.988 at time steps of 10 to 120 s, as the swath is the strip the view's cross-track line sweeps (is_swept). Rescored after swept swaths were added, on the same data, with the other results unchanged; with views tailored to the time step, which the body's yaw and pitch skew, it had been 0.988 at 10 s and 0.977 at 30 s, but 0.898 at 120 s, below the gate's 0.95. The swath is compared over spans of up to 4.3 min between gaps in the scenes. - On data held out on 2026-11-07, with the earlier roll, pitch, and field of view, 99.42% of observed passes were predicted and 97.54% of predicted passes observed, with epochs within 0.84 s (95th percentile) and the swath width within 2.11 km (median), but the swath's intersection over union, with views tailored to the time step (before swept swaths were added), was 0.930 at a time step of 120 s, below the gate's 0.95 (0.965 at 10 s and 0.962 at 30 s), as a long view yawed and pitched with the body has skewed ends. The swath is compared over spans of up to 5.1 min between gaps in the scenes. - The validation script was changed after a first run on 2026-11-07, without changing the entry. That run read every fourth scene, whose spans without gaps (0.8 min at most) were too short to compare the swath, and found passes within 10 km of a sample, fewer than the spacing of the samples kept (precision 59.15%); it was replaced by blocks of eight consecutive scenes in every 32 and a radius of 20 km. + beams: + grade: sample_size + description: The 5,400 samples by 128 lines of a sweep, at the attitude and roll of the swath, whose sizes and spacing `compute_sample_sizes` gives. + platforms: [iss] + velocity_frame: inertial + attitude: + yaw_angle: 3.7876 + pitch_angle: -7.2427 + instruments: + - type: pointed + parameters: + name: ECOSTRESS + field_of_regard: 56 + cross_track_field_of_view: 53.001215 + along_track_field_of_view: 1.380599 + cross_track_pixels: 5400 + along_track_pixels: 128 + roll_angle: 0.8654 + view_geometry: scan + is_rectangular: true + scan_period: 1.181 + provenance: + field_of_regard: + kind: derived + source: Contains the view, rolled and pitched, as for the swath + cross_track_field_of_view: + kind: derived + source: "The 5,400 samples of a line at the spacing of the swath's measured field of view between the outermost samples (52.9914 deg over 5,399 intervals, 171.30 urad), which agrees with the pixel of the L1 Calibration ATBD, Table 1, \"Pixel GSD (Nadir) ... Product: 75.3 x 68.51m\" from \"(400 +/- 25 km)\", 68.51 m across track (171.28 urad at 400 km) (https://lpdaac.usgs.gov/documents/222/ECO1B_Calibration_ATBD_V1.pdf)" + along_track_field_of_view: + kind: derived + source: "The 128 lines of a sweep, each of the product pixel along track of the L1 Calibration ATBD, Table 1, 75.3 m at 400 km (two detectors of 37.65 m averaged; ECO1B User Guide: \"the 256 pixels in one scan are averaged to 128 pixels\")" + cross_track_pixels: + kind: nominal + source: "ECO1B User Guide: \"5400 pixels per line\" (https://lpdaac.usgs.gov/documents/1491/ECO1B_User_Guide_V2.pdf)" + along_track_pixels: + kind: nominal + source: "ECO1B User Guide: \"the 256 pixels in one scan are averaged to 128 pixels\"" + roll_angle: *measured_view + view_geometry: + kind: derived + source: A scanning mirror keeps a constant angular extent along track + is_rectangular: + kind: derived + source: Models a sweep as a rectangular view + scan_period: + kind: nominal + source: "ECO1B User Guide: \"each scan taking approximately 1.181 seconds\"" + limitations: + - Only the pixel at nadir is published (75.3 by 68.51 m from 400 km), so the sample size gate is not applied. The sizes scale with the station's altitude, which varies by about 25 km. + - Consecutive sweeps overlap by about 15 to 30 lines, so the spacing of lines along track averaged over sweeps is less than the pixel, whereas `compute_sample_spacing` gives the spacing within a sweep where it is larger than the sweep's advance divided among its lines. + - Pixels are projected at the start time of the sweep, from the middle line of every fourth sweep. limitations: - The station flies in a fixed attitude relative to its orbit, without yaw steering, so the configuration uses the inertial frame. Its attitude changes for operations such as dockings, which are not modeled. - The body's attitude, a yaw of 3.7876 deg and a pitch of -7.2427 deg, is fitted to ECOSTRESS's samples alone, so it holds the station's attitude and ECOSTRESS's mounting on it, which one instrument cannot separate. The other instruments' fits give other angles (EMIT a yaw of 3.7416 deg and a pitch of -7.5608 deg; GEDI, on other days, a pitch of -3.2916 deg), so configurations of instruments on the station are carried together only with an attitude that replaces theirs. - ECOSTRESS images scenes over land and coastal waters by plan, whereas the view observes whenever a target is in view. - The station's orbit decays and is reboosted often, so element sets age quickly. - - No configuration gives sample sizes, as no published instantaneous field of view was used. diff --git a/src/tatc/resources/instruments/emit.yml b/src/tatc/resources/instruments/emit.yml index a76702ae..ca63cd40 100644 --- a/src/tatc/resources/instruments/emit.yml +++ b/src/tatc/resources/instruments/emit.yml @@ -62,9 +62,49 @@ configurations: - On data held out on 2026-11-08 (35 days from the fit), epochs were within 0.25 s (95th percentile) and the swath width within 0.05 km (median), but 94.6% of a sample of 1,000 pixels were observed within two minutes of their times, and the swath's intersection over union with the strip between the outermost pixels was 0.925 (median of 8 segments of 120 s) at time steps of 10 to 120 s, failing both gates. Rescored after swept swaths (is_swept) were added, on the same data, with the other results unchanged; with views tailored to the time step, it had been 0.92 at 10 s, 0.91 at 30 s, and 0.73 at 120 s. Diagnosed after the run, the missed pixels lay within about 1.5 km of one edge, consistent with the station's roll varying from day to day (by 0.12 deg, about 0.9 km, between the fit and 2026-11-07) and the error of an element set two days old across track, which the narrow swath (about 75 km) cannot absorb at the recall gate. - The roll, pitch, and field of view were changed after the run on 2026-11-07 recorded below, and the configuration tested again on 2026-11-08 (above). They had been measured with --fit (a roll of 0.3073 deg from the geodetic nadir, a pitch of -7.5841 deg, and a field of view of 11.0943 deg). - On data held out on 2026-11-07 (34 days from the fit), with the earlier roll, pitch, and field of view, epochs were within 0.86 s (95th percentile) and the swath width within 0.47 km (median), but only 92.3% of a sample of 1,000 pixels were observed within two minutes of their times, and the swath's intersection over union with the strip between the outermost pixels was 0.85 at a time step of 10 s and 0.69 at 120 s (median of 6 segments of 120 s), failing both gates. Diagnosed after the run, the view lay 4.0 to 4.5 km to one side of the observed swath (median, both edges; first reported as 6.4 to 6.9 km, from projections that omitted the roll), and the missed pixels lay along that edge, whereas the angles fitted on the held-out day barely differ. The roll, measured from the geodetic nadir at each line's time, does not center the view that TAT-C rolls, pitches, and yaws. + pixels: + grade: sample_size + description: The 1,242 pixels of a line, at the attitude and roll of the swath, whose sizes and spacing `compute_sample_sizes` gives. + platforms: [iss] + velocity_frame: inertial + attitude: + yaw_angle: 3.7416 + pitch_angle: -7.5608 + instruments: + - type: pointed + parameters: + name: EMIT + field_of_regard: 20 + cross_track_field_of_view: 11.049296 + along_track_field_of_view: 0.009798 + cross_track_pixels: 1242 + roll_angle: 0.7829 + is_rectangular: true + scan_period: 0.00926 + provenance: + field_of_regard: + kind: derived + source: Contains the view, rolled and pitched, as for the swath + cross_track_field_of_view: + kind: derived + source: "The 1,242 pixels of a line at the spacing of the swath's measured field of view between the outermost pixels (11.0404 deg over 1,241 intervals, 155.27 urad), which agrees with the EMIT L1B ATBD, Table 3: \"Cross-track IFOV 155 microradians\" (https://lpdaac.usgs.gov/documents/1570/EMITL1B_ATBD_v1.pdf)" + along_track_field_of_view: + kind: nominal + source: "EMIT L1B ATBD, Table 3: \"Along-track IFOV 171 microradians\"" + cross_track_pixels: + kind: nominal + source: "EMIT L1B User Guide (JPL D-107862), Table 2-1: \"Data Dimensions 1242 cross-track\" (https://lpdaac.usgs.gov/documents/1568/EMITL1BRAD_User_Guide_v1.pdf)" + roll_angle: *measured_view + is_rectangular: + kind: derived + source: Models a line of a pushbroom as a rectangular view + scan_period: + kind: nominal + source: "EMIT L1B ATBD: \"A line of data is collected every 9.26 ms.\"" + limitations: + - Only the pixel at nadir is published (62 m across by 68 m along track from 400 km, in the EMIT L1B ATBD), so the sample size gate is not applied; across the narrow field of view, of about 5.5 deg either side, the pixel grows by less than 1%. limitations: - The station flies in a fixed attitude relative to its orbit, without yaw steering, so the configuration uses the inertial frame. Its attitude changes for operations such as dockings, which are not modeled. - The body's attitude, a yaw of 3.7416 deg and a pitch of -7.5608 deg, is fitted to EMIT's samples alone, so it holds the station's attitude and EMIT's mounting on it, which one instrument cannot separate. The other instruments' fits give other angles (ECOSTRESS a yaw of 3.7876 deg and a pitch of -7.2427 deg; GEDI, on other days, a pitch of -3.2916 deg), so configurations of instruments on the station are carried together only with an attitude that replaces theirs. - EMIT images scenes of arid regions and plume targets by plan, whereas the view observes whenever a target is in view. - The station's orbit decays and is reboosted often, so element sets age quickly. - - No configuration gives sample sizes. diff --git a/src/tatc/resources/instruments/fci.yml b/src/tatc/resources/instruments/fci.yml index d236a66c..58729565 100644 --- a/src/tatc/resources/instruments/fci.yml +++ b/src/tatc/resources/instruments/fci.yml @@ -51,7 +51,7 @@ configurations: grade: coverage description: The Earth's disk, as imaged by a full-disk scan. platforms: [meteosat-12] - velocity_frame: earth_fixed + velocity_frame: inertial instruments: - type: instrument parameters: @@ -67,7 +67,7 @@ configurations: grade: coverage description: Where the land surface temperature is retrieved (local zenith angle up to 70 degrees). platforms: [meteosat-12] - velocity_frame: earth_fixed + velocity_frame: inertial instruments: - type: instrument parameters: @@ -83,7 +83,7 @@ configurations: grade: coverage description: Where the sea surface temperature is of acceptable quality or better (quality levels 4 and 5, local zenith angle up to 65 degrees). platforms: [meteosat-12] - velocity_frame: earth_fixed + velocity_frame: inertial instruments: - type: instrument parameters: @@ -95,5 +95,44 @@ configurations: source: compute_field_of_regard(35786e3, 90 - 65), from the bound beyond which the product gives no sea surface temperature of acceptable quality or better (validate_catalog_fci.py --fit), which the product does not declare platforms: [meteosat-12] period: "2026-10-16" + pixels: + grade: sample_size + description: The fixed grid of the infrared bands in the normal mode (2 km at the sub-satellite point), 5568 pixels square of 55.887 urad in scan angles, whose sizes and spacing `compute_sample_sizes` gives (east-west along track, north-south across track). Analyze it on a geosynchronous orbit at the grid's longitude (0.0 deg), to which the products are navigated. + platforms: [meteosat-12] + velocity_frame: inertial + instruments: + - type: pointed + parameters: + name: FCI + field_of_regard: 20 + cross_track_field_of_view: 17.829282 + along_track_field_of_view: 17.829282 + cross_track_pixels: 5568 + along_track_pixels: 5568 + view_geometry: scan_along_first + is_rectangular: true + provenance: + field_of_regard: + kind: derived + source: Contains the Earth's disk + cross_track_field_of_view: &grid + kind: derived + source: "The angle of the spatial sampling distance of 2 km at the sub-satellite point (EUMETSAT, MTG End User Requirements Document, EUM/MTG/SPE/07/0036 v5A, Table 1, and p. 77: \"requirements expressed in spatial sampling distance are taken to apply at the sub-satellite point and can be translated to a spatial sampling angle\", https://user.eumetsat.int/s3/eup-strapi-media/pdf_mtg_eurd_d7b503ecc4.pdf) from the geostationary altitude of 35,786.4 km, 55.887 urad" + along_track_field_of_view: *grid + cross_track_pixels: &size + kind: nominal + source: "EUMETSAT, MTG FCI test data description (EUM/MTG/TEN/19/1090563), p. 4: \"Size: 5568x5568 or 11136x11136 pixels, depending on the channel\"" + along_track_pixels: *size + view_geometry: + kind: derived + source: "The reference grid rotates about the axis S3 and then about S2' (MTG End User Requirements Document), the convention of CGMS (a sweep about the y axis), the angles of a scan view along track first in the inertial frame" + is_rectangular: + kind: derived + source: Models the fixed grid as a rectangular view + limitations: + - Only sizes at the sub-satellite point are published, which the grid's angle defines, so the sample size gate is not applied. + - The products are navigated to the grid seen from the nominal position, whereas a satellite's element sets lie up to a few hundredths of a degree from it, which moves a view projected from the satellite's position by kilometers. The configuration's along-track and cross-track directions are east and north only in the inertial frame. + - "The grid is that of the infrared bands in the normal mode. The visible and near-infrared bands' grid is twice as fine, and the high-resolution mode's grids twice as fine again." limitations: + - A geostationary satellite barely moves relative to the Earth, so every configuration uses the inertial frame, in which its motion, and so the along-track direction, is east (the coverage configurations, whose views are cones about nadir, do not depend on it). - The scan is not modeled. Every point is available at any time, without the 10 minute cadence of a full-disk scan or the rapid scans of Europe. diff --git a/src/tatc/resources/instruments/gedi.yml b/src/tatc/resources/instruments/gedi.yml index b2444915..c16188da 100644 --- a/src/tatc/resources/instruments/gedi.yml +++ b/src/tatc/resources/instruments/gedi.yml @@ -161,6 +161,83 @@ configurations: - The body's pitch of -3.2916 deg is measured with validate_catalog_gedi.py --fit on 2026-05-01, from the shots' median offset along the ground track of the element set (24.39 km behind, 21.34 to 27.07 km at the 95th and 5th percentiles), at the station's median altitude of 424.1 km. It was added after the run on 2026-06-05 recorded below, and the configuration tested again on 2026-06-08. - On data held out on 2026-06-08 (38 days from the fit, with the pitch, with the beams' center within 1 deg of nadir for 85.9% of shots), 99.55% of sampled shots were within their beams' views at their times, and the spacing between adjacent beams was within 0.026 km (median) of the views', but TAT-C's epochs followed the shots' times by 1.1 s (median; 1.5 s at the 95th percentile), failing the timing gate. The pitch, measured as 24.4 km on the fitting day, moved the epochs by about 3.5 s, more than the offset of about 18 km on 2026-06-05; the along-track offset varies between days, by the station's attitude or GEDI's pointing, which were not measured. - On data held out on 2026-06-05 (35 days from the fit, without the pitch, with the beams' center within 1 deg of nadir for 92.2% of shots), 99.9% of sampled shots were within their beams' views at their times, and the spacing between adjacent beams was within 0.026 km (median) of the views', but TAT-C's epochs preceded the shots' times by 2.4 s (median; 2.8 s at the 95th percentile), failing the timing gate. A steady offset of about 18 km along track is consistent with the beams pointing behind the plane across track (the station's attitude and GEDI's mounting, as ECOSTRESS's pitch), which the views do not model; the fit measured offsets across track only. + footprints: + grade: sample_size + description: The footprints of the eight beams, at the angles of the beams configuration, whose sizes and spacing along track `compute_sample_sizes` gives. Analyze one beam at a time with its instrument index (0 on the left, 7 on the right). + platforms: [iss] + velocity_frame: inertial + attitude: + pitch_angle: -3.2916 + grouping: alternatives + instruments: + - type: pointed + parameters: &footprint_parameters + name: GEDI BEAM0000 + field_of_regard: 20 + cross_track_field_of_view: 0.003214 + along_track_field_of_view: 0.003214 + roll_angle: 0.4794 + is_rectangular: false + scan_period: 0.008264 + provenance: &footprint_provenance + field_of_regard: + kind: derived + source: Contains the footprint, pitched with the body + cross_track_field_of_view: &divergence + kind: nominal + source: "Dubayah et al. (2020), Science of Remote Sensing 1, 100002, p. 9: \"56.1 µrad (1/e2) beam divergence, that generates a 23 ± 2 m diameter footprint from the nominal 410 km altitude\" (https://ntrs.nasa.gov/api/citations/20200002117/downloads/20200002117.pdf)" + along_track_field_of_view: *divergence + roll_angle: *measured + is_rectangular: + kind: derived + source: Models a footprint as a circular view + scan_period: + kind: derived + source: "Two pulses of a laser, as every other shot of a beam is dithered to another track (Dubayah et al., 2020, p. 3: \"Each laser fires 242 times per second\" and \"footprint centers are separated by 60 m along track\")" + - type: pointed + parameters: + <<: *footprint_parameters + name: GEDI BEAM0001 + roll_angle: 0.3949 + provenance: *footprint_provenance + - type: pointed + parameters: + <<: *footprint_parameters + name: GEDI BEAM0010 + roll_angle: 0.3278 + provenance: *footprint_provenance + - type: pointed + parameters: + <<: *footprint_parameters + name: GEDI BEAM0011 + roll_angle: 0.2441 + provenance: *footprint_provenance + - type: pointed + parameters: + <<: *footprint_parameters + name: GEDI BEAM0101 + roll_angle: 0.1364 + provenance: *footprint_provenance + - type: pointed + parameters: + <<: *footprint_parameters + name: GEDI BEAM0110 + roll_angle: 0.053 + provenance: *footprint_provenance + - type: pointed + parameters: + <<: *footprint_parameters + name: GEDI BEAM1000 + roll_angle: -0.0482 + provenance: *footprint_provenance + - type: pointed + parameters: + <<: *footprint_parameters + name: GEDI BEAM1011 + roll_angle: -0.1315 + provenance: *footprint_provenance + limitations: + - The published footprint (23 m from 410 km) is that of the divergence, so it is compared without the gate; the mission's documents also give about 25 m and 30 m. The footprint is the beam's 1/e2 diameter, as a circle. limitations: - GEDI was stored on the station from March 2023 to April 2024, without observing. Its processed data were available until 10 June 2026 when the entry was made. - The station's orbit decays and is reboosted often, so element sets age quickly; the views were fitted and tested with element sets within hours of the data. diff --git a/src/tatc/resources/instruments/harp2.yml b/src/tatc/resources/instruments/harp2.yml index 517cfba2..7433bfff 100644 --- a/src/tatc/resources/instruments/harp2.yml +++ b/src/tatc/resources/instruments/harp2.yml @@ -72,5 +72,5 @@ limitations: - PACE flies with yaw steering, so the configuration uses the Earth-fixed frame. - OCI's configuration gives PACE's body the tilt schedule of OCI, which tilts by itself, so this configuration is not carried with OCI's. - HARP2 images the sunlit part of each orbit, whereas the view observes whenever a target is in view, unless a solar limit is added. - - No configuration gives sample sizes, as no published instantaneous field of view was used. + - No configuration gives sample sizes, as no instantaneous field of view or frame period is published and the published sizes at nadir differ (from 0.65 km to 3 km among the mission's documents). - The yaw of the configuration was given to the body's attitude when tested, and then to the instrument, which gives the same views within 3 cm on the ground, so that the platform's instruments share the body's attitude. The records were rescored on the same held-out data, with the swath width changed by 0.5 m, as it is now measured with the instrument's yaw, and every other result unchanged. diff --git a/src/tatc/resources/instruments/iasi_ng.yml b/src/tatc/resources/instruments/iasi_ng.yml index 4a55cfac..9355fe5b 100644 --- a/src/tatc/resources/instruments/iasi_ng.yml +++ b/src/tatc/resources/instruments/iasi_ng.yml @@ -63,6 +63,52 @@ configurations: is_rectangular: kind: derived source: Models a scanned swath as a rectangular view + fields_of_regard: + grade: sample_size + description: The centers of IASI-NG's 14 fields of regard, with footprints the size of one of the 16 pixels of each. + platforms: [metop-sga1] + velocity_frame: earth_fixed + instruments: + - type: pointed + parameters: + name: IASI-NG + field_of_regard: 102 + cross_track_field_of_view: 100.432769 + along_track_field_of_view: 7.173769 + cross_track_pixels: 14 + roll_angle: -0.1191 + is_rectangular: true + cross_track_oversampling: -7.712393 + along_track_oversampling: -7.712393 + scan_period: 15.561 + provenance: + field_of_regard: + kind: derived + source: Wider than the field of view, so that it does not clip the scan + cross_track_field_of_view: &measured_spacing + kind: derived + source: The 14 fields of regard at the spacing of the swath's measured field of view between their outermost centers (93.259 deg over 13 intervals, 7.1738 deg) + along_track_field_of_view: *measured_spacing + cross_track_pixels: + kind: nominal + source: "IASI-NG Science Plan v1.0 (EUMETSAT, 2018), Table 2.3: \"14 Earth views\" (https://www-cdn.eumetsat.int/files/2020-04/pdf_science_epssg_iasi_ng_plan.pdf)" + roll_angle: *measured + is_rectangular: + kind: derived + source: Models a scan line as a rectangular view + cross_track_oversampling: &oversampling + kind: derived + source: "One minus the spacing of fields of regard divided by a pixel width of 0.8234 deg, from the IASI-NG Science Plan, Table 2.1: \"Equivalent to circle of d = 12 km at nadir\", at the reference altitude of 835 km (the Science Plan states none)" + along_track_oversampling: *oversampling + scan_period: + kind: measured + source: The median period between the scans of the product (\"duration ≈ 15.6 s\" in the IASI-NG Science Plan, Table 2.3) + platforms: [metop-sga1] + period: "2026-11-18" + limitations: + - Only the pixel at nadir is published, without an altitude, and the pixel width comes from it, so the sample size gate is not applied. + - Each pixel of this configuration is a field of regard, which holds 16 of IASI-NG's pixels in an array of four by four (23.83 km apart at nadir, in the Science Plan). The array is not represented, so positions are those of its center, and the spacing is not that of IASI-NG's pixels. + - Pixels are projected at the middle time of a scan, whereas IASI-NG samples its fields of regard about 0.82 s apart, so those near the edges of the swath are displaced along track by up to about 35 km. On 2026-11-18, the pixels lay 19.1 km from the centers of the fields of regard (median), as that displacement predicts, beyond the gate's 6 km. Unlike IASI's, the configuration has no yaw fitted to place them where IASI-NG samples them; use the swath configuration, which times each field of regard, for epochs. limitations: - The product does not record the satellite's position, so the fit used positions from an element set of 2026-10-17, two days before the data, whose error enters the fitted angles. - Each field of regard holds 16 pixels in an array of four by four, which is not represented; positions are those of its center. diff --git a/src/tatc/resources/instruments/karin.yml b/src/tatc/resources/instruments/karin.yml index a1547901..561c50f7 100644 --- a/src/tatc/resources/instruments/karin.yml +++ b/src/tatc/resources/instruments/karin.yml @@ -87,6 +87,55 @@ configurations: limitations: - The edges are those of good-quality sea surface heights over the open ocean, which extend from about 7.5 to 61 km from the ground track, beyond the nominal 10 to 60 km. Heights over land, ice, and inland water were not tested. - Images are formed in the plane perpendicular to the Earth-fixed velocity (zero-Doppler geometry), so a user-supplied attitude should keep the Earth-fixed frame. + resolution: + grade: sample_size + description: The 2 km product's samples (L2_LR_SSH Basic) in the left and right swaths (one at a time, by instrument index), whose sizes `compute_sample_sizes` gives, from published values; not compared with reference data. + platforms: [swot] + velocity_frame: earth_fixed + grouping: alternatives + instruments: + - type: pointed + parameters: &resolution_parameters + name: KaRIn left + field_of_regard: 90 + cross_track_field_of_view: 3.4071 + along_track_field_of_view: 1.0 + roll_angle: 2.1883 + is_rectangular: true + range_resolution: 2000 + range_resolution_frame: ground + azimuth_resolution: 2000 + provenance: &resolution_provenance + field_of_regard: + kind: derived + source: Contains the swaths + cross_track_field_of_view: *left + along_track_field_of_view: + kind: placeholder + source: An extent of the view along track, which the resolutions replace + roll_angle: *left + is_rectangular: + kind: derived + source: Models a swath as a rectangular view + range_resolution: &resolution + kind: nominal + source: "SWOT Product Description L2_LR_SSH (JPL D-56407 Rev C), section 3.4.1: \"Measurements in the Basic, WindWave, and Expert files have a spatial resolution of approximately 2 km in both the along-track and cross-track directions\", the half-power width of the point-target response after ground processing (https://www.aviso.altimetry.fr/fileadmin/documents/data/tools/D-56407_SWOT_Product_Description_L2_LR_SSH_20250224a_RevC_clean_sig.pdf)" + range_resolution_frame: + kind: derived + source: The product's resolution is constant on the ground + azimuth_resolution: *resolution + - type: pointed + parameters: + <<: *resolution_parameters + name: KaRIn right + cross_track_field_of_view: 3.4096 + roll_angle: -2.2065 + provenance: + <<: *resolution_provenance + cross_track_field_of_view: *right + roll_angle: *right + limitations: + - The resolution is that of the 2 km product, an approximate published value, so the configuration is nominal. The unsmoothed product has a resolution of about 500 m, and the single-look complex data about 70 m to 10 m across track and 5 m along track. The grid's spacing (2 km) is not modeled. limitations: - The nadir altimeter, which observes the gap between the swaths, is not represented. - SWOT's orbit is maintained on a repeat ground track; for analyses longer than its 20.86-day repeat cycle, propagate the orbit as maintained (`remove_drag=True` with `repeat_cycle="auto"`), as `ValidateSwathSWOT` found. diff --git a/src/tatc/resources/instruments/lsar.yml b/src/tatc/resources/instruments/lsar.yml index 536959f8..c140566e 100644 --- a/src/tatc/resources/instruments/lsar.yml +++ b/src/tatc/resources/instruments/lsar.yml @@ -135,6 +135,66 @@ configurations: - On the held-out days (30 products), 100 of the 101 lattice points observed were predicted (99.01%), the near-range and far-range edges were within 3.1 and 2.1 km (95th percentile), and the epochs within 0.13 s (95th percentile; -0.03 s median), passing every gate tested. - The held-out days were first tested, before element sets of those days were at hand, with the element set of 2026-11-04 (epoch 2026-11-08), 3 to 7 days after them, and the configuration was tested again with element sets of each day after those results, without changing it. With the later element set, 100 of the 101 points were predicted, and the near-range and far-range edges were within 8.9 and 8.8 km (95th percentile), but TAT-C's epochs preceded the zero-Doppler times by 1.14 s (median; 1.28 s at the 95th percentile), failing the timing gate. The difference shrinks as the element set's epoch nears the day (1.2 s on 2026-11-01, 0.35 s on 2026-11-05), as does the element set's position ahead of the products' recorded orbits along track (9.2 km on 2026-11-01, 1.7 km on 2026-11-05, against 0.08 km on the fitting day), so it measures the element set's age more than the view; the edges' distances include the same offset along track. On the fitting day, the edges were within 5.4 and 2.1 km and the epochs within 0.21 s. - Images are formed in the plane perpendicular to the Earth-fixed velocity (zero-Doppler geometry), so a user-supplied attitude should keep the Earth-fixed frame. + resolution: + grade: sample_size + description: The resolution cells of the range-Doppler single-look complex products (RSLC) of each bandwidth (one at a time, by instrument index; 20 MHz by default), in the view of the 20 and 40 MHz swath at its mean roll, whose sizes `compute_sample_sizes` gives, from published values; not compared with reference data. + platforms: [nisar] + velocity_frame: earth_fixed + grouping: alternatives + instrument_index: 1 + instruments: + - type: pointed + parameters: &resolution_parameters + name: L-SAR 5 MHz + field_of_regard: 85.0972 + cross_track_field_of_view: 11.5185 + along_track_field_of_view: 1.0 + roll_angle: 35.2 + is_rectangular: true + range_resolution: 30 + azimuth_resolution: 6 + provenance: &resolution_provenance + field_of_regard: + kind: derived + source: That of the 20 and 40 MHz swath + cross_track_field_of_view: + kind: derived + source: That of the 20 and 40 MHz swath + along_track_field_of_view: + kind: placeholder + source: An extent of the view along track, which the resolutions replace + roll_angle: + kind: derived + source: The mean of the roll angle profile of the 20 and 40 MHz swath, rounded + is_rectangular: + kind: derived + source: Models the swath as a rectangular view + range_resolution: &slant_resolution + kind: nominal + source: "NISAR L1/L2 ATBD (JPL D-95677 Rev A), Table 2.3-1: the RSLC slant range resolution of each bandwidth, 30, 7.5, 3.75, and 1.95 m (https://nisar.asf.earthdatacloud.nasa.gov/NISAR-SAMPLE-DATA/DOCS/NISAR_D-95677_NASA_L1_L2_ATBD_20231112_R3.4_w-sigs.pdf)" + azimuth_resolution: + kind: nominal + source: "NISAR RSLC Product Specification (JPL D-102268 Rev F), section 3.7: \"The RSLC products are all processed to 6 m azimuth resolution.\" (https://cumulus.asf.earthdatacloud.nasa.gov/PUBLIC/DATA/NISAR/NISAR_D-102268_RevF_NASA_SDS_Product_Specification_L1_RSLC_w-esigs.pdf)" + - type: pointed + parameters: + <<: *resolution_parameters + name: L-SAR 20 MHz + range_resolution: 7.5 + provenance: *resolution_provenance + - type: pointed + parameters: + <<: *resolution_parameters + name: L-SAR 40 MHz + range_resolution: 3.75 + provenance: *resolution_provenance + - type: pointed + parameters: + <<: *resolution_parameters + name: L-SAR 77 MHz + range_resolution: 1.95 + provenance: *resolution_provenance + limitations: + - The slant range resolutions are c / (2 B) of the bandwidths, without the broadening of the range window (a Kaiser window of shape 1.6, about 8% at 3 dB), and no resolutions on the ground are published, so the configuration is nominal. The 5 and 77 MHz modes image other swaths (see their configurations), and the spacing of the products' pixels is not modeled. limitations: - The S-band radar (S-SAR) is not represented. - NISAR acquires according to plans, so TAT-C predicts which points it can observe, not which it will. diff --git a/src/tatc/resources/instruments/msi.yml b/src/tatc/resources/instruments/msi.yml index 81536b52..b3ac0175 100644 --- a/src/tatc/resources/instruments/msi.yml +++ b/src/tatc/resources/instruments/msi.yml @@ -74,6 +74,42 @@ configurations: - The lines of detectors are within 0.5 deg of perpendicular to the Earth-fixed velocity, and 3.2 deg from the inertial velocity, so a user-supplied attitude should keep the Earth-fixed frame. - The swath is the strip the view's cross-track line sweeps (is_swept), so it does not depend on the time step. On data held out on 2026-11-10 (38 days from the fit), 99.83 to 99.90% of observed passes were predicted on the three satellites, with the swath width within 0.16 km (median), epochs within 2.6 s (95th percentile), and the swath's intersection over union 0.995 (median; 0.989 at the 5th percentile) at time steps of 10 to 120 s. - Swept swaths were added after the configuration's first holdout, on 2026-08-12, where views tailored to the time step departed from the swath at long time steps; the swath's intersection over union was at least 0.994 at 10 s and 0.992 at 30 s, but 0.949 at 120 s (Sentinel-2A and 2B), failing the standard's 0.95. Rescored with swept swaths, it was 0.995 to 0.997 at every time step, with the other results unchanged; the configuration was then tested on 2026-11-10, a day not used before, which its record holds. + pixels: + grade: sample_size + description: The pixels of the 10 m bands across the swath, whose sizes and spacing `compute_sample_sizes` gives, from published values; not compared with reference data. + platforms: [sentinel-2a, sentinel-2b, sentinel-2c] + velocity_frame: earth_fixed + instruments: + - type: pointed + parameters: + name: MSI + field_of_regard: 21.0066 + cross_track_field_of_view: 20.9636 + along_track_field_of_view: 0.000729 + cross_track_pixels: 28758 + roll_angle: -0.0215 + is_rectangular: true + scan_period: 0.001566 + provenance: + field_of_regard: + kind: derived + source: That of the swath + cross_track_field_of_view: *measured_extent + along_track_field_of_view: + kind: derived + source: "The angle of the 10 m bands' spatial resolution at 786 km, Sentinel-2's mean altitude; SentiWiki, S2 Mission: spatial resolution is \"the at-ground representation of an individual detector\" (https://sentiwiki.copernicus.eu/web/s2-mission)" + cross_track_pixels: + kind: derived + source: The swath's field of view divided by the pixel's angle (12.72 urad), as MSI's 12 overlapping detector modules are not modeled + roll_angle: *measured_extent + is_rectangular: + kind: derived + source: Models a line of a pushbroom as a rectangular view + scan_period: + kind: nominal + source: "The line period of the 10 m bands in the datastrip metadata of Sentinel-2 products (LINE_PERIOD, 1.565873622 ms in S2C_MSIL2A_20261109T235821_R116_T60WWS), which the Sentinel-2 Products Specification Document defines as the \"Line period for the acquisition of line of 10 m full-resolution\"" + limitations: + - The pixel comes from the published spatial resolution at nadir and the line period; no reference data locate MSI's detectors (the products are tiles resampled to a map grid), so the configuration is nominal. The 20 m and 60 m bands' pixels are two and six times as large. limitations: - The ends of acquisitions are ragged, as the modules and bands start and stop at different places, and are left out of the comparisons of swath width and area. - Sentinel-2 acquires according to plans, so TAT-C predicts which points it can observe, not which it will. diff --git a/src/tatc/resources/instruments/mws.yml b/src/tatc/resources/instruments/mws.yml index 6ea81dc2..0b44f53c 100644 --- a/src/tatc/resources/instruments/mws.yml +++ b/src/tatc/resources/instruments/mws.yml @@ -65,6 +65,58 @@ configurations: source: Models a scanned swath as a rectangular view limitations: - TAT-C observes all fields of view of a scan at one instant, whereas MWS sweeps them over part of its 2.25 s scan. The product gives one time per scan, which precedes TAT-C's epochs by about 1.1 s (median), so epochs are tested at the coverage grade only. + beams: + grade: sample_size + description: The 95 fields of view of a scan, with the beam width of each group of channels (23.8 and 31.4 GHz; 50.3 to 57.3 GHz; 89 to 229 GHz), whose footprints and spacing `compute_sample_sizes` gives. Analyze one at a time with its instrument index. + platforms: [metop-sga1] + velocity_frame: earth_fixed + grouping: alternatives + instrument_index: 1 + instruments: + - type: pointed + parameters: &beam_parameters + name: MWS 23.8-31.4 GHz + field_of_regard: 99.67305 + cross_track_field_of_view: 99.67305 + along_track_field_of_view: 1.04919 + cross_track_pixels: 95 + is_rectangular: true + cross_track_oversampling: 0.617084 + along_track_oversampling: 0.617084 + scan_period: 2.254 + provenance: &beam_provenance + field_of_regard: &nominal_spacing + kind: nominal + source: "EPS-SG MWS Science Plan v1.0 (EUMETSAT, 2019), section 3.2.4: \"the angular sampling amounts 1.04919°. Thus, to cover at least ±49°, the number of Earth view pixel per scan is 95\" (https://www-cdn.eumetsat.int/files/2020-04/pdf_science_epssg_mws_plan.pdf)" + cross_track_field_of_view: *nominal_spacing + along_track_field_of_view: *nominal_spacing + cross_track_pixels: *nominal_spacing + is_rectangular: + kind: derived + source: Models a scan line as a rectangular view + cross_track_oversampling: &oversampling + kind: derived + source: "One minus the sampling of 1.04919 deg divided by the group's beam width of the NWP SAF AAPP-SG User Manual (NWPSAF-MO-UD-064 v1.0), section 5.4, Table 16: 2.74 deg (channels 1 and 2), 1.39 deg (3 to 16), and 1.18 deg (17 to 24), \"consistent with the MWS Science Plan and an altitude of 827 km\" (https://nwp-saf.eumetsat.int/site/download/documentation/aapp-sg/NWPSAF-MO-UD-064-AAPP-SG_UserManual.pdf)" + along_track_oversampling: *oversampling + scan_period: + kind: nominal + source: "EPS-SG MWS Science Plan v1.0, section 3.2.4: \"the scan duration is 2.254 seconds\"" + - type: pointed + parameters: + <<: *beam_parameters + name: MWS 50.3-57.3 GHz + cross_track_oversampling: 0.245187 + along_track_oversampling: 0.245187 + provenance: *beam_provenance + - type: pointed + parameters: + <<: *beam_parameters + name: MWS 89-229 GHz + cross_track_oversampling: 0.110856 + along_track_oversampling: 0.110856 + provenance: *beam_provenance + limitations: + - Pixels are projected at the time the product gives for the scan, which precedes TAT-C's epochs by about 1.1 s (median; see the swath), so pixels lie about 7 km along track from where MWS samples them. On 2026-11-18, they lay 7.3 km from the fields of view (median), beyond the gate's 6 km, whereas their sizes agree with the published footprints within 2.2%. No published sampling interval gives the time of each field of view, as AMSU-A's does. limitations: - The product does not record the satellite's position, so the fit used positions from an element set of 2026-10-17, two days before the data, whose error enters the fitted angles. - The Data Store holds the product for about 30 days, so a test can only use recent days. diff --git a/src/tatc/resources/instruments/oci.yml b/src/tatc/resources/instruments/oci.yml index 34087f01..800292ed 100644 --- a/src/tatc/resources/instruments/oci.yml +++ b/src/tatc/resources/instruments/oci.yml @@ -40,7 +40,7 @@ configurations: description: The swath scanned between the outermost samples, tilted aft over the southern part of the sunlit half orbit and forward over the northern part, changing at a latitude scheduled by day, with a view tailored to the analysis time step. Build it with the start and end of the analysis. platforms: [pace] velocity_frame: earth_fixed - tilt_schedule: + tilt_schedule: &tilt_schedule fore_pitch_angle: 19.8555 aft_pitch_angle: -19.8149 odd_day_offset: 5.2097 @@ -107,8 +107,48 @@ configurations: - The scan line is rotated by about 0.1 deg from perpendicular to the Earth-fixed ground track (a fitted yaw), which is not modeled. - The swath width of a pointed instrument follows its field of regard, centered on nadir, which does not describe this tilted view; its width is that between the projections of its edges. - OCI images the sunlit half of each orbit, whereas the view observes whenever a target is in view, unless a solar limit is added. + beams: + grade: sample_size + description: The 1,272 science pixels of a scan, tilted on the schedule of the swath, whose sizes and spacing `compute_sample_sizes` gives. Build it with the start and end of the analysis. + platforms: [pace] + velocity_frame: earth_fixed + tilt_schedule: *tilt_schedule + instruments: + - type: pointed + parameters: + name: OCI + field_of_regard: 120 + cross_track_field_of_view: 113.324091 + along_track_field_of_view: 0.089127 + cross_track_pixels: 1272 + is_rectangular: true + scan_period: 0.175472 + provenance: + field_of_regard: + kind: derived + source: Contains the tilted view, as for the swath + cross_track_field_of_view: + kind: derived + source: "The 1,272 science pixels of a scan (NASA/TM-2024-219027 Vol. 13, Appendix A: \"ccd_pixels = 1272 ; SWIR_pixels = 1272\", https://ntrs.nasa.gov/api/citations/20240007962/downloads/PACE%20Vol%2013_all%20combined.pdf) at the spacing of the swath's measured field of view between the outermost samples (113.235 deg over 1,271 intervals, 0.089091 deg), each pixel as wide as the spacing" + along_track_field_of_view: + kind: nominal + source: "McClain et al. (2022), Frontiers in Remote Sensing 3:938006, Table 1, \"Nadir Resolution\" of 1,050 m, at the table's altitude of 675 km (https://www.frontiersin.org/journals/remote-sensing/articles/10.3389/frsen.2022.938006/full)" + cross_track_pixels: + kind: nominal + source: "NASA/TM-2024-219027 Vol. 13, Appendix A: \"ccd_pixels = 1272 ; SWIR_pixels = 1272\"" + is_rectangular: + kind: derived + source: Models a scan line as a rectangular view + scan_period: + kind: measured + source: The median period between the scans of the product (every sixth scan, divided by six) + platforms: [pace] + period: "2026-10-04" + limitations: + - Only a pixel at nadir is published, and sources differ (1,050 m at 675 km in McClain et al. (2022); 1 km in Werdell et al. (2019) and the calibration and geolocation document; 1.2 km on the PACE website, eoPortal, and WMO OSCAR/Space, which may be the spacing of scans), so the sample size gate is not applied. The pixel of 1,050 m agrees within 0.04% with the measured spacing of samples. + - No pixel size is published for the tilted view; the pixels are those of the untilted view, tilted by 20 deg. + - Pixels are projected at the time of the scan; OCI's rotating telescope sweeps a scan's Earth view in about 0.06 s. limitations: - PACE flies with yaw steering, and the scan is nearly perpendicular to the Earth-fixed ground track, so the configuration uses the Earth-fixed frame. - - No configuration gives sample sizes, as no published instantaneous field of view was used. - The tilt schedule is that of the days tested; it is set by the mission and may change. - The tilt schedule, with its blind intervals, is given to the body, whereas OCI tilts by itself. HARP2's and SPEXone's configurations give PACE's body no attitude, so they are not carried with OCI's; an attitude that replaces theirs would tilt and blind them with OCI. diff --git a/src/tatc/resources/instruments/oco2.yml b/src/tatc/resources/instruments/oco2.yml index 88d66fd9..c5f535d4 100644 --- a/src/tatc/resources/instruments/oco2.yml +++ b/src/tatc/resources/instruments/oco2.yml @@ -105,4 +105,4 @@ limitations: - The validation was changed after a first run on 2026-11-07, without changing the entry. That run scored the swath as for wide scanners, with a global lattice of points 100 km apart and a grid of 0.1 deg, too coarse for a swath of 10 km, and with the swath width of the field of regard, which is set wide to contain the views tailored to time steps (3,178 km); it was replaced by a sample of soundings and segments of the track. - OCO-2 alternates its modes by orbit (most odd orbits in glint mode and even orbits in nadir mode, ValidatePointingOCO2), and points at ground sites in a target mode; each configuration models one mode. An AttitudeSchedule of their attitudes, by orbit, models a schedule of modes. - OCO-2 observes the sunlit part of each orbit, whereas the views observe whenever a target is in view, unless a solar limit is added. - - No configuration gives sample sizes. + - No configuration gives sample sizes. OCO-2 turns its slit with the spacecraft's yaw, which the configurations do not model, so a pixel's dimensions along and across track would be those of a slit across track, and only footprints at nadir are published (about 1.29 km by 2.25 km, in the OCO-2 Data Product User's Guide). diff --git a/src/tatc/resources/instruments/olci.yml b/src/tatc/resources/instruments/olci.yml index cb6420db..bbd1f6a9 100644 --- a/src/tatc/resources/instruments/olci.yml +++ b/src/tatc/resources/instruments/olci.yml @@ -79,3 +79,4 @@ limitations: - Sentinel-3 flies with yaw steering, and the image lines are perpendicular to the Earth-fixed ground track (a fitted yaw of 0.000 deg), so the configuration uses the Earth-fixed frame. - OLCI images the sunlit part of each orbit, whereas the view observes whenever a target is in view, unless a solar limit is added. - The angles were fitted and tested on Sentinel-3A. On Sentinel-3B, recorded as a transfer (2026-11-15, from the tie points of S3B_OL_1_EFR, with an element set of 2026-11-18, the nearest public one), the swath met the gates of the timing grade as on Sentinel-3A (pass recall 99.7%, epochs within 0.13 s at the 95th percentile, IoU 0.990), with a swath width within 10.4 km (9.9 km on Sentinel-3A). Using the configuration on Sentinel-3B warns, as for any platform on which it was not validated. + - No configuration gives sample sizes. The product compared (OL_1_EFR) resamples the five cameras' 3,700 detectors to 4,865 columns, so its tie points do not locate OLCI's pixels, and only the pixel at nadir is published (about 300 m, in the Sentinel-3 User Handbook). diff --git a/src/tatc/resources/instruments/oli.yml b/src/tatc/resources/instruments/oli.yml index c78a5808..acc9a7f1 100644 --- a/src/tatc/resources/instruments/oli.yml +++ b/src/tatc/resources/instruments/oli.yml @@ -71,6 +71,38 @@ configurations: - The view is centered on nadir. The edges of scenes measure 7.51 deg to the left and 7.52 deg to the right, varying by about 0.05 deg with latitude. - OLI's detector modules are staggered along track, which a single view does not represent, so epochs differ from imaging times by about +0.6 s or -1.2 s, depending on the module. Those times are of the red band, for scenes with Level-2 products in a UTM projection. - The ends of scenes are within 0.1 deg of perpendicular to the Earth-fixed velocity, and 2.4 deg from the inertial velocity (median), so a user-supplied attitude should keep the Earth-fixed frame. + pixels: + grade: sample_size + description: The pixels of the 30 m multispectral bands across the swath, whose sizes and spacing `compute_sample_sizes` gives, from published values; not compared with reference data. + platforms: [landsat-9] + velocity_frame: earth_fixed + instruments: + - type: pointed + parameters: + name: OLI + field_of_regard: 15.0275 + cross_track_field_of_view: 15.0275 + along_track_field_of_view: 0.002438 + cross_track_pixels: 6164 + is_rectangular: true + scan_period: 0.004236 + provenance: + field_of_regard: *measured_extent + cross_track_field_of_view: *measured_extent + along_track_field_of_view: &pixel_width + kind: derived + source: "The angle of the multispectral bands' ground sample distance of 30 m at 705 km, the specification of Knight and Kvaran (2014), Remote Sensing 6, 10286, Table 1 (https://doi.org/10.3390/rs61110286), and the altitude of NASA Science, Landsat OLI: \"over an 185 km swath from 705 km altitude\"" + cross_track_pixels: + kind: derived + source: The swath's field of view divided by the pixel's angle (42.55 urad), as OLI's 14 overlapping modules of 494 detectors each (Knight and Kvaran, 2014) are not modeled + is_rectangular: + kind: derived + source: Models a line of a pushbroom as a rectangular view + scan_period: + kind: nominal + source: "USGS, Landsat 8/9 OLI Line-of-Sight Model Creation Algorithm Description Document: \"Nominal OLI frame time nominal_frame_time (4.236 msec)\" (https://edcftp.cr.usgs.gov/project/landsat/L9_ADD/Individual%20ADDs/6.2%20OLI%20Geometry%20Algorithms/6.2.1%20OLI%20Line-of-Sight%20Model%20Creation%20Algorithm.docx)" + limitations: + - The pixel comes from the published ground sample distance, a specification at nadir, and the line period; no reference data locate OLI's detectors (the products are scenes resampled to a map grid), so the configuration is nominal. The panchromatic band's pixels are half the size, with half the line period. limitations: - The fitted angles were measured on Landsat 9. Scenes acquired off nadir on request are left out of every test, and their pointing is not modeled. - On Landsat 8, this configuration is a transfer that warns on use. diff --git a/src/tatc/resources/instruments/omps_nm.yml b/src/tatc/resources/instruments/omps_nm.yml index f656e773..fae78332 100644 --- a/src/tatc/resources/instruments/omps_nm.yml +++ b/src/tatc/resources/instruments/omps_nm.yml @@ -165,6 +165,6 @@ limitations: - The samples do not lie on a line across track. They bow aft toward the swath's edges, from about 0 deg along track near nadir to about 8.5 deg (NOAA-21) and 7.8 deg (NOAA-20) at the edges, about 150 km behind a straight line, which a view cannot represent. On data held out on 2026-11-05, epochs were therefore within 19.9 s (NOAA-21) and 19.1 s (NOAA-20) at the 95th percentile (median -5.6 and -5.1 s), and the swath widths, between the outermost samples, within 7.1 and 5.9 km (median), whereas 99.3% or more of observed passes were predicted and the swath's intersection over union was 0.99 or more (0.98 or more with views tailored to the time step, before swept swaths were added; rescored on the same data). The bow was found on the fitting day, after the fit and before the holdout. - NOAA-20, NOAA-21, and Suomi NPP do not steer their yaw, so the configurations use the inertial frame. - The Nadir Mapper images the sunlit part of each orbit, whereas the view observes whenever a target is in view, unless a solar limit is added. - - No configuration gives sample sizes, as no published instantaneous field of view was used. + - No configuration gives sample sizes. The samples are macropixels of detectors summed on board, of unequal angles across the swath (Seftor et al., 2014), which one angle per view does not give, and only samples at nadir are published (12 km by 10 km on NOAA-21, 50 km by 17 km on NOAA-20, and 50 km by 50 km on Suomi NPP, across by along track, in NOAA's NOAA-21 OMPS Validated maturity review). - Each platform has its own configuration, fitted to its own data; NOAA-20 images fewer, wider samples than NOAA-21, and Suomi NPP fewer and wider still. - The yaw and pitch of the swath_noaa_21, swath_noaa_20, and swath_suomi_npp configurations were given to the body's attitude when tested, and then to the instrument, which gives the same views within 3 cm on the ground, so that the platform's instruments share the body's attitude. The records were rescored on the same held-out data, with swath widths changed by up to 6 m, as they are now measured with the instrument's yaw, and epochs by less than 0.0001 s, and every other result unchanged. diff --git a/src/tatc/resources/instruments/poseidon4.yml b/src/tatc/resources/instruments/poseidon4.yml index a702d5f2..6e8825f7 100644 --- a/src/tatc/resources/instruments/poseidon4.yml +++ b/src/tatc/resources/instruments/poseidon4.yml @@ -71,3 +71,4 @@ limitations: - The measurements' positions are the satellite's nadir, so the track offset tests the element set as much as the view. - The view observes everywhere along the ground track, whereas products omit measurements by surface and quality. - On Sentinel-6B, recorded as a transfer (JASON_CS_S6B_L2_ALT_LR_RED_OST_NRT_G, 2026-11-08, with a public element set), every sampled measurement was within the view at its time, with the track within 0.107 km (median) and epochs within 0.11 s (95th percentile). Using the configuration on Sentinel-6B warns, as for any platform on which it was not validated. + - No configuration gives sample sizes. The footprint of a pulse-limited altimeter depends on the sea state (from about 2 km on a calm sea to about 15 km, Donlon et al., 2021) rather than on a beam width (1.34 deg, whose footprint is about 31 km at 1,336 km), and no footprint of Poseidon-4 is published with its definition. diff --git a/src/tatc/resources/instruments/spexone.yml b/src/tatc/resources/instruments/spexone.yml index 9f1cbd50..bcbccb5e 100644 --- a/src/tatc/resources/instruments/spexone.yml +++ b/src/tatc/resources/instruments/spexone.yml @@ -66,4 +66,4 @@ limitations: - PACE flies with yaw steering, so the configuration uses the Earth-fixed frame. - OCI's configuration gives PACE's body the tilt schedule of OCI, which tilts by itself, so this configuration is not carried with OCI's. - SPEXone images the sunlit part of each orbit, whereas the view observes whenever a target is in view, unless a solar limit is added. - - No configuration gives sample sizes, as no published instantaneous field of view was used. + - No configuration gives sample sizes. No instantaneous field of view is published, and the product compared (Level 1C) bins the samples to a grid of 5.2 km, which does not locate them; the sampling at nadir is published as 2.3 km by 2.7 km (van Amerongen et al.), without an altitude. diff --git a/src/tatc/resources/instruments/ssmis.yml b/src/tatc/resources/instruments/ssmis.yml index d1ab223c..2a1fc22b 100644 --- a/src/tatc/resources/instruments/ssmis.yml +++ b/src/tatc/resources/instruments/ssmis.yml @@ -50,5 +50,5 @@ configurations: - The arc is that of the centers of the S1 samples, about 142 deg of the 144 deg active scan; the other groups of samples (37, 91, and 150 to 183 GHz) were not used to fit it. limitations: - DMSP does not steer its yaw, so the configuration uses the inertial frame, in which the fitted scan center is constant within about 0.01 deg around the orbit. - - No configuration gives sample sizes, as no published beam widths were found, and published footprints conflict (at 19 GHz, 42.4 km by 70.1 km in the GPM product's description, and 74 km by 45 km in the SSMIS user manual's effective field of view). + - No configuration gives sample sizes, as no published beam widths (in degrees) were found. The SSMIS Algorithm and Data User Manual (Northrop Grumman, 2002, Table 3) gives effective fields of view from the measured half-power beam widths at 833 km, at 19 GHz 44.8 km along the scan by 73.6 km perpendicular to it, which is across by along track at the center of the scan (the 74 km by 45 km, along by across track, of the TC PRIMED documentation); the GPM product's description gives 42.4 km by 70.1 km, about 5% smaller, from a source it does not state. Beam widths derived from these footprints would make the comparison with them circular, and the effective field of view of 91 to 183 GHz (13.2 km by 15.5 km) includes the smearing of the 0.8 deg sampling along the scan, which one circular beam width does not give. - The configuration was tested on DMSP F18. SSMIS also flies on DMSP F16 and F17, on which it was not tested. diff --git a/src/tatc/resources/instruments/tropics.yml b/src/tatc/resources/instruments/tropics.yml index 308a9d0b..977c4421 100644 --- a/src/tatc/resources/instruments/tropics.yml +++ b/src/tatc/resources/instruments/tropics.yml @@ -103,6 +103,77 @@ configurations: is_rectangular: kind: derived source: Models a scanned swath as a rectangular view + beams_tropics_03: + grade: sample_size + description: The 81 spots of a scan of TROPICS-03's 118 GHz band, at the roll of its swath, whose footprints and spacing `compute_sample_sizes` gives. + platforms: [tropics-03] + velocity_frame: inertial + instruments: + - type: pointed + parameters: &beam_parameters + name: TROPICS 118 GHz + field_of_regard: 121.5 + cross_track_field_of_view: 121.5 + along_track_field_of_view: 1.5 + cross_track_pixels: 81 + roll_angle: -2.0254 + is_rectangular: true + cross_track_oversampling: 0.427481 + along_track_oversampling: 0.375 + scan_period: 2.0 + provenance: &beam_provenance_03 + field_of_regard: &nominal_sampling + kind: nominal + source: "TROPICS L1 Radiance ATBD (TRPCS-ATBD-034 Rev 2.0, 2021), Table 2: \"Maximum Earth View Sector Angle ... ±60\", \"81 per scan (one at nadir)\", so spots are spaced 1.5 deg (https://ntrs.nasa.gov/api/citations/20210018919/downloads/TRPCS-ATBD-034_L1rad_V2pt0.pdf)" + cross_track_field_of_view: *nominal_sampling + along_track_field_of_view: *nominal_sampling + cross_track_pixels: *nominal_sampling + roll_angle: *measured_03 + is_rectangular: + kind: derived + source: Models a scan line as a rectangular view + cross_track_oversampling: &cross_oversampling + kind: derived + source: "One minus the spot spacing of 1.5 deg divided by the cross-track beam width of the 118 GHz band (F) of the TROPICS L1 Radiance ATBD, Table 1, 2.62 deg (\"2.4/2.62\", down/cross), which includes the smearing of the beam during the 1/120 s integration" + along_track_oversampling: + kind: derived + source: "One minus the spot spacing of 1.5 deg divided by the down-track beam width of the 118 GHz band (F) of the TROPICS L1 Radiance ATBD, Table 1, 2.4 deg" + scan_period: + kind: nominal + source: "TROPICS L1 Radiance ATBD, Table 2: \"Rotation Period ... 2\" s" + limitations: + - &tropics_pixels Pixels are projected at the time of the middle spot of a scan, whereas the radiometer samples its spots over about 0.67 s, and with the roll of the swath, whereas the satellites' pointing varies from scan to scan, so pixels lie a few kilometers from the spots (median), and farther in scans flown reversed. + beams_tropics_05: + grade: sample_size + description: The 81 spots of a scan of TROPICS-05's 118 GHz band, at the roll of its swath, whose footprints and spacing `compute_sample_sizes` gives. + platforms: [tropics-05] + velocity_frame: inertial + instruments: + - type: pointed + parameters: + <<: *beam_parameters + roll_angle: 1.6739 + provenance: + <<: *beam_provenance_03 + roll_angle: *measured_05 + limitations: + - *tropics_pixels + beams_tropics_06: + grade: sample_size + description: The 81 spots of a scan of TROPICS-06's 118 GHz band, at the roll of its swath, whose footprints and spacing `compute_sample_sizes` gives. + platforms: [tropics-06] + velocity_frame: inertial + instruments: + - type: pointed + parameters: + <<: *beam_parameters + roll_angle: -0.1555 + provenance: + <<: *beam_provenance_03 + roll_angle: *measured_06 + limitations: + - *tropics_pixels + - On the held-out day (2024-10-01), the pixels lay 32.5 km from the spots (median), beyond the gate's 6 km, as the product places the satellite about 21 km ahead of every element set of the day (see the swath). They lay 10.3 km from them on 2024-09-20, and 6.0 km on the fitting day (2024-08-15), whereas TROPICS-03's and TROPICS-05's lie about 3.8 km from theirs, so the offset is that of TROPICS-06's product rather than of the configuration, which shares their sampling. limitations: - Each satellite's scan is off center by up to about 2 deg, on a side that differs between satellites, so each has its own configuration. - The satellites' pointing varies from scan to scan, the roll of the scan's edges by about 1.2 deg between the 5th and 95th percentiles, and by about 0.15 deg between days, which moves the edges of the swath by several kilometers, so swath widths differ from the view's by about 6 to 11 km (median), and the configurations are at the coverage grade, as epochs are within about 1.5 s (95th percentile). diff --git a/src/tatc/resources/instruments/tropomi.yml b/src/tatc/resources/instruments/tropomi.yml index c52c96ff..40382ce5 100644 --- a/src/tatc/resources/instruments/tropomi.yml +++ b/src/tatc/resources/instruments/tropomi.yml @@ -217,3 +217,125 @@ configurations: - Swept swaths were added after the configuration's first holdout, on 2026-11-05, where views far from nadir, tailored to a long time step, reached beyond the curved edges of the swath; the swath's intersection over union was 0.998 at 10 s and 0.994 at 30 s, but 0.937 at 120 s, failing the standard's 0.95. Rescored with swept swaths, it was 0.9992 at every time step, with the other results unchanged; the configuration was then tested on 2026-11-10, a day not used before, which its record holds. - TROPOMI's data products cover the sunlit part of each orbit, whereas these views observe whenever a target is in view, unless a solar limit is added. - The views were fitted to the pixels of the ultraviolet and visible bands, and do not represent the 5.5 km by 7 km pixels of the shortwave infrared bands. + pixels: + grade: sample_size + description: The pixels of the ultraviolet and visible bands, 450 across a line, in the parts of the line of the swath's views (one at a time, by instrument index; the part of pixels 128 to 304 by default), whose sizes and spacing `compute_sample_sizes` gives. + platforms: [sentinel-5p] + velocity_frame: earth_fixed + grouping: alternatives + instrument_index: 4 + instruments: + - type: pointed + parameters: &pixel_parameters + name: TROPOMI pixels 0 to 32 + field_of_regard: 120 + cross_track_field_of_view: 5.384 + along_track_field_of_view: 0.382435 + cross_track_pixels: 32 + roll_angle: 51.4378 + pitch_angle: -4.1966 + is_rectangular: true + scan_period: 0.84 + provenance: &pixel_provenance + field_of_regard: *regard + cross_track_field_of_view: + kind: derived + source: That of the part of the swath's view (between the ends of its pixels), without the overlap of 0.04 deg that the swath's views add so that they leave no gaps + along_track_field_of_view: + kind: derived + source: "The angle of the along-track pixel size at 824 km, the satellite's nominal altitude, from the TROPOMI L1b ATBD (S5P-KNMI-L01B-0009-SD, issue 10.0.0), section 13.2: \"the co-addition period can be set to either 1080 ms or 840 ms. This effectively results in a ground pixel size of approximately 7 km or 5.5 km along-track\" (https://sentiwiki.copernicus.eu/__attachments/a_0bcb1fd8d925cfdfd93460756bd49cc77774164053152e79eb1ff90dc299c790/S5P-KNMI-L01B-0009-SD%20-%20Sentinel-5P%20TROPOMI%20ATBD%20Level%2001B%20data%20processor%202022%20-%2010.0.0.pdf)" + cross_track_pixels: + kind: derived + source: The pixels of the part of the line + roll_angle: *fitted + pitch_angle: *fitted + is_rectangular: *rectangular + scan_period: + kind: nominal + source: "TROPOMI L1b ATBD, section 13.2: the co-addition period of 840 ms (since 6 August 2019)" + - type: pointed + parameters: + <<: *pixel_parameters + name: TROPOMI pixels 32 to 48 + cross_track_field_of_view: 4.0814 + cross_track_pixels: 16 + roll_angle: 46.695 + pitch_angle: -3.4414 + provenance: *pixel_provenance + - type: pointed + parameters: + <<: *pixel_parameters + name: TROPOMI pixels 48 to 80 + cross_track_field_of_view: 8.1166 + cross_track_pixels: 32 + roll_angle: 40.5871 + pitch_angle: -2.6026 + provenance: *pixel_provenance + - type: pointed + parameters: + <<: *pixel_parameters + name: TROPOMI pixels 80 to 128 + cross_track_field_of_view: 12.0836 + cross_track_pixels: 48 + roll_angle: 30.481 + pitch_angle: -1.4866 + provenance: *pixel_provenance + - type: pointed + parameters: + <<: *pixel_parameters + name: TROPOMI pixels 128 to 304 + cross_track_field_of_view: 43.9207 + cross_track_pixels: 176 + roll_angle: 2.4757 + pitch_angle: -0.7784 + provenance: *pixel_provenance + - type: pointed + parameters: + <<: *pixel_parameters + name: TROPOMI pixels 304 to 368 + cross_track_field_of_view: 16.0455 + cross_track_pixels: 64 + roll_angle: -27.5081 + pitch_angle: -1.2543 + provenance: *pixel_provenance + - type: pointed + parameters: + <<: *pixel_parameters + name: TROPOMI pixels 368 to 400 + cross_track_field_of_view: 8.083 + cross_track_pixels: 32 + roll_angle: -39.5785 + pitch_angle: -2.4598 + provenance: *pixel_provenance + - type: pointed + parameters: + <<: *pixel_parameters + name: TROPOMI pixels 400 to 416 + cross_track_field_of_view: 4.0622 + cross_track_pixels: 16 + roll_angle: -45.6591 + pitch_angle: -3.276 + provenance: *pixel_provenance + - type: pointed + parameters: + <<: *pixel_parameters + name: TROPOMI pixels 416 to 432 + cross_track_field_of_view: 3.8229 + cross_track_pixels: 16 + roll_angle: -49.6092 + pitch_angle: -3.8835 + provenance: *pixel_provenance + - type: pointed + parameters: + <<: *pixel_parameters + name: TROPOMI pixels 432 to 450 + cross_track_field_of_view: 2.3012 + cross_track_pixels: 18 + roll_angle: -52.6794 + pitch_angle: -4.3812 + provenance: *pixel_provenance + limitations: + - Only the pixel at nadir is published, 5.5 km along by 3.5 km across track (and across track from 3.5 km at nadir to 15 km where the binning of rows changes, without an altitude), so the sample size gate is not applied. + - The pixels of a part of the line share its angle, whereas rows are binned in pairs in the middle of the swath and not at its edges, so the parts of pixels 0 to 32 and 416 to 432, which hold both, give a mean of their pixels. + - The along-track size is that of the satellite's motion over a co-addition period of 840 ms at nadir, given as the pixel's angle. Pixels are compared at the boundaries of every 16th row, the positions the reduced product holds, each the midpoint of its aft corners on a line and the next, as the views were fitted. + - On 2026-11-10, the boundaries lay 7.2 km from the product's (median), beyond the gate's 6 km. Within a part of the line the error is least at its ends and greatest at its middle (2.7 km and 6.3 km at the ends of the part of pixels 128 to 304, 11.7 km at row 224), as each part is a straight view between the ends of a curved line, within 2 s of it (about 14 km along track), and greatest where a part holds both binned and unbinned rows (38 km at row 16). Use the swath configuration for epochs. diff --git a/src/tatc/resources/validation/abi.json b/src/tatc/resources/validation/abi.json index c2021539..2c0d2408 100644 --- a/src/tatc/resources/validation/abi.json +++ b/src/tatc/resources/validation/abi.json @@ -2,15 +2,16 @@ "entry_id": "abi", "configurations": { "full_disk": { - "digest": "0f24250ef8d0f2c98436fe13b243610e5617b920edc31c6c4ea794c3b1326e73", - "standard_version": 1, - "tatc_version": "3.6.0", + "digest": "24161a7680309cc73a692c947966db61105310a9021b648a064cd389fe5be424", + "standard_version": 11, + "tatc_version": "3.7.0", "source": "validation/catalog/validate_catalog_abi.py", "reference": "ABI-L2-ACMF clear sky mask, every 8th pixel", "period": "2026-10-03T12:00Z", "platforms": [ "goes-19" ], + "platform_periods": {}, "metrics": [ { "name": "imaged_pixels_observed", @@ -18,7 +19,7 @@ }, { "name": "elevation_error_max", - "value": 0.00037989186479592263 + "value": 0.00037989186472486836 } ], "transfers": { @@ -38,19 +39,20 @@ }, "fixture_metrics": { "imaged_pixels_observed": 100.0, - "elevation_error_max": 0.00037431447341873536 + "elevation_error_max": 0.0003743144734329462 } }, "sst_good_quality": { - "digest": "61f9d59e6d03c56b386b70e62a6f025e9f21eacfcd6bec545120e5d067823023", - "standard_version": 1, - "tatc_version": "3.6.0", + "digest": "748354c2ce29dc281316954b6707255e4460bc98471315c163dab317e46913ef", + "standard_version": 11, + "tatc_version": "3.7.0", "source": "validation/catalog/validate_catalog_abi.py", "reference": "ABI-L2-SSTF SST and quality flags", "period": "2026-10-03T12:00Z", "platforms": [ "goes-19" ], + "platform_periods": {}, "metrics": [ { "name": "product_limit", @@ -81,15 +83,16 @@ } }, "lst_good_quality": { - "digest": "3c44900855e1fb4542e9f2948171c27c9cec3723ff52a082ecc9d919bf13ffb9", - "standard_version": 1, - "tatc_version": "3.6.0", + "digest": "d5ae3d7caea6bbbabab4317e47c6e363a016ae69e5c7fe4b75041eff9feef08b", + "standard_version": 11, + "tatc_version": "3.7.0", "source": "validation/catalog/validate_catalog_abi.py", "reference": "ABI-L2-LSTF LST and quality flags", "period": "2026-10-03T12:00Z", "platforms": [ "goes-19" ], + "platform_periods": {}, "metrics": [ { "name": "product_limit", @@ -116,7 +119,48 @@ } }, "fixture_metrics": { - "product_limit": 0.2588730783312698 + "product_limit": 0.2588730783312627 + } + }, + "pixels": { + "digest": "74b526ef4291df066bd96ab7446ca3152b11f988b708139b745a65a4e3e0e7dc", + "standard_version": 11, + "tatc_version": "3.7.0", + "source": "validation/catalog/validate_catalog_abi.py", + "reference": "Nadir resolution of the GOES-R Product Definition and Users' Guide (not gated); fixed grid of ABI-L2-ACMF (2 km)", + "period": "2026-10-03T12:00Z", + "platforms": [ + "goes-19" + ], + "platform_periods": {}, + "metrics": [ + { + "name": "sample_size_largest_error", + "value": 0.1793600330402878 + }, + { + "name": "pixel_position_median", + "value": 0.4250532609992156 + }, + { + "name": "pixel_position_p95", + "value": 0.6170758844133434 + }, + { + "name": "spacing_along_ratio_median", + "value": 1.0000421737353764 + }, + { + "name": "spacing_cross_ratio_median", + "value": 1.000040383826304 + } + ], + "transfers": {}, + "fixture_metrics": { + "sample_size_largest_error": 0.1793600330402878, + "pixel_position_median": 0.4114651032161978, + "spacing_along_ratio_median": 1.0000482436052662, + "spacing_cross_ratio_median": 1.0000436786711198 } } } diff --git a/src/tatc/resources/validation/ahi.json b/src/tatc/resources/validation/ahi.json index 59af9048..e1391eb4 100644 --- a/src/tatc/resources/validation/ahi.json +++ b/src/tatc/resources/validation/ahi.json @@ -2,15 +2,16 @@ "entry_id": "ahi", "configurations": { "full_disk": { - "digest": "5d2ecc67bdbb68e12af30c19e66df0aaa5fcf3e4ff2b13907a799b4f1aeea633", - "standard_version": 2, - "tatc_version": "3.6.0", + "digest": "19014f7e41355f5437677195c21b8f8fea8936ebbe9eaa304da4ee0f9c99b1d7", + "standard_version": 11, + "tatc_version": "3.7.0", "source": "validation/catalog/validate_catalog_ahi.py", "reference": "AHI-CMSK cloud mask, every 8th pixel", "period": "2026-11-08T12:00Z", "platforms": [ "himawari-9" ], + "platform_periods": {}, "metrics": [ { "name": "imaged_pixels_observed", @@ -28,15 +29,16 @@ } }, "cloud_top_height": { - "digest": "c8a8fcb28e64996bea02ea074e53c4519119687b7252385dd2a7eac09dffaff9", - "standard_version": 2, - "tatc_version": "3.6.0", + "digest": "05df7f70898a281fa00d84a2679cf3d52b0087a2b70d2dfd0d37f97e44225ddb", + "standard_version": 11, + "tatc_version": "3.7.0", "source": "validation/catalog/validate_catalog_ahi.py", "reference": "AHI-CHGT cloud top height, the greatest local zenith angle at which it is retrieved", "period": "2026-11-08T12:00Z", "platforms": [ "himawari-9" ], + "platform_periods": {}, "metrics": [ { "name": "product_limit", @@ -51,6 +53,47 @@ "fixture_metrics": { "product_limit": 0.4968281089902149 } + }, + "pixels": { + "digest": "1e2ec3c791b7c72b7043e6a863593e1a19d82e768b07586dbd6f4696112bbb3f", + "standard_version": 11, + "tatc_version": "3.7.0", + "source": "validation/catalog/validate_catalog_ahi.py", + "reference": "Resolution at the sub-satellite point of JMA's Himawari Standard Data User's Guide (not gated); pixel positions of AHI-L2-FLDK-Clouds (2 km)", + "period": "2026-11-08T12:00Z", + "platforms": [ + "himawari-9" + ], + "platform_periods": {}, + "metrics": [ + { + "name": "sample_size_largest_error", + "value": 0.021460753665958343 + }, + { + "name": "pixel_position_median", + "value": 0.5080290601384081 + }, + { + "name": "pixel_position_p95", + "value": 0.7774292155993041 + }, + { + "name": "spacing_along_ratio_median", + "value": 1.0000131780639743 + }, + { + "name": "spacing_cross_ratio_median", + "value": 1.0000186836344453 + } + ], + "transfers": {}, + "fixture_metrics": { + "sample_size_largest_error": 0.021460753665958343, + "pixel_position_median": 0.5099502896334314, + "spacing_along_ratio_median": 1.000008015198937, + "spacing_cross_ratio_median": 1.0000171562831102 + } } } } diff --git a/src/tatc/resources/validation/atlid.json b/src/tatc/resources/validation/atlid.json index e4018c62..cc3e8d3e 100644 --- a/src/tatc/resources/validation/atlid.json +++ b/src/tatc/resources/validation/atlid.json @@ -11,6 +11,7 @@ "platforms": [ "earthcare" ], + "platform_periods": {}, "metrics": [ { "name": "segment_recall", @@ -34,6 +35,37 @@ "passes_found": 100.0, "epoch_p95": 0.4253327837999999 } + }, + "footprints": { + "digest": "a68aebe2fbb8a2fbae86c0e00ce7aec0c563af686124b92e30c5906b7dacaf3a", + "standard_version": 9, + "tatc_version": "3.7.0", + "source": "validation/catalog/validate_catalog_atlid.py", + "reference": "Laser footprint of ESA's ATLID page (not gated); profile spacing of ATL_NOM_1B", + "period": "2026-11-07", + "platforms": [ + "earthcare" + ], + "platform_periods": {}, + "metrics": [ + { + "name": "sample_size_largest_error", + "value": 6.041753049088849 + }, + { + "name": "spacing_along_ratio_median", + "value": 0.9999955889642215 + }, + { + "name": "spacing_along_error", + "value": 0.0004411035778528749 + } + ], + "transfers": {}, + "fixture_metrics": { + "sample_size_largest_error": 6.041753049088849, + "spacing_along_ratio_median": 0.9999695801039715 + } } } } diff --git a/src/tatc/resources/validation/bbr.json b/src/tatc/resources/validation/bbr.json index b0227a27..e0bb2f1d 100644 --- a/src/tatc/resources/validation/bbr.json +++ b/src/tatc/resources/validation/bbr.json @@ -11,6 +11,7 @@ "platforms": [ "earthcare" ], + "platform_periods": {}, "metrics": [ { "name": "pass_recall", @@ -93,6 +94,51 @@ "passes_found": 96.66666666666667, "epoch_p95": 0.501839136 } + }, + "pixels": { + "digest": "2aa30f345e5c4dcaa62e26dd46cc06dd336ac7f6919820145223a4a5cc891c0d", + "standard_version": 8, + "tatc_version": "3.7.0", + "source": "validation/catalog/validate_catalog_bbr.py", + "reference": "Footprints of Wehr et al. (2023); pixel positions of the nadir view of BBR_SNG_1B (shortwave band, every 2nd line)", + "period": "2026-11-07", + "platforms": [ + "earthcare" + ], + "platform_periods": {}, + "metrics": [ + { + "name": "sample_size_within_3pct", + "value": 66.66666666666666 + }, + { + "name": "sample_size_largest_error", + "value": 4.0116967675258515 + }, + { + "name": "pixel_position_median", + "value": 1.6740847736970177 + }, + { + "name": "pixel_position_p95", + "value": 3.5347177416904905 + }, + { + "name": "spacing_along_ratio_median", + "value": 1.00000773234611 + }, + { + "name": "spacing_cross_ratio_median", + "value": 0.9986644064148917 + } + ], + "transfers": {}, + "fixture_metrics": { + "sample_size_within_3pct": 66.66666666666666, + "pixel_position_median": 1.6080865658081889, + "spacing_along_ratio_median": 1.0000372291643378, + "spacing_cross_ratio_median": 0.9980530702984778 + } } } } diff --git a/src/tatc/resources/validation/ceres.json b/src/tatc/resources/validation/ceres.json index 56769f94..ea7cad6f 100644 --- a/src/tatc/resources/validation/ceres.json +++ b/src/tatc/resources/validation/ceres.json @@ -11,6 +11,7 @@ "platforms": [ "noaa-20" ], + "platform_periods": {}, "metrics": [ { "name": "pass_recall", @@ -49,6 +50,7 @@ "platforms": [ "suomi-npp" ], + "platform_periods": {}, "metrics": [ { "name": "pass_recall", @@ -76,6 +78,88 @@ "passes_found": 100.0, "epoch_p95": 1.49206610005 } + }, + "beams_noaa_20": { + "digest": "e20b2865d5de50f7fdb511e369d4bc27fa44f6b167fb4564161925cd63b80fff", + "standard_version": 7, + "tatc_version": "3.7.0", + "source": "validation/catalog/validate_catalog_ceres.py", + "reference": "Nadir footprints of the CERES ATBD Subsystem 4.4 (not gated); footprint positions of CER_ES8_NOAA20-FM6 Edition1, projected to the ellipsoid", + "period": "2026-09-30", + "platforms": [ + "noaa-20" + ], + "platform_periods": {}, + "metrics": [ + { + "name": "sample_size_largest_error", + "value": 3.1581040630849544 + }, + { + "name": "pixel_position_median", + "value": 3.638317939953682 + }, + { + "name": "pixel_position_p95", + "value": 10.742465509915183 + }, + { + "name": "spacing_along_ratio_median", + "value": 0.9999977309029106 + }, + { + "name": "spacing_cross_ratio_median", + "value": 0.9993548231111012 + } + ], + "transfers": {}, + "fixture_metrics": { + "sample_size_largest_error": 3.1581040630849544, + "pixel_position_median": 3.269678542949759, + "spacing_along_ratio_median": 1.0000291049196477, + "spacing_cross_ratio_median": 0.9992347442272006 + } + }, + "beams_suomi_npp": { + "digest": "e16c046b99033bb11824a041e3cb043251a5a3ec2165d8d490f2fd9d3139945d", + "standard_version": 7, + "tatc_version": "3.7.0", + "source": "validation/catalog/validate_catalog_ceres.py", + "reference": "Nadir footprints of the CERES ATBD Subsystem 4.4 (not gated); footprint positions of CER_ES8_NPP-FM5 Edition2, projected to the ellipsoid", + "period": "2026-06-20", + "platforms": [ + "suomi-npp" + ], + "platform_periods": {}, + "metrics": [ + { + "name": "sample_size_largest_error", + "value": 3.158104055357236 + }, + { + "name": "pixel_position_median", + "value": 0.7076326248532098 + }, + { + "name": "pixel_position_p95", + "value": 1.9449136157803466 + }, + { + "name": "spacing_along_ratio_median", + "value": 0.9999907010709674 + }, + { + "name": "spacing_cross_ratio_median", + "value": 0.9993475699591785 + } + ], + "transfers": {}, + "fixture_metrics": { + "sample_size_largest_error": 3.158104055357236, + "pixel_position_median": 0.6971362294855971, + "spacing_along_ratio_median": 0.9999602084838413, + "spacing_cross_ratio_median": 0.999402428910771 + } } } } diff --git a/src/tatc/resources/validation/cpr.json b/src/tatc/resources/validation/cpr.json index 0545a9c4..6a59be16 100644 --- a/src/tatc/resources/validation/cpr.json +++ b/src/tatc/resources/validation/cpr.json @@ -11,6 +11,7 @@ "platforms": [ "earthcare" ], + "platform_periods": {}, "metrics": [ { "name": "segment_recall", @@ -34,6 +35,37 @@ "passes_found": 100.0, "epoch_p95": 0.4574536675499999 } + }, + "footprints": { + "digest": "404afb598b7fb35010c1f6fe946f61eea0b5d8d28e94022f6668140309b7ae5c", + "standard_version": 9, + "tatc_version": "3.7.0", + "source": "validation/catalog/validate_catalog_cpr.py", + "reference": "Footprint on eoPortal (not gated); profile spacing of CPR_NOM_1B", + "period": "2026-11-07", + "platforms": [ + "earthcare" + ], + "platform_periods": {}, + "metrics": [ + { + "name": "sample_size_largest_error", + "value": 35.07594502414527 + }, + { + "name": "spacing_along_ratio_median", + "value": 1.0155191328999873 + }, + { + "name": "spacing_along_error", + "value": 1.5519132899987298 + } + ], + "transfers": {}, + "fixture_metrics": { + "sample_size_largest_error": 35.07594502414527, + "spacing_along_ratio_median": 1.015327948330955 + } } } } diff --git a/src/tatc/resources/validation/csar.json b/src/tatc/resources/validation/csar.json index e6708f3a..a7df0e35 100644 --- a/src/tatc/resources/validation/csar.json +++ b/src/tatc/resources/validation/csar.json @@ -11,6 +11,7 @@ "platforms": [ "sentinel-1c" ], + "platform_periods": {}, "metrics": [ { "name": "pass_recall", @@ -131,6 +132,7 @@ "platforms": [ "sentinel-1c" ], + "platform_periods": {}, "metrics": [ { "name": "pass_recall", @@ -240,6 +242,30 @@ "passes_found": 100.0, "epoch_p95": 0.32735908755 } + }, + "resolution_iw": { + "digest": "33721fa2a82ba8de326988612c240b5755f8890262d3bdae5519820734eb7359", + "standard_version": 11, + "tatc_version": "3.7.0", + "source": "validation/catalog/validate_catalog_csar.py", + "reference": "Resolutions of the Sentinel-1 Product Definition (S1-RS-MDA-52-7440 v2.13), Table 7-6 (IW GRDH)", + "period": "2026-08-12", + "platforms": [ + "sentinel-1c" + ], + "platform_periods": {}, + "metrics": [ + { + "name": "sample_size_within_3pct", + "value": 100.0 + }, + { + "name": "sample_size_largest_error", + "value": 0.3770729450936816 + } + ], + "transfers": {}, + "fixture_metrics": {} } } } diff --git a/src/tatc/resources/validation/ecostress.json b/src/tatc/resources/validation/ecostress.json index c37426af..004d9367 100644 --- a/src/tatc/resources/validation/ecostress.json +++ b/src/tatc/resources/validation/ecostress.json @@ -11,6 +11,7 @@ "platforms": [ "iss" ], + "platform_periods": {}, "metrics": [ { "name": "pass_recall", @@ -38,6 +39,47 @@ "passes_found": 100.0, "epoch_p95": 0.7579137259 } + }, + "beams": { + "digest": "252084a63d2050a377608d809fb626cd9a900ce505acf04811c96811dee90d7c", + "standard_version": 11, + "tatc_version": "3.7.0", + "source": "validation/catalog/validate_catalog_ecostress.py", + "reference": "Nadir pixel of the ECOSTRESS L1 Calibration ATBD (not gated); sample positions of ECO_L1B_GEO version 002 (the middle line of every fourth sweep)", + "period": "2026-11-08", + "platforms": [ + "iss" + ], + "platform_periods": {}, + "metrics": [ + { + "name": "sample_size_largest_error", + "value": 0.552059244258507 + }, + { + "name": "pixel_position_median", + "value": 4.1096972737271615 + }, + { + "name": "pixel_position_p95", + "value": 6.049062878837322 + }, + { + "name": "spacing_along_ratio_median", + "value": 1.3145117206003623 + }, + { + "name": "spacing_cross_ratio_median", + "value": 0.9986989330565286 + } + ], + "transfers": {}, + "fixture_metrics": { + "sample_size_largest_error": 0.552059244258507, + "pixel_position_median": 3.4825955098499994, + "spacing_along_ratio_median": 1.307362394170645, + "spacing_cross_ratio_median": 0.9986498585361929 + } } } } diff --git a/src/tatc/resources/validation/emit.json b/src/tatc/resources/validation/emit.json index 480d9020..c1f8fa04 100644 --- a/src/tatc/resources/validation/emit.json +++ b/src/tatc/resources/validation/emit.json @@ -11,6 +11,7 @@ "platforms": [ "iss" ], + "platform_periods": {}, "metrics": [ { "name": "pass_recall", @@ -38,6 +39,47 @@ "passes_found": 93.33333333333333, "epoch_p95": 0.23672306925 } + }, + "pixels": { + "digest": "387e2a11b71b525c3d3287b870eb37aca841b609a7148ef1a92558bba8b41f06", + "standard_version": 11, + "tatc_version": "3.7.0", + "source": "validation/catalog/validate_catalog_emit.py", + "reference": "Nadir pixel of the EMIT L1B ATBD (not gated); pixel positions of EMITL1BRAD version 002 (every 16th line and 25th pixel)", + "period": "2026-11-08", + "platforms": [ + "iss" + ], + "platform_periods": {}, + "metrics": [ + { + "name": "sample_size_largest_error", + "value": 1.0801925164567017 + }, + { + "name": "pixel_position_median", + "value": 2.8267500039695093 + }, + { + "name": "pixel_position_p95", + "value": 3.59465455668525 + }, + { + "name": "spacing_along_ratio_median", + "value": 1.001297736571526 + }, + { + "name": "spacing_cross_ratio_median", + "value": 0.997515207380707 + } + ], + "transfers": {}, + "fixture_metrics": { + "sample_size_largest_error": 1.0801925164567017, + "pixel_position_median": 2.766455346186717, + "spacing_along_ratio_median": 1.0013537053499348, + "spacing_cross_ratio_median": 0.9975618271949933 + } } } } diff --git a/src/tatc/resources/validation/fci.json b/src/tatc/resources/validation/fci.json index 2a05b7b7..95f8a1c1 100644 --- a/src/tatc/resources/validation/fci.json +++ b/src/tatc/resources/validation/fci.json @@ -2,15 +2,16 @@ "entry_id": "fci", "configurations": { "full_disk": { - "digest": "c3855ff11b67c06cf28fa3fe9666b5c90b68bdb905fba68c1b11fa38361d476f", - "standard_version": 7, - "tatc_version": "3.6.0", + "digest": "c79968a489a781ae5164b5d9c42e23d480822e1937085268906dcb4c67e80681", + "standard_version": 11, + "tatc_version": "3.7.0", "source": "validation/catalog/validate_catalog_fci.py", "reference": "FCI Level 2 cloud mask (EO:EUM:DAT:0678), every 8th pixel", "period": "2026-11-17T12:00Z", "platforms": [ "meteosat-12" ], + "platform_periods": {}, "metrics": [ { "name": "imaged_pixels_observed", @@ -28,15 +29,16 @@ } }, "lst_retrieved": { - "digest": "a346c57d4c0d89511d90a5b814187b2f8bc7914817a1dedee06af72d561aafe5", - "standard_version": 7, - "tatc_version": "3.6.0", + "digest": "560f1daefa1c062f523a563dd86edef9b8ddf549ab423b43a5e8251877ba06d9", + "standard_version": 11, + "tatc_version": "3.7.0", "source": "validation/catalog/validate_catalog_fci.py", "reference": "LSA SAF land surface temperature (EO:EUM:DAT:1088)", "period": "2026-11-17T12:00Z", "platforms": [ "meteosat-12" ], + "platform_periods": {}, "metrics": [ { "name": "product_limit", @@ -53,15 +55,16 @@ } }, "sst_acceptable_quality": { - "digest": "ad1159214f1c200fa680225df5d48b3e8585ae6429db43e47576d0a3378feb6d", - "standard_version": 7, - "tatc_version": "3.6.0", + "digest": "77e427587871f3916457a07f406a0a9fc3c4e411ceea62dd82d0e9044adc6065", + "standard_version": 11, + "tatc_version": "3.7.0", "source": "validation/catalog/validate_catalog_fci.py", "reference": "OSI SAF Level 3C sea surface temperature (EO:EUM:DAT:0694), quality levels 4 and 5", "period": "2026-11-17T12:00Z", "platforms": [ "meteosat-12" ], + "platform_periods": {}, "metrics": [ { "name": "product_limit", @@ -76,6 +79,47 @@ "fixture_metrics": { "product_limit": 0.3142486532976392 } + }, + "pixels": { + "digest": "a4091a221167ef785470e69181a7dee3c99d35ef17955ff1da83a8c240c9cde3", + "standard_version": 11, + "tatc_version": "3.7.0", + "source": "validation/catalog/validate_catalog_fci.py", + "reference": "Spatial sampling distance of the MTG End User Requirements Document (not gated); fixed grid of the FCI Level 2 cloud mask (EO:EUM:DAT:0678, 2 km)", + "period": "2026-11-17T12:00Z", + "platforms": [ + "meteosat-12" + ], + "platform_periods": {}, + "metrics": [ + { + "name": "sample_size_largest_error", + "value": 0.021456954965970443 + }, + { + "name": "pixel_position_median", + "value": 0.9213393404191644 + }, + { + "name": "pixel_position_p95", + "value": 1.319845846147553 + }, + { + "name": "spacing_along_ratio_median", + "value": 1.000003610073022 + }, + { + "name": "spacing_cross_ratio_median", + "value": 1.0000021264025318 + } + ], + "transfers": {}, + "fixture_metrics": { + "sample_size_largest_error": 0.021456954965970443, + "pixel_position_median": 0.8809493787086996, + "spacing_along_ratio_median": 0.9999963758064568, + "spacing_cross_ratio_median": 1.0000095622835847 + } } } } diff --git a/src/tatc/resources/validation/gedi.json b/src/tatc/resources/validation/gedi.json index 52c9242b..7ab2e719 100644 --- a/src/tatc/resources/validation/gedi.json +++ b/src/tatc/resources/validation/gedi.json @@ -11,6 +11,7 @@ "platforms": [ "iss" ], + "platform_periods": {}, "metrics": [ { "name": "segment_recall", @@ -67,6 +68,37 @@ "passes_found": 100.0, "epoch_p95": 1.5583851070999999 } + }, + "footprints": { + "digest": "8b78691c4ab8ee62ff0e65599bb06a89111f21865666ab8fdcf4bc485ab9ad0b", + "standard_version": 9, + "tatc_version": "3.7.0", + "source": "validation/catalog/validate_catalog_gedi.py", + "reference": "Footprint of Dubayah et al. (2020) (not gated); shot spacing of GEDI01_B version 003 (every 200th shot of each beam)", + "period": "2026-06-08", + "platforms": [ + "iss" + ], + "platform_periods": {}, + "metrics": [ + { + "name": "sample_size_largest_error", + "value": 1.388391001280631 + }, + { + "name": "spacing_along_ratio_median", + "value": 0.9917778510294765 + }, + { + "name": "spacing_along_error", + "value": 0.8222148970523535 + } + ], + "transfers": {}, + "fixture_metrics": { + "sample_size_largest_error": 1.388391001280631, + "spacing_along_ratio_median": 0.9909130924202582 + } } } } diff --git a/src/tatc/resources/validation/iasi_ng.json b/src/tatc/resources/validation/iasi_ng.json index fe062a08..e4fae333 100644 --- a/src/tatc/resources/validation/iasi_ng.json +++ b/src/tatc/resources/validation/iasi_ng.json @@ -11,6 +11,7 @@ "platforms": [ "metop-sga1" ], + "platform_periods": {}, "metrics": [ { "name": "pass_recall", @@ -38,6 +39,47 @@ "passes_found": 100.0, "epoch_p95": 0.44443466504999996 } + }, + "fields_of_regard": { + "digest": "79d576827ece65a1f812bc68526bacecf8dbdca93e3540b6e184d1dfd7476f37", + "standard_version": 7, + "tatc_version": "3.7.0", + "source": "validation/catalog/validate_catalog_iasi_ng.py", + "reference": "Nadir pixel of the IASI-NG Science Plan (not gated); centers of the fields of regard of the IASI-NG Level 1c (EO:EUM:DAT:0892, BUFR), first 3.5 hours of the day", + "period": "2026-11-18", + "platforms": [ + "metop-sga1" + ], + "platform_periods": {}, + "metrics": [ + { + "name": "sample_size_largest_error", + "value": 0.29643057690464936 + }, + { + "name": "pixel_position_median", + "value": 19.0699770642984 + }, + { + "name": "pixel_position_p95", + "value": 37.08649649769933 + }, + { + "name": "spacing_along_ratio_median", + "value": 1.0000311909463666 + }, + { + "name": "spacing_cross_ratio_median", + "value": 0.9918280762246459 + } + ], + "transfers": {}, + "fixture_metrics": { + "sample_size_largest_error": 0.29643057690464936, + "pixel_position_median": 19.058824450552123, + "spacing_along_ratio_median": 1.0002864900056312, + "spacing_cross_ratio_median": 0.9905847328746542 + } } } } diff --git a/src/tatc/resources/validation/mws.json b/src/tatc/resources/validation/mws.json index e41d3f18..ee53304a 100644 --- a/src/tatc/resources/validation/mws.json +++ b/src/tatc/resources/validation/mws.json @@ -11,6 +11,7 @@ "platforms": [ "metop-sga1" ], + "platform_periods": {}, "metrics": [ { "name": "pass_recall", @@ -38,6 +39,51 @@ "passes_found": 100.0, "epoch_p95": 1.6819902477 } + }, + "beams": { + "digest": "6f86d4ef389241756ce4d9281cbd4472b563036273f847f2c4f03b65b4607345", + "standard_version": 7, + "tatc_version": "3.7.0", + "source": "validation/catalog/validate_catalog_mws.py", + "reference": "Footprints of the EPS-SG MWS Science Plan; positions of the fields of view of the MWS Level 1b (EO:EUM:DAT:0892, BUFR)", + "period": "2026-11-18", + "platforms": [ + "metop-sga1" + ], + "platform_periods": {}, + "metrics": [ + { + "name": "sample_size_within_3pct", + "value": 100.0 + }, + { + "name": "sample_size_largest_error", + "value": 2.1396204070691205 + }, + { + "name": "pixel_position_median", + "value": 7.325444557587326 + }, + { + "name": "pixel_position_p95", + "value": 11.211064072057994 + }, + { + "name": "spacing_along_ratio_median", + "value": 0.9998913352490355 + }, + { + "name": "spacing_cross_ratio_median", + "value": 0.9999457290440549 + } + ], + "transfers": {}, + "fixture_metrics": { + "sample_size_within_3pct": 100.0, + "pixel_position_median": 7.275049081836256, + "spacing_along_ratio_median": 1.0000336290193765, + "spacing_cross_ratio_median": 0.9999328196337314 + } } } } diff --git a/src/tatc/resources/validation/oci.json b/src/tatc/resources/validation/oci.json index 00b138f9..c1151c07 100644 --- a/src/tatc/resources/validation/oci.json +++ b/src/tatc/resources/validation/oci.json @@ -11,6 +11,7 @@ "platforms": [ "pace" ], + "platform_periods": {}, "metrics": [ { "name": "pass_recall", @@ -38,6 +39,47 @@ "passes_found": 100.0, "epoch_p95": 0.44427739664999993 } + }, + "beams": { + "digest": "b1f3212853b254e9638dc62bfd14235d18b2a5d01bb668998d68ab532fee27ee", + "standard_version": 7, + "tatc_version": "3.7.0", + "source": "validation/catalog/validate_catalog_oci.py", + "reference": "Nadir pixel of McClain et al. (2022) (not gated); sample positions of PACE_OCI_L1B_SCI version 3", + "period": "2026-11-10", + "platforms": [ + "pace" + ], + "platform_periods": {}, + "metrics": [ + { + "name": "sample_size_largest_error", + "value": 0.36023574329501207 + }, + { + "name": "pixel_position_median", + "value": 1.16371513978231 + }, + { + "name": "pixel_position_p95", + "value": 3.6185494640853086 + }, + { + "name": "spacing_along_ratio_median", + "value": 0.9998765480813098 + }, + { + "name": "spacing_cross_ratio_median", + "value": 0.9996629541754368 + } + ], + "transfers": {}, + "fixture_metrics": { + "sample_size_largest_error": 0.36023574329501207, + "pixel_position_median": 1.1674098010688772, + "spacing_along_ratio_median": 0.9999346833601925, + "spacing_cross_ratio_median": 0.9996759839880193 + } } } } diff --git a/src/tatc/resources/validation/tropics.json b/src/tatc/resources/validation/tropics.json index 8161d4e2..5b4a9597 100644 --- a/src/tatc/resources/validation/tropics.json +++ b/src/tatc/resources/validation/tropics.json @@ -11,6 +11,7 @@ "platforms": [ "tropics-03" ], + "platform_periods": {}, "metrics": [ { "name": "pass_recall", @@ -49,6 +50,7 @@ "platforms": [ "tropics-05" ], + "platform_periods": {}, "metrics": [ { "name": "pass_recall", @@ -87,6 +89,7 @@ "platforms": [ "tropics-06" ], + "platform_periods": {}, "metrics": [ { "name": "pass_recall", @@ -114,6 +117,141 @@ "passes_found": 96.66666666666667, "epoch_p95": 5.577971716599999 } + }, + "beams_tropics_03": { + "digest": "05676755fae66e2a912484884263bd55809e38054c2762e10eccb1fe1507212a", + "standard_version": 7, + "tatc_version": "3.7.0", + "source": "validation/catalog/validate_catalog_tropics.py", + "reference": "Footprints of the TROPICS L1 Radiance ATBD; 118 GHz spot positions of TROPICS03BRTTL1B", + "period": "2024-10-01", + "platforms": [ + "tropics-03" + ], + "platform_periods": {}, + "metrics": [ + { + "name": "sample_size_within_3pct", + "value": 100.0 + }, + { + "name": "sample_size_largest_error", + "value": 2.783915445918317 + }, + { + "name": "pixel_position_median", + "value": 3.8440132855100035 + }, + { + "name": "pixel_position_p95", + "value": 57.424850778871196 + }, + { + "name": "spacing_along_ratio_median", + "value": 0.9996062953193684 + }, + { + "name": "spacing_cross_ratio_median", + "value": 0.999469121022495 + } + ], + "transfers": {}, + "fixture_metrics": { + "sample_size_within_3pct": 100.0, + "pixel_position_median": 3.8942027506251193, + "spacing_along_ratio_median": 0.9998170408033995, + "spacing_cross_ratio_median": 0.9994237362880252 + } + }, + "beams_tropics_05": { + "digest": "fd094321bb541c372a7d82e5b12e69343c1edc139afa68d19c41980df4369193", + "standard_version": 7, + "tatc_version": "3.7.0", + "source": "validation/catalog/validate_catalog_tropics.py", + "reference": "Footprints of the TROPICS L1 Radiance ATBD; 118 GHz spot positions of TROPICS05BRTTL1B", + "period": "2024-10-01", + "platforms": [ + "tropics-05" + ], + "platform_periods": {}, + "metrics": [ + { + "name": "sample_size_within_3pct", + "value": 100.0 + }, + { + "name": "sample_size_largest_error", + "value": 2.783915445918317 + }, + { + "name": "pixel_position_median", + "value": 3.655187252848595 + }, + { + "name": "pixel_position_p95", + "value": 19.599298403371325 + }, + { + "name": "spacing_along_ratio_median", + "value": 0.9984938215595427 + }, + { + "name": "spacing_cross_ratio_median", + "value": 0.999760565408847 + } + ], + "transfers": {}, + "fixture_metrics": { + "sample_size_within_3pct": 100.0, + "pixel_position_median": 3.5439331439266946, + "spacing_along_ratio_median": 0.9981055537947778, + "spacing_cross_ratio_median": 0.9996461940898705 + } + }, + "beams_tropics_06": { + "digest": "b4bc372dbf8aadff4ad9358f0d4b3f95de9c1f0c0bd53a082cc7fbb361873e90", + "standard_version": 7, + "tatc_version": "3.7.0", + "source": "validation/catalog/validate_catalog_tropics.py", + "reference": "Footprints of the TROPICS L1 Radiance ATBD; 118 GHz spot positions of TROPICS06BRTTL1B", + "period": "2024-10-01", + "platforms": [ + "tropics-06" + ], + "platform_periods": {}, + "metrics": [ + { + "name": "sample_size_within_3pct", + "value": 100.0 + }, + { + "name": "sample_size_largest_error", + "value": 2.783915445918317 + }, + { + "name": "pixel_position_median", + "value": 32.495275559453134 + }, + { + "name": "pixel_position_p95", + "value": 49.555943743083134 + }, + { + "name": "spacing_along_ratio_median", + "value": 0.9921336521499844 + }, + { + "name": "spacing_cross_ratio_median", + "value": 1.0000482056486315 + } + ], + "transfers": {}, + "fixture_metrics": { + "sample_size_within_3pct": 100.0, + "pixel_position_median": 32.35137615964348, + "spacing_along_ratio_median": 0.9941552253776195, + "spacing_cross_ratio_median": 1.002088708310747 + } } } } diff --git a/src/tatc/resources/validation/tropomi.json b/src/tatc/resources/validation/tropomi.json index 4299050f..d57557c8 100644 --- a/src/tatc/resources/validation/tropomi.json +++ b/src/tatc/resources/validation/tropomi.json @@ -11,6 +11,7 @@ "platforms": [ "sentinel-5p" ], + "platform_periods": {}, "metrics": [ { "name": "pass_recall", @@ -38,6 +39,47 @@ "passes_found": 100.0, "epoch_p95": 2.0062314133499988 } + }, + "pixels": { + "digest": "01f46100e13cf7ba51a627432b428e1f666f838e57907e61667468c6769098c8", + "standard_version": 8, + "tatc_version": "3.7.0", + "source": "validation/catalog/validate_catalog_tropomi.py", + "reference": "Nadir pixel of the TROPOMI L1b ATBD (not gated); pixel bounds of S5P L2__AER_AI (boundaries of every 16th row, midway between lines)", + "period": "2026-11-10", + "platforms": [ + "sentinel-5p" + ], + "platform_periods": {}, + "metrics": [ + { + "name": "sample_size_largest_error", + "value": 2.2338145857349945 + }, + { + "name": "pixel_position_median", + "value": 7.220636507772809 + }, + { + "name": "pixel_position_p95", + "value": 13.18650779088381 + }, + { + "name": "spacing_along_ratio_median", + "value": 1.0000174987742718 + }, + { + "name": "spacing_cross_ratio_median", + "value": 0.9980462366244602 + } + ], + "transfers": {}, + "fixture_metrics": { + "sample_size_largest_error": 2.2338145857349945, + "pixel_position_median": 8.095148250235445, + "spacing_along_ratio_median": 0.9999790608242936, + "spacing_cross_ratio_median": 0.9981796972817567 + } } } } diff --git a/src/tatc/schemas/instrument/pointed.py b/src/tatc/schemas/instrument/pointed.py index 41f6adb9..005e8f0c 100644 --- a/src/tatc/schemas/instrument/pointed.py +++ b/src/tatc/schemas/instrument/pointed.py @@ -24,6 +24,7 @@ compute_swept_footprints, compute_ground_advance, compute_ground_sample_size, + compute_incidence_angle, compute_projected_ray_position, compute_view_angles, compute_view_tangents, @@ -113,7 +114,10 @@ class PointedInstrument(Instrument): + "in a plane perpendicular to the boresight (`frame`, as for a framing " + "camera or a pushbroom array), or in cross-track and along-track angles " + "(`scan`, as for a cross-track scanner, whose along-track angular extent " - + "is constant across the scan).", + + "is constant across the scan), or in the same angles with the along-track " + + "angle first (`scan_along_first`, whose cross-track angular extent is " + + "constant along track, as for the fixed grid of a geostationary imager " + + "that sweeps about the y axis).", ) is_rectangular: bool = Field( default=False, @@ -161,6 +165,28 @@ class PointedInstrument(Instrument): + "`compute_sample_spacing`), or `None` if not modeled.", gt=0, ) + range_resolution: float | None = Field( + default=None, + description="Resolution (meters) of a radar's sample in range: in slant " + + "range (as set by its bandwidth and processing), whose size on the ground " + + "across track is divided by the sine of the incidence angle at the target, " + + "or on the ground (see `range_resolution_frame`), or `None` for the " + + "instantaneous field of view of a pixel (see `compute_sample_size`).", + gt=0, + ) + range_resolution_frame: Literal["slant", "ground"] = Field( + default="slant", + description="Frame of `range_resolution`: in slant range (`slant`), or a " + + "size on the ground across track (`ground`, as of a product on a grid of " + + "constant resolution).", + ) + azimuth_resolution: float | None = Field( + default=None, + description="Resolution (meters) of a radar's sample in azimuth, a size on " + + "the ground along track, or `None` for the instantaneous field of view of " + + "a pixel (see `compute_sample_size`).", + gt=0, + ) velocity_frame: VelocityFrame = Field( default=VelocityFrame.EARTH_FIXED, description="Reference frame of the velocity vector that defines the " @@ -198,7 +224,11 @@ def compute_sample_size( track, centered on the line of sight to the target (see `tatc.utils.compute_ground_sample_size`). The sizes grow with the slant range and, in the direction of a view off nadir, with the - obliquity of the view. + obliquity of the view. A radar's resolutions replace them, if given: + the `azimuth_resolution` along track, and the `range_resolution` + across track (in slant range, divided by the sine of the incidence + angle at the target, see `tatc.utils.compute_incidence_angle`; or on + the ground). Args: orbit_track (skyfield.positionlib.Geocentric): The satellite position/velocity. @@ -209,12 +239,27 @@ def compute_sample_size( tuple[numpy.typing.NDArray, numpy.typing.NDArray]: the along-track and cross-track sizes (meters). """ - return self._compute_ground_extent( + along, cross = self._compute_ground_extent( orbit_track, target, self.get_along_track_instantaneous_field_of_view(), self.get_cross_track_instantaneous_field_of_view(), ) + # a radar's resolutions, where its pixel's rays meet the Earth + if self.azimuth_resolution is not None: + along = np.where(np.isnan(along), np.nan, self.azimuth_resolution) + if self.range_resolution is not None: + if self.range_resolution_frame == "ground": + size = self.range_resolution + else: + incidence = np.radians(compute_incidence_angle(orbit_track, target)) + # infinite at zero incidence, where a slant range has no extent + with np.errstate(divide="ignore"): + size = np.reshape( + self.range_resolution / np.sin(incidence), np.shape(cross) + ) + cross = np.where(np.isnan(cross), np.nan, size) + return along, cross def compute_sample_spacing( self, orbit_track: Geocentric, target: GeographicPosition @@ -222,7 +267,10 @@ def compute_sample_spacing( """ Computes the spacing on the ground (meters) between the centers of neighboring pixels viewing a target, along track and across track - (see `compute_sample_size`). A pixel smaller than the spacing (a + (see `compute_sample_size`). The spacing of a radar's samples is not + modeled: it is `NaN` in the directions whose resolutions are given + (`azimuth_resolution` along track, `range_resolution` across track), + whose samples are cells of its products rather than pixels of its view. A pixel smaller than the spacing (a negative oversampling) leaves gaps between pixels, and a sensor cannot resolve detail finer than the larger of the two. @@ -255,7 +303,7 @@ def compute_sample_spacing( self.get_cross_track_sample_spacing(), ) if self.scan_period is None: - return along, cross + return self._without_radar_spacing(along, cross) advance = compute_ground_advance( orbit_track, target, @@ -265,7 +313,21 @@ def compute_sample_spacing( self._attitude, ) within_scan = along if self.along_track_pixels > 1 else 0 - return np.maximum(within_scan, advance / self.along_track_pixels), cross + along = np.maximum(within_scan, advance / self.along_track_pixels) + return self._without_radar_spacing(along, cross) + + def _without_radar_spacing( + self, along: npt.NDArray, cross: npt.NDArray + ) -> tuple[npt.NDArray, npt.NDArray]: + """ + Gets spacings with `NaN` in the directions of a radar's resolutions, whose + spacing is not modeled. + """ + if self.azimuth_resolution is not None: + along = np.full(np.shape(along), np.nan) + if self.range_resolution is not None: + cross = np.full(np.shape(cross), np.nan) + return along, cross def _compute_ground_extent( self, @@ -277,17 +339,60 @@ def _compute_ground_extent( """ Computes the size on the ground (meters) of angular extents centered on the line of sight to a target, along this instrument's view axes: - those of the rolled and pitched view, or, for a `ViewGeometry.SCAN` - view, of the scan plane tilted by the pitch angle. - """ - if self.view_geometry == ViewGeometry.SCAN: + those of the rolled and pitched view, or, for a `ViewGeometry.SCAN` view, + of the scan plane tilted by the pitch angle, rotated to the target (its + cross-track and along-track angles), in which a step of the cross-track + angle moves the line of sight by its cosine of the target's along-track + angle from the plane. Along track first + (`ViewGeometry.SCAN_ALONG_FIRST`), they are those of the plane tilted to + the target's along-track angle, in which a step of the along-track angle + (about the cross-track axis) moves the line of sight by its cosine of the + target's cross-track angle. + """ + if self.view_geometry == ViewGeometry.SCAN_ALONG_FIRST: + roll, pitch = compute_view_angles( + orbit_track, + target, + self.velocity_frame, + self.nadir_reference, + attitude=self._attitude, + yaw_angle=self.yaw_angle, + along_first=True, + ) return compute_ground_sample_size( orbit_track, target, - along_track_angle, + along_track_angle * np.cos(np.radians(roll)), cross_track_angle, self.velocity_frame, nadir_reference=self.nadir_reference, + tilt_angle=pitch, + attitude=self._attitude, + yaw_angle=self.yaw_angle, + ) + if ViewGeometry(self.view_geometry).is_scan: + # the axes of the view rolled and pitched to the target, in the scan + # plane, along which a step of the cross-track angle (about the tilted + # along-track axis) moves the line of sight by its cosine of the + # target's along-track angle from the plane + roll, pitch = compute_view_angles( + orbit_track, + target, + self.velocity_frame, + self.nadir_reference, + self.get_pitch_angle(orbit_track), + attitude=self._attitude, + yaw_angle=self.yaw_angle, + ) + return compute_ground_sample_size( + orbit_track, + target, + along_track_angle, + cross_track_angle * np.cos(np.radians(pitch)), + self.velocity_frame, + roll, + pitch, + nadir_reference=self.nadir_reference, tilt_angle=self.get_pitch_angle(orbit_track), attitude=self._attitude, yaw_angle=self.yaw_angle, @@ -491,8 +596,10 @@ def is_in_field_of_view( Returns: numpy.typing.NDArray: Array of indicators: `True` if the target is in the field of view. """ - if self.view_geometry == ViewGeometry.SCAN: - # angles in the scan plane, tilted by the pitch angle + if ViewGeometry(self.view_geometry).is_scan: + along_first = self.view_geometry == ViewGeometry.SCAN_ALONG_FIRST + # angles in the scan plane, tilted by the pitch angle (or, along + # track first, the pitch angle from nadir and the roll angle) roll, pitch = compute_view_angles( orbit_track, target, @@ -501,6 +608,7 @@ def is_in_field_of_view( self.get_pitch_angle(orbit_track), attitude=self._attitude, yaw_angle=self.yaw_angle, + along_first=along_first, ) # angular offsets from the view center, normalized by the half widths cross_offset = ( @@ -589,20 +697,23 @@ def compute_projected_pixel_position( Returns: (skyfield.toposlib.GeographicPosition): the geographic position of the projected pixel """ - if self.view_geometry == ViewGeometry.SCAN: + if ViewGeometry(self.view_geometry).is_scan: cross_offset, along_offset = self._get_pixel_offsets( cross_track_index, along_track_index ) + # along track first, the along-track offset tilts with the pitch + along_first = self.view_geometry == ViewGeometry.SCAN_ALONG_FIRST return compute_projected_ray_position( orbit_track=orbit_track, cross_track_field_of_view=0, along_track_field_of_view=0, roll_angle=self.get_roll_angle(orbit_track) + cross_offset, - pitch_angle=along_offset, + pitch_angle=0 if along_first else along_offset, elevation=elevation, velocity_frame=self.velocity_frame, nadir_reference=self.nadir_reference, - tilt_angle=self.get_pitch_angle(orbit_track), + tilt_angle=self.get_pitch_angle(orbit_track) + + (along_offset if along_first else 0), ground_elevation=ground_elevation, attitude=self._attitude, yaw_angle=self.yaw_angle, diff --git a/src/tatc/utils/__init__.py b/src/tatc/utils/__init__.py index 073956d9..189ff165 100644 --- a/src/tatc/utils/__init__.py +++ b/src/tatc/utils/__init__.py @@ -71,6 +71,7 @@ compute_swept_footprints, compute_ground_advance, compute_ground_sample_size, + compute_incidence_angle, compute_view_angles, compute_view_tangents, ) @@ -131,6 +132,7 @@ "compute_terrain_elevation_angle", "compute_ground_advance", "compute_ground_sample_size", + "compute_incidence_angle", "compute_view_angles", "compute_view_tangents", "field_of_regard_to_swath_width", diff --git a/src/tatc/utils/projection.py b/src/tatc/utils/projection.py index bb5be4ea..3c547125 100644 --- a/src/tatc/utils/projection.py +++ b/src/tatc/utils/projection.py @@ -89,9 +89,30 @@ class ViewGeometry(str, Enum): by an along-track angle about the rotated cross-track axis, with the fields of view as the ranges of these angles about the roll angle and the scan plane. The angular extent along track is constant across the - scan, so the footprint widens along track away from nadir. + scan, so the footprint widens along track away from nadir. A geostationary + imager's fixed grid of scan angles whose sweep is about the x axis (that of + GOES-R's ABI) is a `SCAN` view in the inertial frame, whose along-track + direction is east. + """ + SCAN_ALONG_FIRST = "scan_along_first" + """ + In angles, as `SCAN`, but with the along-track angle first: each direction + is nadir rotated by the along-track angle (with the pitch angle) about the + cross-track axis, and then by the cross-track angle (with the roll angle) + about the rotated along-track axis. The angular extent across track is + constant along track. A geostationary imager's fixed grid of scan angles + whose sweep is about the y axis (the convention of CGMS, as of Himawari's AHI + and MTG's FCI) is a `SCAN_ALONG_FIRST` view in the inertial frame. Along + track at the view's center (the scan line), it is the same as `SCAN`. """ + @property + def is_scan(self) -> bool: + """ + Whether the view is defined in angles (`SCAN` or `SCAN_ALONG_FIRST`). + """ + return self in (ViewGeometry.SCAN, ViewGeometry.SCAN_ALONG_FIRST) + class NadirReference(str, Enum): """ @@ -197,6 +218,41 @@ def _compute_line_of_sight( return xyz - p_m +def compute_incidence_angle( + orbit_track: Geocentric, target: GeographicPosition +) -> npt.NDArray: + """ + Compute the incidence angle (degrees) at a target of the line of sight from a + satellite: the angle between the line of sight to the satellite and the + normal to the WGS 84 ellipsoid at the target, 90 degrees less the + satellite's elevation angle (see `compute_local_incidence_angle` for sloped + terrain). + + Args: + orbit_track (skyfield.positionlib.Geocentric): the satellite orbit track. + target (skyfield.toposlib.GeographicPosition): the target position + (a single target, or one target for each time of the orbit track). + + Returns: + numpy.typing.NDArray: the incidence angle(s) (degrees). + """ + p_m = np.asarray(orbit_track.frame_xyz(itrs).m) + up = -_compute_line_of_sight(target, p_m) + latitude = np.radians(target.latitude.degrees) + longitude = np.radians(target.longitude.degrees) + normal = np.stack( + [ + np.cos(latitude) * np.cos(longitude), + np.cos(latitude) * np.sin(longitude), + np.sin(latitude) * np.ones_like(longitude), + ] + ) + if normal.ndim < up.ndim: + normal = np.reshape(normal, (3,) + (1,) * (up.ndim - 1)) + cosine = np.sum(up * normal, axis=0) / np.linalg.norm(up, axis=0) + return np.degrees(np.arccos(np.clip(cosine, -1, 1))) + + def _compute_view_frame( orbit_track: Geocentric, roll_angle: float = 0, @@ -612,6 +668,7 @@ def compute_view_angles( tilt_angle: float = 0, attitude: Any = None, yaw_angle: float = 0, + along_first: bool = False, ) -> tuple[npt.NDArray, npt.NDArray]: """ Compute the roll and pitch angles (degrees) that point a view's center at @@ -641,10 +698,33 @@ def compute_view_angles( nadir frame (in `velocity_frame`). yaw_angle (float): the yaw angle (degrees) of the view about the nadir axis, applied before the tilt angle. + along_first (bool): `True` for the angles in the other order, of a + `ViewGeometry.SCAN_ALONG_FIRST` view: the pitch angle about the + cross-track axis (from the tilt angle, as the tilt and the pitch + rotate about the same axis), then the roll angle about the pitched + along-track axis. Returns: tuple[numpy.typing.NDArray, numpy.typing.NDArray]: the roll (positive left) and pitch (positive forward) angles (degrees). """ + if along_first: + p_m, nadir, along, cross = _compute_view_frame( + orbit_track, + 0, + 0, + velocity_frame, + nadir_reference, + 0, + attitude, + yaw_angle, + ) + los = _compute_line_of_sight(target, p_m) + los = los / np.linalg.norm(los, axis=0) + pitch = np.degrees( + np.arctan2(np.sum(los * along, axis=0), np.sum(los * nadir, axis=0)) + ) + roll = np.degrees(np.arcsin(np.clip(np.sum(los * cross, axis=0), -1, 1))) + return roll, pitch - tilt_angle p_m, nadir, along, cross = _compute_view_frame( orbit_track, 0, @@ -1381,7 +1461,8 @@ def compute_footprint( angles = np.where(angles < -theta, angles + 360, angles) else: angles = np.linspace(0, 360, number_points) - if view_geometry == ViewGeometry.SCAN: + view_geometry = ViewGeometry(view_geometry) + if view_geometry.is_scan: # perimeter in (cross-track, along-track) angles, counterclockwise from # the left side as for the clock angles above, with points evenly # spaced in angle along each side @@ -1400,18 +1481,20 @@ def compute_footprint( theta = np.radians(np.linspace(0, 360, number_points)) offsets = np.stack([half_c * np.cos(theta), half_a * np.sin(theta)], axis=1) # rays at the angular offsets from the roll angle and the scan plane, - # which the pitch angle tilts about the cross-track axis + # which the pitch angle tilts about the cross-track axis (or, along + # track first, tilted by the pitch angle and the along-track offset) + along_first = view_geometry == ViewGeometry.SCAN_ALONG_FIRST *rays, _ = _compute_rays( orbit_track, 0, 0, roll_angle + offsets[:, :1], - offsets[:, 1:], + 0 if along_first else offsets[:, 1:], False, np.zeros(len(offsets)), velocity_frame, nadir_reference, - pitch_angle, + pitch_angle + offsets[:, 1:] if along_first else pitch_angle, attitude, yaw_angle, ) @@ -1444,7 +1527,7 @@ def compute_footprint( # clip views toward a target above the instrument to the horizon # (including views about nadir, whose boundaries may be visible), # given the center of each view (its ray before adding its extent) - is_scan = view_geometry == ViewGeometry.SCAN + is_scan = view_geometry.is_scan _, center, *_ = _compute_rays( orbit_track, 0, @@ -1547,7 +1630,7 @@ def compute_swept_footprints( number_points = max(2, number_points) # positions across the line, from its left end (1) to its right end (-1) s = np.linspace(1, -1, number_points) - if view_geometry == ViewGeometry.SCAN: + if ViewGeometry(view_geometry).is_scan: # rays at cross-track angles from the roll angle, in the scan plane # that the pitch angle tilts about the cross-track axis *rays, _ = _compute_rays( diff --git a/tests/catalog/fixtures/abi.npz b/tests/catalog/fixtures/abi.npz index 5182cc0f..6b74e0f3 100644 Binary files a/tests/catalog/fixtures/abi.npz and b/tests/catalog/fixtures/abi.npz differ diff --git a/tests/catalog/fixtures/abi_pixels.npz b/tests/catalog/fixtures/abi_pixels.npz new file mode 100644 index 00000000..a14f162d Binary files /dev/null and b/tests/catalog/fixtures/abi_pixels.npz differ diff --git a/tests/catalog/fixtures/ahi_pixels.npz b/tests/catalog/fixtures/ahi_pixels.npz new file mode 100644 index 00000000..719f2872 Binary files /dev/null and b/tests/catalog/fixtures/ahi_pixels.npz differ diff --git a/tests/catalog/fixtures/atlid.npz b/tests/catalog/fixtures/atlid.npz index 6808418f..e8dfdf82 100644 Binary files a/tests/catalog/fixtures/atlid.npz and b/tests/catalog/fixtures/atlid.npz differ diff --git a/tests/catalog/fixtures/bbr.npz b/tests/catalog/fixtures/bbr.npz index 82a62ea3..44e944ab 100644 Binary files a/tests/catalog/fixtures/bbr.npz and b/tests/catalog/fixtures/bbr.npz differ diff --git a/tests/catalog/fixtures/ceres.npz b/tests/catalog/fixtures/ceres.npz index 505d0cdc..d62e17e1 100644 Binary files a/tests/catalog/fixtures/ceres.npz and b/tests/catalog/fixtures/ceres.npz differ diff --git a/tests/catalog/fixtures/ceres_suomi_npp.npz b/tests/catalog/fixtures/ceres_suomi_npp.npz index 73861af8..b0aeaa81 100644 Binary files a/tests/catalog/fixtures/ceres_suomi_npp.npz and b/tests/catalog/fixtures/ceres_suomi_npp.npz differ diff --git a/tests/catalog/fixtures/cpr.npz b/tests/catalog/fixtures/cpr.npz index a9f6bcd9..c330f02c 100644 Binary files a/tests/catalog/fixtures/cpr.npz and b/tests/catalog/fixtures/cpr.npz differ diff --git a/tests/catalog/fixtures/ecostress.npz b/tests/catalog/fixtures/ecostress.npz index 401c8aa5..a1fccd05 100644 Binary files a/tests/catalog/fixtures/ecostress.npz and b/tests/catalog/fixtures/ecostress.npz differ diff --git a/tests/catalog/fixtures/emit.npz b/tests/catalog/fixtures/emit.npz index 8e40cb42..ca4cdea3 100644 Binary files a/tests/catalog/fixtures/emit.npz and b/tests/catalog/fixtures/emit.npz differ diff --git a/tests/catalog/fixtures/fci_pixels.npz b/tests/catalog/fixtures/fci_pixels.npz new file mode 100644 index 00000000..69f97cda Binary files /dev/null and b/tests/catalog/fixtures/fci_pixels.npz differ diff --git a/tests/catalog/fixtures/gedi.npz b/tests/catalog/fixtures/gedi.npz index c60b06d3..2e705678 100644 Binary files a/tests/catalog/fixtures/gedi.npz and b/tests/catalog/fixtures/gedi.npz differ diff --git a/tests/catalog/fixtures/iasi_ng.npz b/tests/catalog/fixtures/iasi_ng.npz index c276c311..5d1a9514 100644 Binary files a/tests/catalog/fixtures/iasi_ng.npz and b/tests/catalog/fixtures/iasi_ng.npz differ diff --git a/tests/catalog/fixtures/mws.npz b/tests/catalog/fixtures/mws.npz index 701a7041..319a56a3 100644 Binary files a/tests/catalog/fixtures/mws.npz and b/tests/catalog/fixtures/mws.npz differ diff --git a/tests/catalog/fixtures/oci.npz b/tests/catalog/fixtures/oci.npz index 891c39a3..d70c4657 100644 Binary files a/tests/catalog/fixtures/oci.npz and b/tests/catalog/fixtures/oci.npz differ diff --git a/tests/catalog/fixtures/tropics_03.npz b/tests/catalog/fixtures/tropics_03.npz index 7c0095a9..2b8167ba 100644 Binary files a/tests/catalog/fixtures/tropics_03.npz and b/tests/catalog/fixtures/tropics_03.npz differ diff --git a/tests/catalog/fixtures/tropics_05.npz b/tests/catalog/fixtures/tropics_05.npz index 2588b141..b8d471e2 100644 Binary files a/tests/catalog/fixtures/tropics_05.npz and b/tests/catalog/fixtures/tropics_05.npz differ diff --git a/tests/catalog/fixtures/tropics_06.npz b/tests/catalog/fixtures/tropics_06.npz index ce6aedd3..43a41c95 100644 Binary files a/tests/catalog/fixtures/tropics_06.npz and b/tests/catalog/fixtures/tropics_06.npz differ diff --git a/tests/catalog/fixtures/tropomi.npz b/tests/catalog/fixtures/tropomi.npz index fc20b72c..c90f3a14 100644 Binary files a/tests/catalog/fixtures/tropomi.npz and b/tests/catalog/fixtures/tropomi.npz differ diff --git a/tests/catalog/test_entries.py b/tests/catalog/test_entries.py index 8c61e020..70268658 100644 --- a/tests/catalog/test_entries.py +++ b/tests/catalog/test_entries.py @@ -55,6 +55,7 @@ "full_disk": ("partial", None, ["product_limit"]), "sst_good_quality": ("validated", None, []), "lst_good_quality": ("validated", None, []), + "pixels": ("partial", None, ["sample_size_within_3pct"]), }, [], ), @@ -63,6 +64,7 @@ { "full_disk": ("partial", None, ["product_limit"]), "cloud_top_height": ("partial", 38, ["product_limit"]), + "pixels": ("partial", None, ["sample_size_within_3pct"]), }, [], ), @@ -98,6 +100,11 @@ "validated", { "swaths": ("validated", 34, []), + "resolution": ( + "nominal", + None, + ["sample_size_within_3pct", "no comparison with reference data"], + ), }, [], ), @@ -105,6 +112,15 @@ "partial", { "beam_pairs": ("partial", 34, ["epoch_p95"]), + "footprints": ( + "nominal", + None, + [ + "sample_size_within_3pct", + "spacing_along_error", + "no comparison with reference data", + ], + ), }, [], ), @@ -112,6 +128,7 @@ "partial", { "profile": ("partial", 41, ["track_offset_median"]), + "footprints": ("partial", 41, ["sample_size_within_3pct"]), }, [], ), @@ -139,6 +156,7 @@ "partial", { "views": ("partial", 41, ["pass_recall", "footprint_iou_median"]), + "pixels": ("partial", 41, ["sample_size_within_3pct"]), }, [], ), @@ -146,14 +164,17 @@ "partial", { "swath_noaa_20": ("partial", 36, ["swath_width_median"]), + "beams_noaa_20": ("partial", None, ["sample_size_within_3pct"]), "swath_suomi_npp": ("validated", 35, []), + "beams_suomi_npp": ("partial", 35, ["sample_size_within_3pct"]), }, - ["no configuration at the sample_size grade"], + [], ), "cpr": ( "partial", { "nadir": ("partial", None, ["track_offset_median"]), + "footprints": ("partial", None, ["sample_size_within_3pct"]), }, [], ), @@ -186,6 +207,7 @@ { "iw": ("partial", 51, ["pass_recall"]), "ew": ("validated", 39, []), + "resolution_iw": ("validated", None, []), }, [], ), @@ -208,13 +230,15 @@ "partial", { "swath": ("partial", 35, ["pass_recall"]), + "beams": ("partial", 35, ["sample_size_within_3pct"]), }, - ["no configuration at the sample_size grade"], + [], ), "emit": ( "partial", { "swath": ("partial", 35, ["pass_recall", "footprint_iou_median"]), + "pixels": ("partial", 35, ["sample_size_within_3pct"]), }, [], ), @@ -224,6 +248,7 @@ "full_disk": ("partial", None, ["product_limit"]), "lst_retrieved": ("validated", 32, []), "sst_acceptable_quality": ("validated", 32, []), + "pixels": ("partial", None, ["sample_size_within_3pct"]), }, [], ), @@ -231,6 +256,7 @@ "partial", { "beams": ("partial", 38, ["epoch_p95"]), + "footprints": ("partial", 38, ["sample_size_within_3pct"]), }, [], ), @@ -268,13 +294,28 @@ "partial", { "swath": ("validated", 30, []), + "fields_of_regard": ( + "partial", + 0, + [ + "pixel_position_median", + "sample_size_within_3pct", + "fitted values are not tested on data at least 30 days from " + "their fitting data", + ], + ), }, - ["no configuration at the sample_size grade"], + [], ), "karin": ( "validated", { "swaths": ("validated", 34, []), + "resolution": ( + "nominal", + None, + ["sample_size_within_3pct", "no comparison with reference data"], + ), }, [], ), @@ -288,6 +329,11 @@ 30, ["footprint_iou_median", "footprint_iou_p5"], ), + "resolution": ( + "nominal", + None, + ["sample_size_within_3pct", "no comparison with reference data"], + ), }, [], ), @@ -318,6 +364,15 @@ "validated", { "swath": ("validated", 38, []), + "pixels": ( + "nominal", + None, + [ + "sample_size_within_3pct", + "pixel_position_median", + "no comparison with reference data", + ], + ), }, [], ), @@ -325,15 +380,17 @@ "partial", { "swath": ("validated", 30, []), + "beams": ("partial", None, ["pixel_position_median"]), }, - ["no configuration at the sample_size grade"], + [], ), "oci": ( "partial", { "swath": ("validated", 33, []), + "beams": ("partial", 33, ["sample_size_within_3pct"]), }, - ["no configuration at the sample_size grade"], + [], ), "oco2": ( "partial", @@ -358,6 +415,15 @@ "validated", { "swath": ("validated", 33, []), + "pixels": ( + "nominal", + None, + [ + "sample_size_within_3pct", + "pixel_position_median", + "no comparison with reference data", + ], + ), }, [], ), @@ -451,13 +517,21 @@ 47, ["pass_recall", "pass_precision", "swath_width_median", "epoch_p95"], ), + "beams_tropics_03": ("validated", 47, []), + "beams_tropics_05": ("validated", 47, []), + "beams_tropics_06": ("partial", 47, ["pixel_position_median"]), }, - ["no configuration at the sample_size grade"], + [], ), "tropomi": ( "validated", { "swath": ("validated", 36, []), + "pixels": ( + "partial", + 36, + ["pixel_position_median", "sample_size_within_3pct"], + ), }, [], ), @@ -510,10 +584,32 @@ def test_records_current(self): record.digest, entry.configurations[key].digest, (entry.id, key) ) self.assertTrue( - is_compatible(entry.instrument_class, record.standard_version), + is_compatible( + entry.instrument_class, + record.standard_version, + entry.configurations[key].grade, + ), (entry.id, key), ) + def test_velocity_frame_of_platform(self): + """ + Test that the configurations of an entry on a platform share its velocity + frame, which sets the spacecraft's attitude (yaw steering, or the inertial + frame of a geostationary satellite), whatever their grades. + """ + for entry in list_entries(): + frames = {} + for key, configuration in entry.configurations.items(): + for platform in configuration.platforms: + frames.setdefault(platform, {})[ + key + ] = configuration.velocity_frame.value + for platform, by_key in frames.items(): + self.assertEqual( + len(set(by_key.values())), 1, (entry.id, platform, by_key) + ) + def test_platform_names(self): """ Test that, in an entry with configurations fitted on more than one platform, @@ -574,6 +670,36 @@ def test_list_filters(self): with self.assertRaises(ValueError): list_entries(tier="approved") + def test_list_by_grade(self): + """ + Test that entries are selected by their tier for a use, the lowest of + their configurations that serve it: an entry partial only for want of + sample sizes is validated for coverage (its timing configuration serves + coverage), one with a partial configuration for coverage is not, and a + grade selects the entries with a configuration for it. + """ + validated = [e.id for e in list_entries(tier="validated")] + for_coverage = [e.id for e in list_entries(tier="validated", grade="coverage")] + self.assertNotIn("airs", validated) + self.assertIn("airs", for_coverage) + # NOAA-20's swath is partial, although Suomi NPP's is validated + self.assertNotIn("ceres", for_coverage) + self.assertTrue(set(validated) <= set(for_coverage)) + airs = get_entry("airs") + self.assertEqual(airs.get_tier("coverage").value, "validated") + self.assertEqual(airs.get_tier("sample_size").value, "partial") + self.assertEqual(airs.get_tier(), airs.validation.tier) + self.assertIsNone(get_entry("ssmis").get_tier("sample_size")) + with_sizes = [e.id for e in list_entries(grade="sample_size")] + self.assertNotIn("ssmis", with_sizes) + self.assertIn("airs", with_sizes) + self.assertEqual( + [e.id for e in list_entries("conical", "validated", grade="sample_size")], + ["gmi", "tmi"], + ) + with self.assertRaises(ValueError): + list_entries(grade="approved") + def test_loaded_copies_independent(self): """ Test that changing a loaded entry does not change later ones. @@ -1040,7 +1166,15 @@ def test_body_attitudes(self): } self.assertEqual( with_attitude, - {"ecostress:swath", "emit:swath", "gedi:beams", "oco2:glint"}, + { + "ecostress:swath", + "ecostress:beams", + "emit:swath", + "emit:pixels", + "gedi:beams", + "gedi:footprints", + "oco2:glint", + }, ) def test_entry_lists_every_gap(self): @@ -1172,13 +1306,15 @@ def test_gmi_reports_spacing_limitation(self): ) ) - def test_abi_builds_without_attitude(self): + def test_earth_fixed_builds_without_attitude(self): """ Test that an Earth-fixed configuration without other attitude fields - builds as it was tested, without an attitude. + builds as it was tested, without an attitude, and that an inertial one + (as every geostationary configuration is) builds with an inertial attitude. """ + self.assertIsNone(get_entry("mhs").build(configuration="beams").attitude) payload = get_entry("abi").build() - self.assertIsNone(payload.attitude) + self.assertEqual(payload.attitude.velocity_frame, VelocityFrame.INERTIAL) self.assertIsInstance(payload.instruments[0], Instrument) @@ -1276,7 +1412,7 @@ def test_grade_errors(self): grade, is an error. """ with self.assertRaisesRegex(ValueError, "sample_size"): - get_entry("csar").select_configuration(grade="sample_size") + get_entry("ssmis").select_configuration(grade="sample_size") with self.assertRaisesRegex(ValueError, "timing"): get_entry("gmi").select_configuration("feeds", grade="sample_size") diff --git a/tests/catalog/test_fixed_grid_fixtures.py b/tests/catalog/test_fixed_grid_fixtures.py new file mode 100644 index 00000000..44270296 --- /dev/null +++ b/tests/catalog/test_fixed_grid_fixtures.py @@ -0,0 +1,201 @@ +""" +Regression tests that recompute the results of the pixels configurations of +geostationary imagers (ABI, AHI, and FCI) from reduced fixtures, written by their +validation scripts in `validation/catalog/` (see `validation_io.validate_fixed_grid`): +their pixels projected from the nominal position of the fixed grid, the spacing of +their pixels, and the published sizes at the sub-satellite point. + +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. + +@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 pyproj import Transformer + +from tatc.analysis import compute_sample_sizes +from tatc.catalog import get_entry +from tatc.catalog.standard import get_gates +from tatc.schemas import CircularOrbit, GeosynchronousOrbit +from tatc.utils import VelocityFrame, compute_projected_ray_position + +FIXTURES = pathlib.Path(__file__).parent / "fixtures" +PUBLISHED_EPOCH = datetime(2026, 10, 1, tzinfo=timezone.utc) +KEY = "pixels" +TO_ECEF = Transformer.from_crs("EPSG:4979", "EPSG:4978", always_xy=True) + + +def _ecef(lon, lat) -> np.ndarray: + return np.stack(TO_ECEF.transform(lon, lat, 0.0), axis=-1) + + +def _observations(satellite, names, epochs, lon, lat) -> gpd.GeoDataFrame: + return gpd.GeoDataFrame( + { + "satellite": satellite.name, + "instrument": list(names), + "epoch": pd.DatetimeIndex(epochs), + }, + geometry=gpd.points_from_xy(lon, lat), + crs="EPSG:4326", + ) + + +class _FixedGridFixture: + """ + Tests shared by the pixels configurations of geostationary imagers. + """ + + entry_id: str + instrument: str + # the published size at the sub-satellite point: instrument, altitude (km), + # inclination (deg), scan angle (deg), and sizes east-west and north-south (km) + footprints: tuple + + @classmethod + def setUpClass(cls): + with np.load(FIXTURES / f"{cls.entry_id}_pixels.npz") as data: + cls.data = {key: data[key] for key in data.files} + cls.entry = get_entry(cls.entry_id) + cls.time = datetime.fromisoformat(str(cls.data["time"])) + orbit = GeosynchronousOrbit( + longitude=float(cls.data["longitude"]), epoch=cls.time, inclination=0 + ) + cls.satellite = cls.entry.build(configuration=KEY, orbit=orbit).to_satellite( + orbit, name=cls.entry.name + ) + cls.recorded = cls.entry.record.configurations[KEY].fixture_metrics + cls.gates = { + g.metric: g.limit + for g in get_gates(cls.entry.instrument_class, "sample_size") + } + + def test_published_dimensions(self): + """ + Test that the published size at the sub-satellite point, compared without + the gate, does not move. + """ + errors = [] + for name, altitude, inclination, angle, along, cross in self.footprints: + orbit = CircularOrbit( + altitude=altitude * 1e3, inclination=inclination, epoch=PUBLISHED_EPOCH + ) + satellite = self.entry.build(configuration=KEY, orbit=orbit).to_satellite( + orbit, name=self.entry.name + ) + time = PUBLISHED_EPOCH + timedelta(minutes=10) + target = compute_projected_ray_position( + orbit.to_gp_orbit().get_orbit_track(time), + 0, + 0, + angle, + 0, + velocity_frame=VelocityFrame.INERTIAL, + ) + sizes = compute_sample_sizes( + _observations( + 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), + ] + self.assertNotIn("sample_size_within_3pct", self.recorded) + self.assertAlmostEqual( + 100 * max(errors), self.recorded["sample_size_largest_error"], places=6 + ) + + def test_pixels(self): + """ + Test that pixels projected from the nominal position lie as recorded from the + grid's, within the gate. + """ + size = int(self.data["size"]) + view = self.satellite.get_instrument(0) + track = self.satellite.orbit.to_gp_orbit().get_orbit_track(self.time) + differences = [] + for row, column, lat, lon in self.data["pixels"]: + # TAT-C numbers pixels from the south and from the east + position = view.compute_projected_pixel_position( + track, size - 1 - int(row), size - 1 - int(column) + ) + predicted = _ecef(position.longitude.degrees, position.latitude.degrees) + differences.append(np.linalg.norm(predicted - _ecef(lon, lat)) / 1e3) + median = float(np.median(differences)) + self.assertAlmostEqual( + median, self.recorded["pixel_position_median"], delta=0.01 + ) + self.assertLessEqual(median, self.gates["pixel_position_median"]) + + def test_spacing(self): + """ + Test that the spacing of pixels, east-west and north-south, does not move. + """ + rows = self.data["spacing"] + sizes = compute_sample_sizes( + _observations( + self.satellite, + [self.instrument] * len(rows), + [self.time] * len(rows), + rows[:, 1], + rows[:, 0], + ), + self.satellite, + ) + self.assertAlmostEqual( + float(np.median(sizes.spacing_along.to_numpy() / 1e3 / rows[:, 2])), + self.recorded["spacing_along_ratio_median"], + places=4, + ) + self.assertAlmostEqual( + float(np.median(sizes.spacing_cross.to_numpy() / 1e3 / rows[:, 3])), + self.recorded["spacing_cross_ratio_median"], + places=4, + ) + + +class TestAbiPixels(_FixedGridFixture, unittest.TestCase): + """ + Regression tests of the ABI entry's fixed grid (sweep about the x axis). + """ + + entry_id = "abi" + instrument = "ABI" + footprints = (("ABI", 35786.023, 0, 0, 2.0, 2.0),) + + +class TestAhiPixels(_FixedGridFixture, unittest.TestCase): + """ + Regression tests of the AHI entry's fixed grid (sweep about the y axis). + """ + + entry_id = "ahi" + instrument = "AHI" + footprints = (("AHI", 35785.863, 0, 0, 2.0, 2.0),) + + +class TestFciPixels(_FixedGridFixture, unittest.TestCase): + """ + Regression tests of the FCI entry's fixed grid (sweep about the y axis). + """ + + entry_id = "fci" + instrument = "FCI" + footprints = (("FCI", 35786.4, 0, 0, 2.0, 2.0),) + + +if __name__ == "__main__": + unittest.main() diff --git a/tests/catalog/test_footprint_fixtures.py b/tests/catalog/test_footprint_fixtures.py new file mode 100644 index 00000000..96300f1a --- /dev/null +++ b/tests/catalog/test_footprint_fixtures.py @@ -0,0 +1,171 @@ +""" +Regression tests that recompute the results of the footprints configurations of beam +instruments (GEDI, ATLID, and CPR) from reduced fixtures, written by their validation +scripts in `validation/catalog/` (see `validation_io.validate_footprints`): the sizes +of their footprints against published ones, and the spacing of their samples along +track. + +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. + +@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 compute_sample_sizes +from tatc.catalog import get_entry +from tatc.catalog.standard import get_gates +from tatc.schemas import CircularOrbit, GeneralPerturbationsOrbit +from tatc.utils import VelocityFrame, compute_projected_ray_position + +from .common import use_fixture_earth_orientation + +FIXTURES = pathlib.Path(__file__).parent / "fixtures" +PUBLISHED_EPOCH = datetime(2026, 10, 1, tzinfo=timezone.utc) +KEY = "footprints" + + +def _observations(satellite, names, epochs, lon, lat) -> gpd.GeoDataFrame: + return gpd.GeoDataFrame( + { + "satellite": satellite.name, + "instrument": list(names), + "epoch": pd.DatetimeIndex(epochs), + }, + geometry=gpd.points_from_xy(lon, lat), + crs="EPSG:4326", + ) + + +class _FootprintsFixture: + """ + Tests shared by the footprints configurations of beam instruments. + """ + + entry_id: str + platform: str + # published footprints: instrument, altitude (km), inclination (deg), scan angle + # (deg), and sizes along and across track (km) + footprints: tuple + + @classmethod + def setUpClass(cls): + with np.load(FIXTURES / f"{cls.entry_id}.npz", 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(cls.entry_id) + cls.orbit = GeneralPerturbationsOrbit.from_tle(cls.data["tle"].tolist()) + cls.day = datetime.fromisoformat(str(cls.data["day"])) + cls.satellite = cls.entry.build( + configuration=KEY, orbit=cls.orbit, platform=cls.platform + ).to_satellite(cls.orbit, name=cls.entry.name) + cls.recorded = cls.entry.record.configurations[KEY].fixture_metrics + + def test_published_dimensions(self): + """ + Test that the published footprints, compared without the gate, do not move. + """ + errors = [] + for name, altitude, inclination, angle, along, cross in self.footprints: + orbit = CircularOrbit( + altitude=altitude * 1e3, inclination=inclination, epoch=PUBLISHED_EPOCH + ) + satellite = self.entry.build(configuration=KEY, orbit=orbit).to_satellite( + orbit, name=self.entry.name + ) + time = PUBLISHED_EPOCH + timedelta(minutes=10) + target = compute_projected_ray_position( + orbit.to_gp_orbit().get_orbit_track(time), + 0, + 0, + angle, + 0, + velocity_frame=VelocityFrame.INERTIAL, + ) + sizes = compute_sample_sizes( + _observations( + 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), + ] + self.assertNotIn("sample_size_within_3pct", self.recorded) + self.assertAlmostEqual( + 100 * max(errors), self.recorded["sample_size_largest_error"], places=6 + ) + + def test_spacing(self): + """ + Test that the spacing of samples along track does not move, and meets the + gate as recorded. + """ + rows = self.data["spacing"] + sizes = compute_sample_sizes( + _observations( + self.satellite, + self.data["spacing_instruments"], + [ + self.day + timedelta(seconds=float(s)) + for s in self.data["spacing_seconds"] + ], + rows[:, 1], + rows[:, 0], + ), + self.satellite, + ) + ratio = float(np.median(sizes.spacing_along.to_numpy() / 1e3 / rows[:, 2])) + self.assertAlmostEqual( + ratio, self.recorded["spacing_along_ratio_median"], places=4 + ) + gates = get_gates(self.entry.instrument_class, "sample_size") + limit = next(g.limit for g in gates if g.metric == "spacing_along_error") + self.assertLessEqual(100 * abs(ratio - 1), limit) + + +class TestGediFootprints(_FootprintsFixture, unittest.TestCase): + """ + Regression tests of the GEDI entry's footprints, on the International Space + Station. + """ + + entry_id = "gedi" + platform = "iss" + footprints = (("GEDI BEAM0101", 410, 51.6, 0, 0.023, 0.023),) + + +class TestAtlidFootprints(_FootprintsFixture, unittest.TestCase): + """ + Regression tests of the ATLID entry's footprint, on EarthCARE. + """ + + entry_id = "atlid" + platform = "earthcare" + footprints = (("ATLID", 393, 97.05, 0, 0.015, 0.015),) + + +class TestCprFootprints(_FootprintsFixture, unittest.TestCase): + """ + Regression tests of the CPR entry's footprint, on EarthCARE. + """ + + entry_id = "cpr" + platform = "earthcare" + footprints = (("CPR", 393.14, 97.05, 0, 1.0, 0.65),) + + +if __name__ == "__main__": + unittest.main() diff --git a/tests/catalog/test_pushbroom_fixtures.py b/tests/catalog/test_pushbroom_fixtures.py index 9ff0953b..c3e679e6 100644 --- a/tests/catalog/test_pushbroom_fixtures.py +++ b/tests/catalog/test_pushbroom_fixtures.py @@ -94,16 +94,6 @@ class TestOliFixture(_PushbroomFixture, unittest.TestCase): platform = "landsat-9" -class TestTropomiFixture(_PushbroomFixture, unittest.TestCase): - """ - Regression tests of the TROPOMI entry, whose views are analyzed as a union. - """ - - entry_id = "tropomi" - platform = "sentinel-5p" - instrument_index = None - - class TestMsiFixture(_PushbroomFixture, unittest.TestCase): """ Regression tests of the MSI entry, on Sentinel-2B. @@ -193,16 +183,6 @@ class TestOlciFixture(_PushbroomFixture, unittest.TestCase): platform = "sentinel-3a" -class TestOciFixture(_PushbroomFixture, unittest.TestCase): - """ - Regression tests of the OCI entry's swath, a cross-track scanner whose tilt - follows a pitch profile scheduled by day. - """ - - entry_id = "oci" - platform = "pace" - - class TestLsarWideBandFixture(_PushbroomFixture, unittest.TestCase): """ Regression tests of the L-SAR entry's modes with a 20 or 40 MHz band. diff --git a/tests/catalog/test_resolution_records.py b/tests/catalog/test_resolution_records.py new file mode 100644 index 00000000..27566d52 --- /dev/null +++ b/tests/catalog/test_resolution_records.py @@ -0,0 +1,93 @@ +""" +Regression tests that recompute the records of the resolution configurations of SAR +entries from the published resolutions they are compared with (see +`validation/catalog/validate_catalog_csar.py`). + +@author: Paul T. Grogan +""" + +import unittest +from datetime import datetime, timedelta, timezone + +import geopandas as gpd +import pandas as pd + +from tatc.analysis import compute_sample_sizes +from tatc.catalog import get_entry +from tatc.catalog.standard import get_gates +from tatc.schemas import CircularOrbit +from tatc.utils import VelocityFrame, compute_projected_ray_position + +PUBLISHED_EPOCH = datetime(2026, 10, 1, tzinfo=timezone.utc) +SIZE_TOLERANCE = 0.03 + + +class TestCsarResolutions(unittest.TestCase): + """ + Regression tests of the resolutions of Sentinel-1's IW sub-swaths, against the + Sentinel-1 Product Definition's (Table 7-6, ground range detected high + resolution): instrument, altitude (km), inclination (deg), roll (deg), and + resolutions in azimuth and ground range (km). + """ + + resolutions = ( + ("C-SAR IW1", 693, 98.18, -29.3332, 0.0225, 0.0204), + ("C-SAR IW2", 693, 98.18, -33.9851, 0.0226, 0.0203), + ("C-SAR IW3", 693, 98.18, -38.0423, 0.0226, 0.0205), + ) + + def test_published_resolutions(self): + """ + Test that the resolutions meet the gate as recorded. + """ + entry = get_entry("csar") + errors = [] + for name, altitude, inclination, angle, along, cross in self.resolutions: + orbit = CircularOrbit( + altitude=altitude * 1e3, inclination=inclination, epoch=PUBLISHED_EPOCH + ) + satellite = entry.build( + configuration="resolution_iw", orbit=orbit + ).to_satellite(orbit, name=entry.name) + time = PUBLISHED_EPOCH + timedelta(minutes=10) + target = compute_projected_ray_position( + orbit.to_gp_orbit().get_orbit_track(time), + 0, + 0, + angle, + 0, + velocity_frame=VelocityFrame.INERTIAL, + ) + sizes = compute_sample_sizes( + gpd.GeoDataFrame( + { + "satellite": [satellite.name], + "instrument": [name], + "epoch": pd.DatetimeIndex([time]), + }, + geometry=gpd.points_from_xy( + [target.longitude.degrees], [target.latitude.degrees] + ), + crs="EPSG:4326", + ), + satellite, + ) + errors += [ + abs(sizes.sample_along.iloc[0] / 1e3 / along - 1), + abs(sizes.sample_cross.iloc[0] / 1e3 / cross - 1), + ] + within = 100 * sum(e <= SIZE_TOLERANCE for e in errors) / len(errors) + metrics = { + m.name: m.value + for m in entry.record.configurations["resolution_iw"].metrics + } + self.assertEqual(within, metrics["sample_size_within_3pct"]) + self.assertAlmostEqual( + 100 * max(errors), metrics["sample_size_largest_error"], places=6 + ) + (gate,) = get_gates(entry.instrument_class, "sample_size") + self.assertGreaterEqual(within, gate.limit) + + +if __name__ == "__main__": + unittest.main() diff --git a/tests/catalog/test_scanner_fixtures.py b/tests/catalog/test_scanner_fixtures.py index 56bb3d7e..8e776a52 100644 --- a/tests/catalog/test_scanner_fixtures.py +++ b/tests/catalog/test_scanner_fixtures.py @@ -100,12 +100,16 @@ def test_passes(self): """ Test that the recorded passes are predicted, and that this does not move. """ - satellite = self.entry.to_satellite( - self.orbit, + # the day is the period of the analysis, for a schedule of the attitude; a + # union of views is analyzed together (instrument_index=None) + satellite = self.entry.build( configuration=self.swath_key, + orbit=self.orbit, time_step=self.time_step(), platform=self.platform, - ) + start=self.day, + end=self.day + timedelta(days=1), + ).to_satellite(self.orbit, name=self.entry.name) differences = find_pass_differences( satellite, self.instrument_index, self.day, self.data["passes"] ) @@ -128,12 +132,18 @@ class _ScannerFixture(_SwathFixture): footprints: tuple meets_published_gate = True meets_pixel_gate = True + # whether the published footprints are gated, or too few (as only at nadir) + gates_published = True @classmethod def setUpClass(cls): super().setUpClass() cls.satellite = cls.entry.build( - configuration=cls.sizes_key, orbit=cls.orbit, platform=cls.platform + configuration=cls.sizes_key, + orbit=cls.orbit, + platform=cls.platform, + start=cls.day, + end=cls.day + timedelta(days=1), ).to_satellite(cls.orbit, name=cls.entry.name) cls.names = np.array([i.name for i in cls.satellite.instruments]) cls.recorded = cls.entry.record.configurations[cls.sizes_key].fixture_metrics @@ -152,15 +162,20 @@ def recompute_pixel_differences(self) -> np.ndarray: def test_published_dimensions(self): """ - Test that published footprint dimensions meet the gate and do not move. + Test that published footprint dimensions meet the gate (if they are gated) + and do not move. """ errors = [] - for name, altitude, inclination, angle, along, cross in self.footprints: + for name, altitude, inclination, angle, along, cross, *rest in self.footprints: + pitch = rest[0] if rest else 0 orbit = CircularOrbit( altitude=altitude * 1e3, inclination=inclination, epoch=PUBLISHED_EPOCH ) satellite = self.entry.build( - configuration=self.sizes_key, orbit=orbit + configuration=self.sizes_key, + orbit=orbit, + start=PUBLISHED_EPOCH, + end=PUBLISHED_EPOCH + timedelta(days=1), ).to_satellite(orbit, name=self.entry.name) time = PUBLISHED_EPOCH + timedelta(minutes=10) target = compute_projected_ray_position( @@ -168,7 +183,7 @@ def test_published_dimensions(self): 0, 0, angle, - 0, + pitch, velocity_frame=VelocityFrame.INERTIAL, ) sizes = compute_sample_sizes( @@ -185,6 +200,12 @@ def test_published_dimensions(self): abs(sizes.sample_along.iloc[0] / 1e3 / along - 1), abs(sizes.sample_cross.iloc[0] / 1e3 / cross - 1), ] + if not self.gates_published: + self.assertNotIn("sample_size_within_3pct", self.recorded) + self.assertAlmostEqual( + 100 * max(errors), self.recorded["sample_size_largest_error"], places=6 + ) + return within = 100 * float(np.mean(np.array(errors) <= SIZE_TOLERANCE)) configuration = self.entry.configurations[self.sizes_key] gates = get_gates(self.entry.instrument_class, configuration.grade) @@ -440,20 +461,36 @@ def spacing_names(self, rows: np.ndarray) -> np.ndarray: return np.full(len(rows), self.size_instrument) def recompute_pixel_differences(self) -> np.ndarray: - instrument = self.satellite.get_instrument(0) + instrument = self.satellite.get_instrument( + int(np.flatnonzero(self.names == self.size_instrument)[0]) + ) orbit = self.satellite.orbit.to_gp_orbit() + # the line along track of the pixels, of a scan of several lines + line = int(self.data.get("line", 0)) differences = [] for seconds, pixel, _, lat, lon in self.data["pixels"]: position = instrument.compute_projected_pixel_position( orbit.get_orbit_track(self.day + timedelta(seconds=float(seconds))), int(pixel), - 0, + line, ) predicted = _ecef(position.longitude.degrees, position.latitude.degrees) differences.append(np.linalg.norm(predicted - _ecef(lon, lat)) / 1e3) return np.array(differences) +class _StepBeamScannerFixture(_BeamScannerFixture): + """ + Tests of entries with a sample size configuration whose fixture passes were + recomputed at a fixed time step. + """ + + step: float = 10 + + def time_step(self) -> float: + return self.step + + class TestDprFixture(_BeamScannerFixture, unittest.TestCase): """ Regression tests of the DPR entry. @@ -717,23 +754,32 @@ class TestOmpsNmSuomiNppFixture(_StepSwathFixture, unittest.TestCase): platform = "suomi-npp" -class TestCeresFixture(_StepSwathFixture, unittest.TestCase): +class TestCeresFixture(_StepBeamScannerFixture, unittest.TestCase): """ - Regression tests of the CERES entry, at the period of its records (6.6 s). + Regression tests of the CERES entry, at the period of its records (6.6 s), whose + published footprints (only at nadir) are not gated. """ entry_id = "ceres" swath_key = "swath_noaa_20" + sizes_key = "beams_noaa_20" + size_instrument = "CERES" + gates_published = False + footprints = ( + ("CERES", 350, 35, 0, 16, 8), + ("CERES", 705, 98.2, 0, 32, 16), + ) step = 6.6 class TestCeresSuomiNppFixture(TestCeresFixture): """ - Regression tests of the CERES entry's configuration of Suomi NPP (FM5). + Regression tests of the CERES entry's configurations of Suomi NPP (FM5). """ fixture_name = "ceres_suomi_npp" swath_key = "swath_suomi_npp" + sizes_key = "beams_suomi_npp" platform = "suomi-npp" @@ -778,22 +824,92 @@ class TestOco2GlintFixture(_StepSwathFixture, unittest.TestCase): platform = "oco-2" -class TestEcostressFixture(_StepSwathFixture, unittest.TestCase): +class TestEcostressFixture(_StepBeamScannerFixture, unittest.TestCase): """ - Regression tests of the ECOSTRESS entry, on the International Space Station. + Regression tests of the ECOSTRESS entry, on the International Space Station, + whose published pixel (only at nadir) is not gated. """ entry_id = "ecostress" platform = "iss" + sizes_key = "beams" + size_instrument = "ECOSTRESS" + gates_published = False + footprints = (("ECOSTRESS", 400, 51.6, 0, 0.0753, 0.06851, -7.2427),) + + +class TestOciFixture(_StepBeamScannerFixture, unittest.TestCase): + """ + Regression tests of the OCI entry, a cross-track scanner whose tilt follows a + pitch profile scheduled by day, and whose published pixel (only at nadir) is not + gated. + """ + entry_id = "oci" + platform = "pace" + sizes_key = "beams" + size_instrument = "OCI" + gates_published = False + footprints = (("OCI", 675, 98.0, 0, 1.05, 1.05),) -class TestEmitFixture(_StepSwathFixture, unittest.TestCase): + +class TestEmitFixture(_StepBeamScannerFixture, unittest.TestCase): """ - Regression tests of the EMIT entry, on the International Space Station. + Regression tests of the EMIT entry, on the International Space Station, whose + published pixel (only at nadir) is not gated. """ entry_id = "emit" platform = "iss" + sizes_key = "pixels" + size_instrument = "EMIT" + gates_published = False + footprints = (("EMIT", 400, 51.6, 0, 0.068, 0.062, -7.5608),) + + +class TestTropomiFixture(_StepBeamScannerFixture, unittest.TestCase): + """ + Regression tests of the TROPOMI entry, whose views are analyzed as a union, and + whose pixels, of parts of a curved line, miss the gate; its published pixel (only + at nadir) is not gated. + """ + + entry_id = "tropomi" + platform = "sentinel-5p" + instrument_index = None + sizes_key = "pixels" + size_instrument = "TROPOMI pixels 128 to 304" + gates_published = False + meets_pixel_gate = False + footprints = (("TROPOMI pixels 128 to 304", 824, 98.74, 0, 5.5, 3.5),) + + def recompute_pixel_differences(self) -> np.ndarray: + # each row is the boundary at the start of a row of the product (or the end + # of its last), in the part of the line that holds it, half a pixel to the + # left of its pixel in TAT-C's numbering from the right + parts = [ + tuple(int(n) for n in name.split("pixels ")[1].split(" to ")) + for name in self.names + ] + orbit = self.satellite.orbit.to_gp_orbit() + differences = [] + for seconds, row, _, lat, lon in self.data["pixels"]: + index = next( + i + for i, (first, last) in enumerate(parts) + if first <= row < last or row == last == parts[-1][1] + ) + first, last = parts[index] + position = self.satellite.get_instrument( + index + ).compute_projected_pixel_position( + orbit.get_orbit_track(self.day + timedelta(seconds=float(seconds))), + (last - first) - 0.5 - (row - first), + 0, + ) + predicted = _ecef(position.longitude.degrees, position.latitude.degrees) + differences.append(np.linalg.norm(predicted - _ecef(lon, lat)) / 1e3) + return np.array(differences) class TestPoseidon4Fixture(_StepSwathFixture, unittest.TestCase): @@ -835,68 +951,111 @@ class TestCprFixture(_StepSwathFixture, unittest.TestCase): platform = "earthcare" -class TestBbrFixture(_StepSwathFixture, unittest.TestCase): +class TestBbrFixture(_StepBeamScannerFixture, unittest.TestCase): """ - Regression tests of the BBR entry's nadir view (instrument index 1). + Regression tests of the BBR entry's nadir view (instrument index 1), whose + published footprints of the slanted views miss the gate. """ entry_id = "bbr" swath_key = "views" platform = "earthcare" instrument_index = 1 + sizes_key = "pixels" + size_instrument = "BBR nadir" + meets_published_gate = False + footprints = ( + ("BBR nadir", 393, 97.05, 0, 0.64, 0.64), + ("BBR aft", 393, 97.05, 0, 1.876, 1.069, -50.3554), + ("BBR fore", 393, 97.05, 0, 1.876, 1.069, 50.1645), + ) -class TestTropics03Fixture(_StepSwathFixture, unittest.TestCase): +class TestTropics03Fixture(_StepBeamScannerFixture, unittest.TestCase): """ - Regression tests of the TROPICS entry's configuration of TROPICS-03, at the + Regression tests of the TROPICS entry's configurations of TROPICS-03, at the period of its scans. """ entry_id = "tropics" fixture_name = "tropics_03" swath_key = "swath_tropics_03" + sizes_key = "beams_tropics_03" + size_instrument = "TROPICS 118 GHz" platform = "tropics-03" + footprints = tuple( + ("TROPICS 118 GHz", 550, 33, angle, along, cross) + for angle, along, cross in ( + (0, 23.0, 25.2), + (6, 23.2, 25.5), + (31.5, 27.5, 36.5), + (45, 34.1, 58.3), + (60, 54.5, 177.1), + ) + ) step = 2.0 class TestTropics05Fixture(TestTropics03Fixture): """ - Regression tests of the TROPICS entry's configuration of TROPICS-05. + Regression tests of the TROPICS entry's configurations of TROPICS-05. """ fixture_name = "tropics_05" swath_key = "swath_tropics_05" + sizes_key = "beams_tropics_05" platform = "tropics-05" class TestTropics06Fixture(TestTropics03Fixture): """ - Regression tests of the TROPICS entry's configuration of TROPICS-06. + Regression tests of the TROPICS entry's configurations of TROPICS-06, whose + pixels miss the gate on the day tested. """ fixture_name = "tropics_06" swath_key = "swath_tropics_06" + sizes_key = "beams_tropics_06" platform = "tropics-06" + meets_pixel_gate = False -class TestIasiNgFixture(_StepSwathFixture, unittest.TestCase): +class TestIasiNgFixture(_StepBeamScannerFixture, unittest.TestCase): """ - Regression tests of the IASI-NG entry's configuration, at the period of its - scans. + Regression tests of the IASI-NG entry's configurations, at the period of its + scans, whose published pixel (only at nadir) is not gated, and whose pixels, + projected at the middle of a scan, miss the gate. """ entry_id = "iasi_ng" platform = "metop-sga1" + sizes_key = "fields_of_regard" + size_instrument = "IASI-NG" + gates_published = False + meets_pixel_gate = False + footprints = (("IASI-NG", 835, 98.7, 0, 12, 12),) step = 15.561 -class TestMwsFixture(_StepSwathFixture, unittest.TestCase): +class TestMwsFixture(_StepBeamScannerFixture, unittest.TestCase): """ - Regression tests of the MWS entry's configuration, at the period of its scans. + Regression tests of the MWS entry's configurations, at the period of its scans, + whose pixels, projected at the time the product gives a scan, miss the gate. """ entry_id = "mws" platform = "metop-sga1" + sizes_key = "beams" + size_instrument = "MWS 50.3-57.3 GHz" + meets_pixel_gate = False + footprints = ( + ("MWS 23.8-31.4 GHz", 827, 98.7, 0, 39.6, 39.6), + ("MWS 23.8-31.4 GHz", 827, 98.7, 49.312, 67.6, 132.6), + ("MWS 50.3-57.3 GHz", 827, 98.7, 0, 20.0, 20.0), + ("MWS 50.3-57.3 GHz", 827, 98.7, 49.312, 34.2, 66.9), + ("MWS 89-229 GHz", 827, 98.7, 0, 17.0, 17.0), + ("MWS 89-229 GHz", 827, 98.7, 49.312, 29.0, 56.7), + ) step = 2.254 diff --git a/tests/catalog/test_standard.py b/tests/catalog/test_standard.py index 6a557aa0..5af9ed6e 100644 --- a/tests/catalog/test_standard.py +++ b/tests/catalog/test_standard.py @@ -23,8 +23,33 @@ # (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 = 7 +FROZEN_VERSION = 11 FROZEN_GATES = { + # version 11 added the sample size grade of the SAR and scatterometer classes, + # and changed no other gate + ("sar", "sample_size"): [("sample_size_within_3pct", 90, False)], + ("scatterometer", "sample_size"): [("sample_size_within_3pct", 90, False)], + # version 10 added the sample size grade of the geostationary class, with the + # gates of cross-track scanners, and changed no other gate + ("geostationary", "sample_size"): [ + ("sample_size_within_3pct", 90, False), + ("pixel_position_median", 6, True), + ], + # version 9 added the sample size grade of the lidar, profiler, and altimeter + # classes, and changed no other gate + **{ + (instrument_class, "sample_size"): [ + ("sample_size_within_3pct", 90, False), + ("spacing_along_error", 3, True), + ] + for instrument_class in ("lidar", "profiler", "altimeter") + }, + # version 8 added the sample size grade of the pushbroom class, with the gates + # of cross-track scanners, and changed no other gate + ("pushbroom", "sample_size"): [ + ("sample_size_within_3pct", 90, False), + ("pixel_position_median", 6, True), + ], # version 7 added the limb and occultation classes, and changed no other gate ("limb", "coverage"): [ ("tangent_position_median", 10, True), @@ -206,6 +231,22 @@ def test_required_grades(self): self.assertEqual( get_required_grades(InstrumentClass.GEOSTATIONARY), (Grade.COVERAGE,) ) + # the pushbroom class's sample size grade is gated but optional + get_gates(InstrumentClass.PUSHBROOM, Grade.SAMPLE_SIZE) + self.assertEqual( + get_required_grades(InstrumentClass.PUSHBROOM), (Grade.COVERAGE,) + ) + # as are those of the lidar, profiler, and altimeter classes + for instrument_class in ( + "lidar", + "profiler", + "altimeter", + "geostationary", + "sar", + "scatterometer", + ): + get_gates(instrument_class, Grade.SAMPLE_SIZE) + self.assertEqual(get_required_grades(instrument_class), (Grade.COVERAGE,)) def test_compatible_versions(self): """ @@ -217,6 +258,20 @@ def test_compatible_versions(self): self.assertFalse(is_compatible(InstrumentClass.LIDAR, 1)) self.assertTrue(is_compatible(InstrumentClass.LIDAR, 2)) self.assertFalse(is_compatible(InstrumentClass.PROFILER, 5)) + self.assertTrue(is_compatible(InstrumentClass.PUSHBROOM, 1, Grade.COVERAGE)) + self.assertFalse(is_compatible(InstrumentClass.PUSHBROOM, 7, Grade.SAMPLE_SIZE)) + self.assertTrue(is_compatible(InstrumentClass.PUSHBROOM, 8, Grade.SAMPLE_SIZE)) + self.assertFalse(is_compatible(InstrumentClass.LIDAR, 8, Grade.SAMPLE_SIZE)) + self.assertTrue(is_compatible(InstrumentClass.LIDAR, 9, Grade.SAMPLE_SIZE)) + self.assertTrue(is_compatible(InstrumentClass.LIDAR, 8, Grade.COVERAGE)) + self.assertFalse( + is_compatible(InstrumentClass.GEOSTATIONARY, 9, Grade.SAMPLE_SIZE) + ) + self.assertTrue( + is_compatible(InstrumentClass.GEOSTATIONARY, 10, Grade.SAMPLE_SIZE) + ) + self.assertFalse(is_compatible(InstrumentClass.SAR, 10, Grade.SAMPLE_SIZE)) + self.assertTrue(is_compatible(InstrumentClass.SAR, 11, Grade.SAMPLE_SIZE)) self.assertFalse( is_compatible(InstrumentClass.CROSS_TRACK, STANDARD_VERSION + 1) ) @@ -541,6 +596,34 @@ def test_class_added_after_version_is_partial(self): ).validation self.assertEqual(validation.tier, expected, version) + def test_only_optional_configurations(self): + """ + Test that an entry whose only configuration is at an optional grade has a + tier (nominal without a comparison, else partial, as it lacks the grades + its class requires), and that a result under a version before the grade's + names the grade in its gap. + """ + validation = _entry(grade="sample_size").validation + self.assertEqual(validation.tier, Tier.NOMINAL) + self.assertEqual(validation.missing_grades, (Grade.COVERAGE,)) + metrics = [ + {"name": "sample_size_within_3pct", "value": 100}, + {"name": "pixel_position_median", "value": 1}, + ] + validation = _entry( + metrics=metrics, grade="sample_size", record={"standard_version": 10} + ).validation + self.assertEqual(validation.configurations["c"].tier, Tier.VALIDATED) + self.assertEqual(validation.tier, Tier.PARTIAL) + validation = _entry( + metrics=metrics, grade="sample_size", record={"standard_version": 9} + ).validation + self.assertEqual(validation.configurations["c"].tier, Tier.PARTIAL) + self.assertIn( + "does not apply to the sample_size grade of the geostationary class", + validation.configurations["c"].gaps[-1], + ) + def test_grade_without_gates_invalid(self): """ Test that a configuration cannot use a grade its class does not have. diff --git a/tests/catalog/test_systems.py b/tests/catalog/test_systems.py index 3ef2f160..66009a25 100644 --- a/tests/catalog/test_systems.py +++ b/tests/catalog/test_systems.py @@ -657,6 +657,35 @@ def test_list_filters(self): with self.assertRaises(ValueError): list_systems(system_class="balloon") + def test_list_by_grade(self): + """ + Test that systems are selected by their tier for a use, the lowest of + their configurations that serve it: a system partial for the planes of its + orbits may be validated for its ground track, a ground track configuration + serves the plane grade, and a grade selects the systems with a + configuration for it. + """ + sentinel_1 = get_system("sentinel_1") + self.assertEqual(sentinel_1.get_tier().value, "partial") + self.assertEqual(sentinel_1.get_tier("ground_track").value, "validated") + # the plane grade takes the plane configuration, partial, as well + self.assertEqual(sentinel_1.get_tier("plane").value, "partial") + self.assertIsNone(sentinel_1.get_tier("siting")) + validated = [s.id for s in list_systems(tier="validated")] + for_tracks = [ + s.id for s in list_systems(tier="validated", grade="ground_track") + ] + self.assertIn("sentinel_1", for_tracks) + self.assertNotIn("sentinel_1", validated) + self.assertNotIn("gpm", for_tracks) + self.assertEqual([s.id for s in list_systems(grade="coverage")], ["nexrad"]) + self.assertEqual( + [s.id for s in list_systems(satellite=False, grade="siting")], + [s.id for s in list_systems(satellite=False)], + ) + with self.assertRaises(ValueError): + list_systems(grade="pixels") + def test_loaded_copies_independent(self): """ Test that changing a loaded system does not change later ones. diff --git a/tests/schemas/instrument/test_pointed.py b/tests/schemas/instrument/test_pointed.py index 6d9c5d58..ecb6889d 100644 --- a/tests/schemas/instrument/test_pointed.py +++ b/tests/schemas/instrument/test_pointed.py @@ -5,19 +5,29 @@ """ import unittest +import warnings from datetime import datetime, timedelta, timezone import numpy as np from pydantic import ValidationError +from pyproj import Proj +from shapely.geometry import Point from skyfield.api import EarthSatellite, wgs84 from tatc.constants import timescale -from tatc.schemas import Attitude, CircularOrbit, PointedInstrument +from tatc.schemas import ( + Attitude, + CircularOrbit, + GeosynchronousOrbit, + PointedInstrument, + Satellite, +) from tatc.utils import field_of_regard_to_swath_width, geodesic_distance from tatc.utils.projection import ( VelocityFrame, ViewGeometry, compute_ground_advance, + compute_incidence_angle, compute_projected_ray_position, compute_view_angles, ) @@ -1165,6 +1175,303 @@ def test_scan_pixel_positions(self): ) +class TestScanAlongFirst(unittest.TestCase): + """ + Unit tests for views in angles with the along-track angle first + (`ViewGeometry.SCAN_ALONG_FIRST`), as of the fixed grids of geostationary + imagers, against the geostationary projection of PROJ. + """ + + def setUp(self): + self.epoch = datetime(2026, 11, 8, 12, tzinfo=timezone.utc) + orbit = GeosynchronousOrbit(longitude=140.7, epoch=self.epoch, inclination=0) + self.satellite = Satellite(name="geo", orbit=orbit) + self.track = orbit.to_gp_orbit().get_orbit_track(self.epoch) + # the projection seen from the satellite's position + subpoint = wgs84.subpoint_of(self.track) + self.height = float(wgs84.height_of(self.track).m) + self.longitude = float(subpoint.longitude.degrees) + # a coarse grid of 11 by 11 pixels of 1 deg, within the Earth's disk (whose + # edge is about 8.7 deg from nadir) to its corners + self.pixels, self.angle = 11, 1.0 + + def grid(self, view_geometry: ViewGeometry): + """Gets the grid as a pointed instrument bound to the satellite.""" + field_of_view = self.pixels * self.angle + instrument = PointedInstrument( + name="grid", + field_of_regard=20, + cross_track_field_of_view=field_of_view, + along_track_field_of_view=field_of_view, + cross_track_pixels=self.pixels, + along_track_pixels=self.pixels, + is_rectangular=True, + view_geometry=view_geometry, + velocity_frame=VelocityFrame.INERTIAL, + ) + return self.satellite.model_copy( + update={"instruments": [instrument]} + ).get_instrument(0) + + def distance(self, instrument, sweep: str, row: int, column: int) -> float: + """ + Gets the distance (km) between a pixel (rows from the north, columns from + the west) and the point of its scan angles in the geostationary + projection with a sweep axis. + """ + geos = Proj( + proj="geos", h=self.height, lon_0=self.longitude, sweep=sweep, ellps="WGS84" + ) + center = (self.pixels - 1) / 2 + x = np.radians((column - center) * self.angle) * self.height + y = np.radians((center - row) * self.angle) * self.height + longitude, latitude = geos(x, y, inverse=True) + # TAT-C numbers pixels from the right of the motion (east): from the south, + # and from the east + pixel = instrument.compute_projected_pixel_position( + self.track, self.pixels - 1 - row, self.pixels - 1 - column + ) + return ( + geodesic_distance( + pixel.longitude.degrees, pixel.latitude.degrees, longitude, latitude + ) + / 1e3 + ) + + def test_fixed_grids(self): + """ + Test that pixels in scan geometry lie at the points of a grid that sweeps + about the x axis (as GOES-R's), and along track first at those of a grid + that sweeps about the y axis (as CGMS's), within about a kilometer, whereas + 4 deg from nadir in both directions the two orders differ by about 9 km. + """ + scan = self.grid(ViewGeometry.SCAN) + along_first = self.grid(ViewGeometry.SCAN_ALONG_FIRST) + for row, column in [(5, 5), (0, 5), (5, 10), (1, 1), (9, 2)]: + self.assertLess(self.distance(scan, "x", row, column), 1.0) + self.assertLess(self.distance(along_first, "y", row, column), 1.0) + self.assertGreater(self.distance(scan, "y", 1, 1), 5) + self.assertGreater(self.distance(along_first, "x", 1, 1), 5) + + def test_scan_line(self): + """ + Test that the two orders give the same pixels on the scan line (where the + along-track angle is zero). + """ + scan = self.grid(ViewGeometry.SCAN) + along_first = self.grid(ViewGeometry.SCAN_ALONG_FIRST) + for index in (0, 3, 10): + a = scan.compute_projected_pixel_position(self.track, index, 5) + b = along_first.compute_projected_pixel_position(self.track, index, 5) + self.assertAlmostEqual(a.latitude.degrees, b.latitude.degrees, places=8) + self.assertAlmostEqual(a.longitude.degrees, b.longitude.degrees, places=8) + + def test_field_of_view(self): + """ + Test that a pixel at a corner of the grid is in the field of view along + track first, and that one beyond its edge is not. + """ + along_first = self.grid(ViewGeometry.SCAN_ALONG_FIRST) + corner = along_first.compute_projected_pixel_position(self.track, 1, 1) + beyond = along_first.compute_projected_pixel_position(self.track, -1, 1) + for pixel, inside in [(corner, True), (beyond, False)]: + target = wgs84.latlon(pixel.latitude.degrees, pixel.longitude.degrees) + self.assertEqual( + along_first.is_in_field_of_view(self.track, target)[0], inside + ) + + def test_sample_spacing_follows_order(self): + """ + Test that, off the scan line and off nadir across track, the spacing that + each order predicts is that of its projected pixels (half the distance + between a pixel's neighbors), along and across track, on a grid as fine as + a geostationary imager's (whose steps are nearly linear on the ground). + """ + pixels, angle = 5500, np.degrees(55.888e-6) + for geometry in (ViewGeometry.SCAN, ViewGeometry.SCAN_ALONG_FIRST): + instrument = PointedInstrument( + name="grid", + field_of_regard=20, + cross_track_field_of_view=pixels * angle, + along_track_field_of_view=pixels * angle, + cross_track_pixels=pixels, + along_track_pixels=pixels, + is_rectangular=True, + view_geometry=geometry, + velocity_frame=VelocityFrame.INERTIAL, + ) + grid = self.satellite.model_copy( + update={"instruments": [instrument]} + ).get_instrument(0) + + def step(a, b): + p, q = ( + grid.compute_projected_pixel_position(self.track, *x) + for x in (a, b) + ) + return ( + geodesic_distance( + p.longitude.degrees, + p.latitude.degrees, + q.longitude.degrees, + q.latitude.degrees, + ) + / 2 + ) + + for i, j in [(1500, 1500), (2750, 1200), (1200, 2750)]: + center = grid.compute_projected_pixel_position(self.track, i, j) + target = wgs84.latlon(center.latitude.degrees, center.longitude.degrees) + along, cross = grid.compute_sample_spacing(self.track, target) + self.assertAlmostEqual( + float(along) / step((i, j - 1), (i, j + 1)), 1, delta=2e-4 + ) + self.assertAlmostEqual( + float(cross) / step((i - 1, j), (i + 1, j)), 1, delta=2e-4 + ) + + def test_view_angles_along_first_from_tilt(self): + """ + Test that the along-track angle along track first is measured from the + tilt, as in the other order. + """ + target = wgs84.subpoint_of(self.track) + _, untilted = compute_view_angles( + self.track, target, VelocityFrame.INERTIAL, along_first=True + ) + _, tilted = compute_view_angles( + self.track, target, VelocityFrame.INERTIAL, tilt_angle=5, along_first=True + ) + self.assertAlmostEqual(float(tilted), float(untilted) - 5, places=9) + + def test_footprint_contains_pixels(self): + """ + Test that the footprint along track first contains the grid's corner + pixels. + """ + along_first = self.grid(ViewGeometry.SCAN_ALONG_FIRST) + footprint = along_first.compute_footprint(self.track) + footprint = footprint[0] if isinstance(footprint, list) else footprint + for i, j in [(0, 0), (0, 10), (10, 0), (10, 10)]: + pixel = along_first.compute_projected_pixel_position(self.track, i, j) + self.assertTrue( + footprint.contains( + Point(pixel.longitude.degrees, pixel.latitude.degrees) + ) + ) + + +class TestRadarResolution(unittest.TestCase): + """ + Unit tests for the resolutions of a radar's samples (`range_resolution` and + `azimuth_resolution`), which replace the sizes of a pixel's angles, and for the + incidence angle at a target. + """ + + def setUp(self): + epoch = datetime(2026, 10, 1, tzinfo=timezone.utc) + orbit = CircularOrbit(altitude=693e3, inclination=98.18, epoch=epoch) + self.track = orbit.to_gp_orbit().get_orbit_track(epoch) + self.base = dict( + name="sar", + field_of_regard=90, + cross_track_field_of_view=5, + along_track_field_of_view=1, + roll_angle=-34, + is_rectangular=True, + ) + ray = compute_projected_ray_position(self.track, 0, 0, -34, 0) + self.target = wgs84.latlon(ray.latitude.degrees, ray.longitude.degrees) + + def test_incidence_angle(self): + """ + Test that the incidence angle is about zero at nadir, and that, off nadir, + it is that of the look angle on a sphere (within the ellipsoid's + difference). + """ + nadir = wgs84.subpoint_of(self.track) + self.assertAlmostEqual( + float(compute_incidence_angle(self.track, nadir)), 0, delta=0.01 + ) + radius = 6371e3 + height = float(wgs84.height_of(self.track).m) + expected = np.degrees( + np.arcsin((radius + height) / radius * np.sin(np.radians(34))) + ) + self.assertAlmostEqual( + float(compute_incidence_angle(self.track, self.target)), + expected, + delta=0.3, + ) + + def test_slant_range_resolution(self): + """ + Test that a slant range resolution is divided by the sine of the incidence + angle across track, and that the azimuth resolution is the size along track. + """ + instrument = PointedInstrument( + **self.base, range_resolution=12.6, azimuth_resolution=22.5 + ) + along, cross = instrument.compute_sample_size(self.track, self.target) + incidence = np.radians(compute_incidence_angle(self.track, self.target)) + self.assertAlmostEqual(float(along), 22.5) + self.assertAlmostEqual(float(cross), 12.6 / float(np.sin(incidence)), places=6) + + def test_ground_range_resolution(self): + """ + Test that a ground range resolution is the size across track wherever the + target is. + """ + instrument = PointedInstrument( + **self.base, + range_resolution=2000, + range_resolution_frame="ground", + azimuth_resolution=2000, + ) + along, cross = instrument.compute_sample_size(self.track, self.target) + self.assertEqual((float(along), float(cross)), (2000.0, 2000.0)) + + def test_resolutions_spacing_and_visibility(self): + """ + Test that the spacing of a radar's samples is not modeled (`NaN` in the + directions of its resolutions), that a target whose pixel's rays miss the + Earth has no size, and that a slant range resolution at nadir is infinite, + without a warning. + """ + instrument = PointedInstrument( + **self.base, range_resolution=12.6, azimuth_resolution=22.5 + ) + along, cross = instrument.compute_sample_spacing(self.track, self.target) + self.assertTrue(np.isnan(along) and np.isnan(cross)) + # near the limb (about 64.4 deg from nadir), where half the pixel's 5 deg + # across track misses the Earth + ray = compute_projected_ray_position(self.track, 0, 0, -63.5, 0) + near_limb = wgs84.latlon(ray.latitude.degrees, ray.longitude.degrees) + _, cross = instrument.compute_sample_size(self.track, near_limb) + self.assertTrue(np.isnan(cross)) + subpoint = wgs84.subpoint_of(self.track) + nadir = wgs84.latlon(subpoint.latitude.degrees, subpoint.longitude.degrees) + with warnings.catch_warnings(): + warnings.simplefilter("error") + _, cross = PointedInstrument( + **{**self.base, "roll_angle": 0}, range_resolution=12.6 + ).compute_sample_size(self.track, nadir) + self.assertGreater(float(cross), 1e6) + + def test_without_resolutions(self): + """ + Test that, without resolutions, the sizes are those of the pixel's angles, + and that a resolution replaces only its own direction. + """ + instrument = PointedInstrument(**self.base) + with_azimuth = PointedInstrument(**self.base, azimuth_resolution=10) + along, cross = instrument.compute_sample_size(self.track, self.target) + along_r, cross_r = with_azimuth.compute_sample_size(self.track, self.target) + self.assertGreater(float(along), 1000) + self.assertEqual(float(along_r), 10) + self.assertAlmostEqual(float(cross_r), float(cross)) + + class TestInstrumentYaw(unittest.TestCase): """ Unit tests for the yaw angle of a PointedInstrument: a rotation of its view diff --git a/validation/catalog/earthcare_io.py b/validation/catalog/earthcare_io.py index b38f8b2a..c45d3001 100644 --- a/validation/catalog/earthcare_io.py +++ b/validation/catalog/earthcare_io.py @@ -30,12 +30,15 @@ from validation_io import ( EARTH_ROTATION, TO_GEODETIC, + Footprints, RemoteFile, ecef, get_with_retries, + measure_along_spacing, normalize, recompute_passes, up, + validate_footprints, write_results, ) @@ -457,3 +460,23 @@ def check_time_scale( "track_offsets", "validate_profiler", ] + + +def validate_profiler_footprints(run, footprints: Footprints, profiles, orbit, tle): + """ + Scores the sample size configuration of a profiler (see + `validation_io.validate_footprints`): its footprint against the published ones, + and the spacing of its profiles along track against the product's. + """ + entry = run.entry + configuration = entry.configurations[footprints.key] + instrument = configuration.instruments[0].parameters + satellite = entry.build( + configuration=footprints.key, orbit=orbit, platform=run.platform + ).to_satellite(orbit, name=entry.name) + rows = measure_along_spacing( + profiles.seconds, profiles.lat, profiles.lon, instrument["scan_period"] + ) + validate_footprints( + footprints, run, satellite, [instrument["name"]] * len(rows), rows, tle + ) diff --git a/validation/catalog/scanner.py b/validation/catalog/scanner.py index 72adc6cb..9ee3b1f2 100644 --- a/validation/catalog/scanner.py +++ b/validation/catalog/scanner.py @@ -192,7 +192,8 @@ class Reference(ScanLattice): the start of the day) time the passes by beam. A day reduced to some of the product's lines and samples gives the samples' indices in the product (`pixel`), their number (`pixels`), and the lines from one kept scan to the next - (`line_stride`). + (`line_stride`). A scan that images several lines at once gives the index along + track of the line it keeps (`line`, from the first, by default). """ def __init__( @@ -230,6 +231,7 @@ def __init__( self.pixel = np.asarray(data.get("pixel", np.arange(self.beams))) self.pixels = int(data.get("pixels", self.beams)) self.line_stride = int(data.get("line_stride", 1)) + self.line = int(data.get("line", 0)) self.unit = up(self.lon, self.lat) period = np.diff(self.seconds) self.is_next_contiguous = period < 1.5 * scan_period @@ -592,9 +594,9 @@ def measure_pixels(reference: Reference, satellite, index: int, stride: int, fra """ Gets rows of seconds from the start of the day, pixel index, position difference (km) from the beam center, and the beam's latitude and longitude, for the pixels - projected at the times of a sample of scans. TAT-C numbers pixels from the right - of the motion, so each scan's beams are ordered by their side, which changes when - the spacecraft flies backward. + (of the reference's line along track) projected at the times of a sample of + scans. TAT-C numbers pixels from the right of the motion, so each scan's beams + are ordered by their side, which changes when the spacecraft flies backward. """ scans = np.arange(0, len(reference.time), stride) angles = reference.cross_track_angles(frame)[scans] @@ -614,7 +616,9 @@ def measure_pixels(reference: Reference, satellite, index: int, stride: int, fra track = orbit.get_orbit_track( list(reference.time[scans[subset]].to_pydatetime()) ) - position = instrument.compute_projected_pixel_position(track, int(value), 0) + position = instrument.compute_projected_pixel_position( + track, int(value), reference.line + ) difference = np.linalg.norm( np.atleast_2d( ecef(position.longitude.degrees, position.latitude.degrees) @@ -675,7 +679,10 @@ class Setup: """ What a script validates on a platform: the configurations of its swath and beams (or samples), the instrument and published footprints of its sample - sizes, its references, its fixture, and the parameters of its tests. + sizes, its references, its fixture, and the parameters of its tests. Published + footprints too few to test the sample size gate (such as those only at nadir) + are compared without recording the gate's metric (`gate_published`), so that + the configuration stays partial. """ swath: str @@ -694,6 +701,7 @@ class Setup: fixture_passes: int = 60 fixture_pixels: int = 200 fixture_spacing: int = 200 + gate_published: bool = True def validate_beams(setup: Setup, run, reference, orbit, tle) -> None: @@ -710,9 +718,17 @@ def validate_beams(setup: Setup, run, reference, orbit, tle) -> None: ) print( f"published dimensions: {within:.1f}% within 3%, largest error {largest:.2f}%" + + ("" if setup.gate_published else " (not gated)") ) + # the published comparison, as gated or only as its largest error + published = {"sample_size_within_3pct": within} if setup.gate_published else {} + # the period of the day, for a configuration that schedules its attitude satellite = entry.build( - configuration=setup.beams, orbit=orbit, platform=run.platform + configuration=setup.beams, + orbit=orbit, + platform=run.platform, + start=run.day, + end=run.day + timedelta(days=1), ).to_satellite(orbit, name=entry.name) names = [instrument.name for instrument in satellite.instruments] index = names.index(setup.size_instrument) @@ -746,13 +762,19 @@ def validate_beams(setup: Setup, run, reference, orbit, tle) -> None: "tle": np.array(tle), "day": np.array(run.day.isoformat()), "pixels": reduced, + # the line along track of the pixels, of a scan of several lines + **( + {"line": np.array(reference.line)} + if getattr(reference, "line", 0) + else {} + ), "spacing": rows[picks], "spacing_seconds": (times[picks] - pd.Timestamp(run.day)) .total_seconds() .to_numpy(), } fixture_metrics = { - "sample_size_within_3pct": within, + **(published or {"sample_size_largest_error": largest}), "pixel_position_median": summarize(reduced[:, 2])["median"], "spacing_along_ratio_median": fixture_along, "spacing_cross_ratio_median": fixture_cross, @@ -762,7 +784,7 @@ def validate_beams(setup: Setup, run, reference, orbit, tle) -> None: setup.beams, reference=setup.published_reference, metrics=[ - {"name": "sample_size_within_3pct", "value": within}, + *({"name": name, "value": value} for name, value in published.items()), {"name": "sample_size_largest_error", "value": largest}, {"name": "pixel_position_median", "value": median}, {"name": "pixel_position_p95", "value": p95}, diff --git a/validation/catalog/validate_catalog_abi.py b/validation/catalog/validate_catalog_abi.py index b8daca83..13400c7a 100644 --- a/validation/catalog/validate_catalog_abi.py +++ b/validation/catalog/validate_catalog_abi.py @@ -16,6 +16,12 @@ entry's validation record and the reduced fixture from which unit tests recompute the results. +It also validates the entry's sample size configuration (`pixels`), following +`validation_io.validate_fixed_grid`: the pixels of the fixed grid of the infrared +bands, projected from its nominal position, are compared with the grid of the clear +sky mask, and their spacing with the grid's; the published size at the sub-satellite +point, which the grid's angle defines, is compared without the gate. + @author: Paul T. Grogan """ @@ -35,7 +41,14 @@ from tatc.constants import timescale from tatc.schemas import GeneralPerturbationsOrbit, Point from tatc.utils import compute_field_of_regard -from validation_io import get_with_retries, parse_run, write_results +from validation_io import ( + FIXTURES, + FixedGrid, + get_with_retries, + parse_run, + validate_fixed_grid, + write_results, +) # NOAA's open archive of each platform's products BUCKETS = { @@ -49,6 +62,18 @@ "lst_good_quality": ("ABI-L2-LSTF", "LST", 1), } WGS84_A, WGS84_F = 6378137.0, 1 / 298.257223563 +# the fixed grid of the infrared bands, whose published size at the sub-satellite +# point (instrument, altitude in km, inclination in deg, scan angle in deg, and sizes +# east-west and north-south in km) the grid's angle defines, so is not gated +GRID = FixedGrid( + key="pixels", + instrument="ABI", + published_footprints=(("ABI", 35786.023, 0, 0, 2.0, 2.0),), + reference="Nadir resolution of the GOES-R Product Definition and Users' Guide " + "(not gated); fixed grid of ABI-L2-ACMF (2 km)", + fixture_path=FIXTURES / "abi_pixels.npz", + gate_published=False, +) def download( @@ -175,6 +200,16 @@ def main() -> None: fixture = {"tle": np.array(tle), "time": np.array(time.isoformat())} results = {} + if GRID.key in run.configurations: + with xr.open_dataset( + download(run.platform, "ABI-L2-ACMF", time, run.directory) + ) as dataset: + latitude, longitude = fixed_grid(dataset) + origin = float( + dataset.goes_imager_projection.attrs["longitude_of_projection_origin"] + ) + validate_fixed_grid(GRID, run, latitude, longitude, origin, time) + # earth disk: elevation angles, and which imaged pixels are observed key = "full_disk" with xr.open_dataset( diff --git a/validation/catalog/validate_catalog_ahi.py b/validation/catalog/validate_catalog_ahi.py index ec360989..eee832ed 100644 --- a/validation/catalog/validate_catalog_ahi.py +++ b/validation/catalog/validate_catalog_ahi.py @@ -17,6 +17,12 @@ validation record and the reduced fixture from which unit tests recompute the results. +It also validates the entry's sample size configuration (`pixels`), following +`validation_io.validate_fixed_grid`: the pixels of the fixed grid of the infrared +bands, projected from its nominal position, are compared with the pixel positions of +the cloud mask, and their spacing with the grid's; the published size at the +sub-satellite point, which the grid's angle defines, is compared without the gate. + @author: Paul T. Grogan """ @@ -40,13 +46,32 @@ predict, satellite_position, ) -from validation_io import get_with_retries, parse_run, write_results +from validation_io import ( + FIXTURES, + FixedGrid, + get_with_retries, + parse_run, + validate_fixed_grid, + write_results, +) BUCKET = "https://noaa-himawari9.s3.amazonaws.com/" PREFIX = "AHI-L2-FLDK-Clouds" # the nominal position of the fixed grid: longitude (deg) and height (m) GRID_LONGITUDE, GRID_HEIGHT = 140.7, 35785863.0 CHUNK_ROWS = 250 +# the fixed grid of the infrared bands, whose published size at the sub-satellite +# point (instrument, altitude in km, inclination in deg, scan angle in deg, and sizes +# east-west and north-south in km) the grid's angle defines, so is not gated +GRID = FixedGrid( + key="pixels", + instrument="AHI", + published_footprints=(("AHI", 35785.863, 0, 0, 2.0, 2.0),), + reference="Resolution at the sub-satellite point of JMA's Himawari Standard " + "Data User's Guide (not gated); pixel positions of AHI-L2-FLDK-Clouds (2 km)", + fixture_path=FIXTURES / "ahi_pixels.npz", + gate_published=False, +) def download(product: str, time: datetime, directory: pathlib.Path) -> pathlib.Path: @@ -131,6 +156,14 @@ def validate(run) -> None: fixture = {"tle": np.array(tle), "time": np.array(time.isoformat())} results = {} + if GRID.key in run.configurations: + with xr.open_dataset(download("CMSK", time, run.directory)) as dataset: + latitude = dataset.Latitude.values.astype(float) + longitude = dataset.Longitude.values.astype(float) + off_disk = (np.abs(latitude) > 90) | (np.abs(longitude) > 360) + latitude[off_disk] = longitude[off_disk] = np.nan + validate_fixed_grid(GRID, run, latitude, longitude, GRID_LONGITUDE, time) + # earth disk: elevation angles, and which imaged pixels are observed key = "full_disk" lat, lon, zenith, imaged = read_pixels( diff --git a/validation/catalog/validate_catalog_atlid.py b/validation/catalog/validate_catalog_atlid.py index d025d800..2e3e0990 100644 --- a/validation/catalog/validate_catalog_atlid.py +++ b/validation/catalog/validate_catalog_atlid.py @@ -15,6 +15,11 @@ python validation/catalog/validate_catalog_atlid.py 2026-09-27 --fit python validation/catalog/validate_catalog_atlid.py 2026-11-07 +It also validates the entry's sample size configuration (`footprints`), following +`validation_io.validate_footprints`: the spacing of profiles along track is compared +with that measured, which the gate tests, and the laser's published footprint, +without the gate. + Without a day, it takes that of the entry's record (or, with `--fit`, of the fit). The element set is the one nearest the middle of the day in `elements/earthcare_2026-09-27.3le` (or in a file given with `--elements`). With @@ -36,10 +41,22 @@ load_day, to_seconds, validate_profiler, + validate_profiler_footprints, ) -from validation_io import ecef, parse_run +from validation_io import FIXTURES, ecef, Footprints, parse_run CONFIGURATION = "profile" +# published footprints at nadir: instrument, altitude (km), inclination (deg), scan +# angle (deg), and sizes along and across track (km), of the laser on ESA's ATLID +# page, which states no definition, compared without the gate +PUBLISHED_FOOTPRINTS = (("ATLID", 393, 97.05, 0, 0.015, 0.015),) +FOOTPRINTS = Footprints( + key="footprints", + published_footprints=PUBLISHED_FOOTPRINTS, + reference="Laser footprint of ESA's ATLID page (not gated); profile spacing of ATL_NOM_1B", + fixture_path=FIXTURES / "atlid.npz", + gate_published=False, +) def read_atlid(f, day: datetime) -> dict: @@ -74,14 +91,17 @@ def main() -> None: tle = run.element_set() print(f"element set: {tle[0][:32]}", flush=True) orbit = GeneralPerturbationsOrbit.from_tle(tle) - validate_profiler( - run, - CONFIGURATION, - profiles, - orbit, - tle, - "ATL_NOM_1B (profile positions and times)", - ) + if FOOTPRINTS.key in run.configurations: + validate_profiler_footprints(run, FOOTPRINTS, profiles, orbit, tle) + if CONFIGURATION in run.configurations: + validate_profiler( + run, + CONFIGURATION, + profiles, + orbit, + tle, + "ATL_NOM_1B (profile positions and times)", + ) if __name__ == "__main__": diff --git a/validation/catalog/validate_catalog_bbr.py b/validation/catalog/validate_catalog_bbr.py index 3a3dcbd8..2ccc6b79 100644 --- a/validation/catalog/validate_catalog_bbr.py +++ b/validation/catalog/validate_catalog_bbr.py @@ -21,6 +21,12 @@ python validation/catalog/validate_catalog_bbr.py 2026-09-27 --fit-view python validation/catalog/validate_catalog_bbr.py 2026-11-07 +It also validates the entry's sample size configuration (`pixels`), following +`ValidateSampleSizes`: sizes are compared with the footprints of the nadir and +slanted views published in Wehr et al. (2023), which the gate tests, and the +projected pixels of the nadir view with the product's, and their spacing with that +measured. + Without a day, it takes that of the entry's record (or, with `--fit`, of the fit; `--fit-view` needs its day). The element set is the one nearest the middle of the day in `elements/earthcare_2026-09-27.3le` (or in a file given with `--elements`). With @@ -42,13 +48,16 @@ from scanner import ( GATED, Reference, + Setup, fit, fit_view, fit_yaw, observe_orbit, score_swath_width, + validate_beams, ) from validation_io import ( + FIXTURES, build_grid, parse_run, pick_passes, @@ -72,6 +81,29 @@ GAP_THRESHOLD = 1.0 # s FIXTURE_PASSES = 60 WIDTH_STRIDE = 50 +# published footprints: instrument, altitude (km), inclination (deg), scan angle +# (deg), sizes along and across track (km), and angle along track (deg), from +# section 5.4 of Wehr et al. (2023), at the mission's nominal mean spherical +# altitude, for the slanted views at their nominal 50 deg +PUBLISHED_FOOTPRINTS = ( + ("BBR nadir", 393, 97.05, 0, 0.64, 0.64), + ("BBR aft", 393, 97.05, 0, 1.876, 1.069, -50.3554), + ("BBR fore", 393, 97.05, 0, 1.876, 1.069, 50.1645), +) +PIXELS_SETUP = Setup( + swath=CONFIGURATION, + beams="pixels", + size_instrument="BBR nadir", + published_footprints=PUBLISHED_FOOTPRINTS, + fixture_path=FIXTURES / "bbr.npz", + reference=f"{PRODUCT} (pixel positions of the shortwave band)", + published_reference="Footprints of Wehr et al. (2023); pixel positions of the " + f"nadir view of {PRODUCT} (shortwave band, every {LINE_STRIDE}nd line)", + time_steps=TIME_STEPS, + pass_radius=PASS_RADIUS, + pixel_stride=20, + spacing_stride=40, +) def read_bbr(f, day: datetime) -> dict: @@ -107,6 +139,7 @@ def load_references(day: datetime, directory: pathlib.Path) -> dict[str, Referen "sc_lat": data[f"sc_lat_{view}"][keep], "sc_lon": data[f"sc_lon_{view}"][keep], "sc_alt": data[f"sc_alt_{view}"][keep], + "line_stride": LINE_STRIDE, } period = float(np.median(np.diff(part["time"]))) references[view] = Reference(day, part, period, GAP_THRESHOLD) @@ -216,7 +249,10 @@ def main() -> None: tle = run.element_set() print(f"element set: {tle[0][:32]}", flush=True) orbit = GeneralPerturbationsOrbit.from_tle(tle) - validate(run, orbit, tle, references) + if PIXELS_SETUP.beams in run.configurations: + validate_beams(PIXELS_SETUP, run, references["NADIR"], orbit, tle) + if CONFIGURATION in run.configurations: + validate(run, orbit, tle, references) if __name__ == "__main__": diff --git a/validation/catalog/validate_catalog_ceres.py b/validation/catalog/validate_catalog_ceres.py index 6071b565..0ce297b5 100644 --- a/validation/catalog/validate_catalog_ceres.py +++ b/validation/catalog/validate_catalog_ceres.py @@ -27,6 +27,12 @@ python validation/catalog/validate_catalog_ceres.py 2026-07-25 --platform suomi-npp --fit python validation/catalog/validate_catalog_ceres.py 2026-06-20 --platform suomi-npp +It also validates the platform's sample size configuration (`beams_noaa_20` or +`beams_suomi_npp`), following `ValidateSampleSizes`: the projected pixels are +compared with the footprints' positions, and their spacing with that measured. The +only published footprints, of the optical field of view at nadir in the CERES ATBD +(for TRMM and EOS), are compared without the gate. + Without a day, it takes that of the platform's record (or, with `--fit`, of the fit). @@ -47,7 +53,7 @@ from pyhdf.SD import SD, SDC from tatc.schemas import GeneralPerturbationsOrbit -from scanner import Reference, Setup, fit, fit_yaw, validate_swath +from scanner import Reference, Setup, fit, fit_yaw, validate_beams, validate_swath from validation_io import ( FIXTURES, TO_GEODETIC, @@ -67,6 +73,7 @@ class Product: short_name: str version: str configuration: str + beams: str fixture_path: pathlib.Path prefix: str @@ -76,6 +83,7 @@ class Product: "CER_ES8_NOAA20-FM6", "Edition1", "swath_noaa_20", + "beams_noaa_20", FIXTURES / "ceres.npz", "", ), @@ -83,6 +91,7 @@ class Product: "CER_ES8_NPP-FM5", "Edition2", "swath_suomi_npp", + "beams_suomi_npp", FIXTURES / "ceres_suomi_npp.npz", "npp_", ), @@ -96,6 +105,15 @@ class Product: TOA_HEIGHT = 30e3 # m WGS84_A, WGS84_F = 6378137.0, 1 / 298.257223563 JULIAN_UNIX_EPOCH = 2440587.5 +# published footprints of the optical field of view at nadir: instrument, altitude +# (km), inclination (deg), scan angle (deg), and sizes along and across track (km), +# from Table 4.4-1 of the CERES ATBD Subsystem 4.4 (for TRMM and EOS, whose sizes +# along the scan are across track in the cross-track mode); none are published at +# other angles or for this orbit, so they are compared without the gate +PUBLISHED_FOOTPRINTS = ( + ("CERES", 350, 35, 0, 16, 8), + ("CERES", 705, 98.2, 0, 32, 16), +) def download(day: datetime, directory: pathlib.Path, product: Product) -> pathlib.Path: @@ -225,16 +243,19 @@ def make_setup(platform: str) -> Setup: product = PRODUCTS[platform] return Setup( swath=product.configuration, - beams=None, - size_instrument=None, - published_footprints=(), + beams=product.beams, + size_instrument="CERES", + published_footprints=PUBLISHED_FOOTPRINTS, fixture_path=product.fixture_path, reference=f"{product.short_name} {product.version} (footprint positions, " "projected to the ellipsoid, and times)", - published_reference="", + published_reference="Nadir footprints of the CERES ATBD Subsystem 4.4 " + f"(not gated); footprint positions of {product.short_name} " + f"{product.version}, projected to the ellipsoid", time_steps=(RECORD_PERIOD, 30, 120), pass_radius=60, point_spacing=200e3, + gate_published=False, ) @@ -264,6 +285,8 @@ def main() -> None: entry = run.entry default = entry.configurations[entry.default_configuration].platforms[0] setup = make_setup(default if run.transfer else run.platform) + if setup.beams in run.configurations: + validate_beams(setup, run, reference, orbit, tle) if setup.swath in run.configurations: validate_swath(setup, run, reference, orbit, tle) diff --git a/validation/catalog/validate_catalog_cpr.py b/validation/catalog/validate_catalog_cpr.py index be652dba..8f2ce903 100644 --- a/validation/catalog/validate_catalog_cpr.py +++ b/validation/catalog/validate_catalog_cpr.py @@ -15,6 +15,11 @@ python validation/catalog/validate_catalog_cpr.py 2026-09-27 --fit python validation/catalog/validate_catalog_cpr.py 2026-11-07 +It also validates the entry's sample size configuration (`footprints`), following +`validation_io.validate_footprints`: the spacing of profiles along track is compared +with that measured, which the gate tests, and the published footprint, without the +gate. + Without a day, it takes that of the entry's record (a fit needs its day). The element set is the one nearest the middle of the day in `elements/earthcare_2026-09-27.3le` (or in a file given with `--elements`). With @@ -36,10 +41,22 @@ load_day, to_seconds, validate_profiler, + validate_profiler_footprints, ) -from validation_io import parse_run +from validation_io import FIXTURES, Footprints, parse_run CONFIGURATION = "nadir" +# published footprints at nadir: instrument, altitude (km), inclination (deg), scan +# angle (deg), and sizes along and across track (km), on eoPortal, which states the +# along-track size of a profile rather than of the beam, compared without the gate +PUBLISHED_FOOTPRINTS = (("CPR", 393.14, 97.05, 0, 1.0, 0.65),) +FOOTPRINTS = Footprints( + key="footprints", + published_footprints=PUBLISHED_FOOTPRINTS, + reference="Footprint on eoPortal (not gated); profile spacing of CPR_NOM_1B", + fixture_path=FIXTURES / "cpr.npz", + gate_published=False, +) def read_cpr(f, day: datetime) -> dict: @@ -72,14 +89,17 @@ def main() -> None: tle = run.element_set() print(f"element set: {tle[0][:32]}", flush=True) orbit = GeneralPerturbationsOrbit.from_tle(tle) - validate_profiler( - run, - CONFIGURATION, - profiles, - orbit, - tle, - "CPR_NOM_1B (profile positions and times)", - ) + if FOOTPRINTS.key in run.configurations: + validate_profiler_footprints(run, FOOTPRINTS, profiles, orbit, tle) + if CONFIGURATION in run.configurations: + validate_profiler( + run, + CONFIGURATION, + profiles, + orbit, + tle, + "CPR_NOM_1B (profile positions and times)", + ) if __name__ == "__main__": diff --git a/validation/catalog/validate_catalog_csar.py b/validation/catalog/validate_catalog_csar.py index 2abe0f8a..a401bf91 100644 --- a/validation/catalog/validate_catalog_csar.py +++ b/validation/catalog/validate_catalog_csar.py @@ -33,6 +33,12 @@ With `--platform sentinel-1d`, it tests the same values on a sibling satellite, and adds the results to the record as a transfer, which does not count toward the tier. +It also validates the entry's resolution configuration (`resolution_iw`, run with +`--configuration resolution_iw`): the resolutions of the IW sub-swaths, derived from +the look bandwidths and windows of the ground range detected product, are compared +with the resolutions of the Sentinel-1 Product Definition (Table 7-6), which the +gate tests. + @author: Paul T. Grogan """ @@ -60,14 +66,28 @@ to_utc, ) from validation_io import ( + compute_published_errors, ecef, get_with_retries, parse_run, post_with_retries, recompute_passes, + score_published, write_results, ) +# published resolutions of the sub-swaths of the IW mode's ground range detected high +# resolution product: instrument, altitude (km), inclination (deg), roll (deg, the +# look angle of the sub-swath's incidence angle), and resolutions in azimuth and +# ground range (km), from Table 7-6 of the Sentinel-1 Product Definition +# (S1-RS-MDA-52-7440 v2.13) +RESOLUTIONS = { + "resolution_iw": ( + ("C-SAR IW1", 693, 98.18, -29.3332, 0.0225, 0.0204), + ("C-SAR IW2", 693, 98.18, -33.9851, 0.0226, 0.0203), + ("C-SAR IW3", 693, 98.18, -38.0423, 0.0226, 0.0205), + ), +} STAC_URL = "https://planetarycomputer.microsoft.com/api/stac/v1/search" TOKEN_URL = "https://planetarycomputer.microsoft.com/api/sas/v1/token/sentinel-1-grd" @@ -435,6 +455,30 @@ def satellite_for(time_step: float): ) +def validate_resolution(run, key: str) -> None: + """ + Scores a resolution configuration against the published resolutions, and writes + its results if the run writes. + """ + within, largest = score_published( + compute_published_errors(run.entry, key, RESOLUTIONS[key]) + ) + print( + f"published resolutions: {within:.1f}% within 3%, largest error {largest:.2f}%" + ) + if run.write: + write_results( + run, + key, + reference="Resolutions of the Sentinel-1 Product Definition " + "(S1-RS-MDA-52-7440 v2.13), Table 7-6 (IW GRDH)", + metrics=[ + {"name": "sample_size_within_3pct", "value": within}, + {"name": "sample_size_largest_error", "value": largest}, + ], + ) + + def main() -> None: """Fits or validates the entry on a day of data.""" run = parse_run( @@ -456,7 +500,12 @@ def main() -> None: fit(products, orbit, run.day) return for key in run.configurations: - validate_mode(run, key, tle, orbit, products) + if key in RESOLUTIONS: + # compared with published tables, so not a transfer to a platform + if not run.transfer: + validate_resolution(run, key) + else: + validate_mode(run, key, tle, orbit, products) if __name__ == "__main__": diff --git a/validation/catalog/validate_catalog_ecostress.py b/validation/catalog/validate_catalog_ecostress.py index 4bad65c1..1ac325fa 100644 --- a/validation/catalog/validate_catalog_ecostress.py +++ b/validation/catalog/validate_catalog_ecostress.py @@ -20,6 +20,11 @@ python validation/catalog/validate_catalog_ecostress.py 2026-10-04 --fit --fit-view python validation/catalog/validate_catalog_ecostress.py 2026-11-08 +It also validates the entry's sample size configuration (`beams`), following +`ValidateSampleSizes`: the projected pixels of the middle line of a sweep are +compared with the samples' positions, and their spacing with that measured. The only +published pixel, at nadir in the L1 Calibration ATBD, is compared without the gate. + Without a day, it takes that of the entry's record (or, with `--fit`, of the fit). With `--fit-view`, it centers the view in TAT-C's frame, with the entry's yaw and pitch, instead of fitting the scan's angles. ECOSTRESS images scenes over land and @@ -50,6 +55,7 @@ fit, fit_view, fit_yaw, + validate_beams, validate_swath, ) from validation_io import ( @@ -70,6 +76,12 @@ SAMPLES = 5400 COLUMNS = np.r_[0:SAMPLES:SAMPLE_STRIDE, SAMPLES - 1] J2000 = 2451545.0 +# the published pixel at nadir: instrument, altitude (km), inclination (deg), scan +# angle (deg), sizes along and across track (km), and angle along track (deg), from +# Table 1 of the L1 Calibration ATBD, compared without the gate, as no other is +# published; at the center of the scan line, which the body's pitch places behind +# nadir +PUBLISHED_FOOTPRINTS = (("ECOSTRESS", 400, 51.6, 0, 0.0753, 0.06851, -7.2427),) def read_scene(url: str, session, day: datetime) -> dict: @@ -150,16 +162,19 @@ def load_day(day: datetime, directory: pathlib.Path) -> dict: SETUP = Setup( swath="swath", - beams=None, - size_instrument=None, - published_footprints=(), + beams="beams", + size_instrument="ECOSTRESS", + published_footprints=PUBLISHED_FOOTPRINTS, fixture_path=FIXTURES / "ecostress.npz", reference="ECO_L1B_GEO version 002 (sample positions and times of every fourth " "sweep, in blocks of eight consecutive scenes of every 32)", - published_reference="", + published_reference="Nadir pixel of the ECOSTRESS L1 Calibration ATBD (not " + "gated); sample positions of ECO_L1B_GEO version 002 (the middle line of every " + "fourth sweep)", time_steps=(10, 30, 120), pass_radius=20, point_spacing=100e3, + gate_published=False, ) @@ -175,7 +190,13 @@ def main() -> None: ), ) data = load_day(run.day, run.directory) - data.update(pixel=COLUMNS, pixels=SAMPLES, line_stride=SWEEP_STRIDE) + # the middle line of each kept sweep, of the lines a sweep images at once + data.update( + pixel=COLUMNS, + pixels=SAMPLES, + line_stride=SWEEP_STRIDE * LINES_PER_SWEEP, + line=LINES_PER_SWEEP // 2, + ) reference = Reference(run.day, data, SWEEP_STRIDE * SWEEP_PERIOD) print( f"{run.day:%Y-%m-%d}: {len(reference.time)} sweeps from {reference.time[0]}, " @@ -194,7 +215,10 @@ def main() -> None: tle = run.element_set() print(f"element set: {tle[0][:32]}", flush=True) orbit = GeneralPerturbationsOrbit.from_tle(tle) - validate_swath(SETUP, run, reference, orbit, tle) + if SETUP.beams in run.configurations: + validate_beams(SETUP, run, reference, orbit, tle) + if SETUP.swath in run.configurations: + validate_swath(SETUP, run, reference, orbit, tle) if __name__ == "__main__": diff --git a/validation/catalog/validate_catalog_emit.py b/validation/catalog/validate_catalog_emit.py index ede7c081..323a27dc 100644 --- a/validation/catalog/validate_catalog_emit.py +++ b/validation/catalog/validate_catalog_emit.py @@ -17,6 +17,11 @@ python validation/catalog/validate_catalog_emit.py 2026-10-04 --fit --fit-view python validation/catalog/validate_catalog_emit.py 2026-11-08 +It also validates the entry's sample size configuration (`pixels`), following +`ValidateSampleSizes`: the projected pixels are compared with the product's, and +their spacing with that measured. The only published pixel, at nadir in the EMIT L1B +ATBD, is compared without the gate. + Without a day, it takes that of the entry's record (or, with `--fit`, of the fit). With `--fit-view`, it centers the view in TAT-C's frame, with the entry's yaw and pitch, instead of fitting the view's angles. @@ -46,10 +51,20 @@ from tatc.analysis import compute_ground_track from tatc.catalog.metrics import summarize from tatc.schemas import GeneralPerturbationsOrbit -from scanner import Product, Reference, find_granules, fit, fit_view, fit_yaw +from scanner import ( + Product, + Reference, + Setup, + find_granules, + fit, + fit_view, + fit_yaw, + validate_beams, +) from validate_catalog_ecostress import read_ephemeris from validate_catalog_oco2 import area, find_epochs, observed_strip, score_width from validation_io import ( + FIXTURES, TO_GEODETIC, RemoteFile, login_earthdata, @@ -71,6 +86,24 @@ # segments of the runs of scenes (s, a multiple of the time steps), and the lines of # a segment's strip (every 4th line read, about 0.6 s apart) SEGMENT, SEGMENT_LINE_STRIDE = 120, 4 +# the published pixel at nadir: instrument, altitude (km), inclination (deg), scan +# angle (deg), sizes along and across track (km), and angle along track (deg), from +# the EMIT L1B ATBD, compared without the gate, as no other is published; at the +# center of the line, which the body's pitch places behind nadir +PUBLISHED_FOOTPRINTS = (("EMIT", 400, 51.6, 0, 0.068, 0.062, -7.5608),) +PIXELS_SETUP = Setup( + swath=CONFIGURATION, + beams="pixels", + size_instrument="EMIT", + published_footprints=PUBLISHED_FOOTPRINTS, + fixture_path=FIXTURES / "emit.npz", + reference="EMITL1BRAD version 002 (pixel positions and times)", + published_reference="Nadir pixel of the EMIT L1B ATBD (not gated); pixel " + "positions of EMITL1BRAD version 002 (every 16th line and 25th pixel)", + time_steps=TIME_STEPS, + pass_radius=20, + gate_published=False, +) def read_scene(url: str, session, day: datetime) -> dict: @@ -310,7 +343,10 @@ def main() -> None: tle = run.element_set() print(f"element set: {tle[0][:32]}", flush=True) orbit = GeneralPerturbationsOrbit.from_tle(tle) - validate(run, tle, orbit, reference) + if PIXELS_SETUP.beams in run.configurations: + validate_beams(PIXELS_SETUP, run, reference, orbit, tle) + if CONFIGURATION in run.configurations: + validate(run, tle, orbit, reference) if __name__ == "__main__": diff --git a/validation/catalog/validate_catalog_fci.py b/validation/catalog/validate_catalog_fci.py index 110cc755..86250534 100644 --- a/validation/catalog/validate_catalog_fci.py +++ b/validation/catalog/validate_catalog_fci.py @@ -12,6 +12,12 @@ surface temperature, the zenith angles the product gives), and running on a scan at least 30 days from the fit tests them on data held out from it. +It also validates the entry's sample size configuration (`pixels`), following +`validation_io.validate_fixed_grid`: the pixels of the fixed grid of the infrared +bands, projected from its nominal position, are compared with the grid of the cloud +mask, and their spacing with the grid's; the published sampling distance at the +sub-satellite point, which the grid's angle defines, is compared without the gate. + Needs the `validation` extra and a login to the EUMETSAT Data Store (`eumdac auth --interactive`): @@ -46,7 +52,14 @@ predict, satellite_position, ) -from validation_io import download_eumetsat, parse_run, write_results +from validation_io import ( + FIXTURES, + FixedGrid, + download_eumetsat, + parse_run, + validate_fixed_grid, + write_results, +) # the products of each configuration: collection, the text of the names of a scan's # products (from its start), and the file of each product @@ -59,6 +72,41 @@ BOUNDS = {"lst_retrieved": 70.0, "sst_acceptable_quality": 65.0} # the nominal position of the satellite, over the equator at 0 deg longitude NOMINAL_HEIGHT = 35786400.0 +# the fixed grid of the infrared bands, whose published spatial sampling distance at +# the sub-satellite point (instrument, altitude in km, inclination in deg, scan angle +# in deg, and sizes east-west and north-south in km) the grid's angle defines, so is +# not gated +GRID = FixedGrid( + key="pixels", + instrument="FCI", + published_footprints=(("FCI", 35786.4, 0, 0, 2.0, 2.0),), + reference="Spatial sampling distance of the MTG End User Requirements Document " + "(not gated); fixed grid of the FCI Level 2 cloud mask (EO:EUM:DAT:0678, 2 km)", + fixture_path=FIXTURES / "fci_pixels.npz", + gate_published=False, +) + + +def oriented_grid(dataset) -> tuple[np.ndarray, np.ndarray, float]: + """ + Gets the latitudes and longitudes (deg) of every pixel of the fixed grid, with + rows from the north and columns from the west, and its longitude (deg). + """ + latitude, longitude = fixed_grid(dataset, 1) + name = next( + v + for v in dataset.variables + if getattr(dataset[v], "grid_mapping_name", "") == "geostationary" + ) + origin = float(dataset[name].longitude_of_projection_origin) + quarter = latitude.shape[0] // 4 + if np.nanmean(latitude[:quarter]) < np.nanmean(latitude[-quarter:]): + latitude, longitude = latitude[::-1], longitude[::-1] + middle = latitude.shape[0] // 2 + east = (longitude[middle] - origin + 180) % 360 - 180 + if np.nanmean(east[:quarter]) > np.nanmean(east[-quarter:]): + latitude, longitude = latitude[:, ::-1], longitude[:, ::-1] + return latitude, longitude, origin def download(product: tuple, time: datetime, directory: pathlib.Path) -> pathlib.Path: @@ -167,6 +215,11 @@ def main() -> None: fixture = {"tle": np.array(tle), "time": np.array(time.isoformat())} results = {} + if GRID.key in run.configurations: + with netCDF4.Dataset(download(CLOUD_MASK, time, run.directory)) as dataset: + latitude, longitude, origin = oriented_grid(dataset) + validate_fixed_grid(GRID, run, latitude, longitude, origin, time) + # earth disk: elevation angles, and which imaged pixels are observed key = "full_disk" with netCDF4.Dataset(download(CLOUD_MASK, time, run.directory)) as dataset: diff --git a/validation/catalog/validate_catalog_gedi.py b/validation/catalog/validate_catalog_gedi.py index 14bc050f..3403153b 100644 --- a/validation/catalog/validate_catalog_gedi.py +++ b/validation/catalog/validate_catalog_gedi.py @@ -25,6 +25,11 @@ python validation/catalog/validate_catalog_gedi.py 2026-05-01 --fit python validation/catalog/validate_catalog_gedi.py 2026-06-08 +It also validates the entry's sample size configuration (`footprints`), following +`validation_io.validate_footprints`: the spacing of each beam's shots along track is +compared with that measured, which the gate tests, and the published footprint, the +divergence's, without the gate. + Without a day, it takes that of the entry's record (or, with `--fit`, of the fit). With `--write`, it writes the entry's validation record and the reduced fixture from which unit tests recompute the results. @@ -44,16 +49,32 @@ from tatc.schemas import GeneralPerturbationsOrbit from validate_catalog_atlas import add_offsets, score_views, track_bearings, write_views from validation_io import ( + FIXTURES, + Footprints, RemoteFile, ecef, get_with_retries, login_earthdata, + measure_along_spacing, parse_run, up, + validate_footprints, ) CONFIGURATION = "beams" SHORT_NAME, VERSION = "GEDI01_B", "003" +# published footprints at nadir: instrument, altitude (km), inclination (deg), scan +# angle (deg), and sizes along and across track (km), of Dubayah et al. (2020), the +# divergence's at the nominal altitude, compared without the gate +PUBLISHED_FOOTPRINTS = (("GEDI BEAM0101", 410, 51.6, 0, 0.023, 0.023),) +FOOTPRINTS = Footprints( + key="footprints", + published_footprints=PUBLISHED_FOOTPRINTS, + reference=f"Footprint of Dubayah et al. (2020) (not gated); shot spacing of " + f"{SHORT_NAME} version {VERSION} (every 200th shot of each beam)", + fixture_path=FIXTURES / "gedi.npz", + gate_published=False, +) # the beams, as the product names them, from left to right of the ground track (as # measured on the fitting day) BEAMS = ( @@ -258,6 +279,34 @@ def score_spacing(entry, shots: pd.DataFrame) -> float: return float(np.median(errors)) +def validate_shot_spacing(run, orbit, tle, shots: pd.DataFrame) -> None: + """ + Scores the footprints configuration: the published footprint, and the spacing of + each beam's shots along track (every 200th shot, over 200 shot periods). + """ + entry = run.entry + satellite = entry.build( + configuration=FOOTPRINTS.key, orbit=orbit, platform=run.platform + ).to_satellite(orbit, name=entry.name) + period = ( + entry.configurations[FOOTPRINTS.key].instruments[0].parameters["scan_period"] + ) + rows, names = [], [] + for (_, beam), group in shots.groupby(["file", "beam"]): + group = group.sort_values("gps_seconds") + seconds = (group.time - pd.Timestamp(run.day)).dt.total_seconds().to_numpy() + part = measure_along_spacing( + seconds, + group.latitude.to_numpy(), + group.longitude.to_numpy(), + SHOT_STRIDE * period, + SHOT_STRIDE, + ) + rows.append(part) + names += [f"GEDI {beam}"] * len(part) + validate_footprints(FOOTPRINTS, run, satellite, names, np.concatenate(rows), tle) + + def main() -> None: """Validates the entry on a day of data, or fits its views.""" run = parse_run("gedi", __doc__) @@ -272,6 +321,10 @@ def main() -> None: if run.fit: fit(shots, orbit) return + if FOOTPRINTS.key in run.configurations: + validate_shot_spacing(run, orbit, tle, shots) + if CONFIGURATION not in run.configurations: + return scored = score_views(run, CONFIGURATION, orbit, shots, BEAMS, SAMPLE_PER_BEAM) spacing = score_spacing(run.entry, shots) if run.write: diff --git a/validation/catalog/validate_catalog_iasi_ng.py b/validation/catalog/validate_catalog_iasi_ng.py index d01cb8f7..f72b2f58 100644 --- a/validation/catalog/validate_catalog_iasi_ng.py +++ b/validation/catalog/validate_catalog_iasi_ng.py @@ -18,6 +18,11 @@ python validation/catalog/validate_catalog_iasi_ng.py 2026-10-19 --fit python validation/catalog/validate_catalog_iasi_ng.py 2026-11-18 +It also validates the entry's sample size configuration (`fields_of_regard`), +following `ValidateSampleSizes`: the projected pixels are compared with the centers +of the fields of regard, and their spacing with that measured. The only published +pixel, at nadir in the IASI-NG Science Plan, is compared without the gate. + Without a day, it takes that of the entry's record (or, with `--fit`, of the fit). The element sets are those of the files in `elements/` (or of a file given with `--elements`). With `--write`, it writes the entry's validation record and the reduced @@ -34,7 +39,7 @@ from tatc.constants import timescale from tatc.schemas import GeneralPerturbationsOrbit -from scanner import Reference, Setup, fit, validate_swath +from scanner import Reference, Setup, fit, validate_beams, validate_swath from validation_io import ( FIXTURES, TO_GEODETIC, @@ -48,18 +53,29 @@ SCAN_PERIOD = 15.561 # the hours read from the start of a day, about two orbits HOURS = 3.5 +# the published pixel at nadir: instrument, altitude (km), inclination (deg), scan +# angle (deg), and sizes along and across track (km), from Table 2.1 of the IASI-NG +# Science Plan (which states no altitude), compared without the gate, as the pixel +# width comes from it +PUBLISHED_FOOTPRINTS = (("IASI-NG", 835, 98.7, 0, 12, 12),) SETUP = Setup( swath="swath", - beams=None, - size_instrument=None, - published_footprints=(), + beams="fields_of_regard", + size_instrument="IASI-NG", + published_footprints=PUBLISHED_FOOTPRINTS, fixture_path=FIXTURES / "iasi_ng.npz", reference="IASI-NG Level 1c (EO:EUM:DAT:0892, BUFR), centers of the fields of " f"regard, first {HOURS} hours of the day", - published_reference="", + published_reference="Nadir pixel of the IASI-NG Science Plan (not gated); " + "centers of the fields of regard of the IASI-NG Level 1c (EO:EUM:DAT:0892, " + f"BUFR), first {HOURS} hours of the day", time_steps=(SCAN_PERIOD, 32, 128), pass_radius=150, point_spacing=500e3, + # a few hours of scans of 14 fields of regard + pixel_stride=10, + spacing_stride=20, + gate_published=False, ) @@ -171,7 +187,10 @@ def main() -> None: for frame in ("earth_fixed", "inertial"): fit(reference, frame) return - validate_swath(SETUP, run, reference, orbit, tle) + if SETUP.beams in run.configurations: + validate_beams(SETUP, run, reference, orbit, tle) + if SETUP.swath in run.configurations: + validate_swath(SETUP, run, reference, orbit, tle) if __name__ == "__main__": diff --git a/validation/catalog/validate_catalog_mws.py b/validation/catalog/validate_catalog_mws.py index 78427165..d3b127bd 100644 --- a/validation/catalog/validate_catalog_mws.py +++ b/validation/catalog/validate_catalog_mws.py @@ -15,6 +15,12 @@ python validation/catalog/validate_catalog_mws.py 2026-10-19 --fit python validation/catalog/validate_catalog_mws.py 2026-11-18 +It also validates the entry's sample size configuration (`beams`), following +`ValidateSampleSizes`: sizes are compared with the footprints published in the +EPS-SG MWS Science Plan, which the gate tests, the projected pixels with the +positions of the fields of view, and their spacing with that measured. +`--configuration beams` (or `swath`) tests one configuration. + Without a day, it takes that of the entry's record (or, with `--fit`, of the fit). The element sets are those of the files in `elements/` (or of a file given with `--elements`). With `--write`, it writes the entry's validation record and the reduced @@ -31,20 +37,33 @@ from tatc.constants import timescale from tatc.schemas import GeneralPerturbationsOrbit -from scanner import Reference, Setup, fit, validate_swath +from scanner import Reference, Setup, fit, validate_beams, validate_swath from validation_io import FIXTURES, TO_GEODETIC, download_eumetsat, parse_run COLLECTION = "EO:EUM:DAT:0892" FIELDS_OF_VIEW = 95 SCAN_PERIOD = 2.254 +# published footprints: instrument, altitude (km), inclination (deg), scan angle +# (deg), and sizes along and across track (km), from Figure 8 of the EPS-SG MWS +# Science Plan, which states no altitude or angle: those of the beam widths of the +# AAPP-SG User Manual (827 km) and the outermost field of view (49.312 deg) +PUBLISHED_FOOTPRINTS = ( + ("MWS 23.8-31.4 GHz", 827, 98.7, 0, 39.6, 39.6), + ("MWS 23.8-31.4 GHz", 827, 98.7, 49.312, 67.6, 132.6), + ("MWS 50.3-57.3 GHz", 827, 98.7, 0, 20.0, 20.0), + ("MWS 50.3-57.3 GHz", 827, 98.7, 49.312, 34.2, 66.9), + ("MWS 89-229 GHz", 827, 98.7, 0, 17.0, 17.0), + ("MWS 89-229 GHz", 827, 98.7, 49.312, 29.0, 56.7), +) SETUP = Setup( swath="swath", - beams=None, - size_instrument=None, - published_footprints=(), + beams="beams", + size_instrument="MWS 50.3-57.3 GHz", + published_footprints=PUBLISHED_FOOTPRINTS, fixture_path=FIXTURES / "mws.npz", reference="MWS Level 1b (EO:EUM:DAT:0892, BUFR), positions of the fields of view", - published_reference="", + published_reference="Footprints of the EPS-SG MWS Science Plan; positions of the " + "fields of view of the MWS Level 1b (EO:EUM:DAT:0892, BUFR)", time_steps=(SCAN_PERIOD, 32, 128), pass_radius=60, point_spacing=500e3, @@ -143,7 +162,10 @@ def main() -> None: for frame in ("earth_fixed", "inertial"): fit(reference, frame) return - validate_swath(SETUP, run, reference, orbit, tle) + if SETUP.beams in run.configurations: + validate_beams(SETUP, run, reference, orbit, tle) + if SETUP.swath in run.configurations: + validate_swath(SETUP, run, reference, orbit, tle) if __name__ == "__main__": diff --git a/validation/catalog/validate_catalog_oci.py b/validation/catalog/validate_catalog_oci.py index 73e1b343..fcf3b4d1 100644 --- a/validation/catalog/validate_catalog_oci.py +++ b/validation/catalog/validate_catalog_oci.py @@ -22,6 +22,11 @@ python validation/catalog/validate_catalog_oci.py 2026-11-09 python validation/catalog/validate_catalog_oci.py 2026-11-10 +It also validates the entry's sample size configuration (`beams`), following +`ValidateSampleSizes`: the projected pixels are compared with the samples' +positions, and their spacing with that measured. The only published pixel, at nadir +in McClain et al. (2022), is compared without the gate. + Without a day, it takes that of the entry's record. The values are fitted to several periods, so the fits (`--fit`, `--switches`, and `--blind`) need the day given. A day is reduced to every sixth scan (about 1 s) and every 16th sample (and the last). @@ -45,7 +50,7 @@ from tatc.utils import compute_subsolar_latitude from tatc.schemas import GeneralPerturbationsOrbit -from scanner import Product, Reference, Setup, load_day, validate_swath +from scanner import Product, Reference, Setup, load_day, validate_beams, validate_swath from validation_io import ( TO_GEODETIC, RemoteFile, @@ -66,6 +71,10 @@ SCAN_PERIOD = 0.17547 # s COLUMNS = np.r_[0:SAMPLES:16, SAMPLES - 1] INCLINATION = 98.0 # deg, approximately, to get the argument of latitude +# the published pixel at nadir: instrument, altitude (km), inclination (deg), scan +# angle (deg), and sizes along and across track (km), from Table 1 of McClain et al. +# (2022), compared without the gate, as no other is published and sources differ +PUBLISHED_FOOTPRINTS = (("OCI", 675, 98.0, 0, 1.05, 1.05),) def read_oci(_product, url: str, session, day: datetime, _directory) -> dict: @@ -106,15 +115,17 @@ def read_oci(_product, url: str, session, day: datetime, _directory) -> dict: ) SETUP = Setup( swath="swath", - beams=None, - size_instrument=None, - published_footprints=(), + beams="beams", + size_instrument="OCI", + published_footprints=PUBLISHED_FOOTPRINTS, fixture_path=FIXTURES / "oci.npz", reference="PACE_OCI_L1B_SCI version 3 (sample positions and times)", - published_reference="", + published_reference="Nadir pixel of McClain et al. (2022) (not gated); sample " + "positions of PACE_OCI_L1B_SCI version 3", time_steps=(10, 30, 120), pass_radius=40, point_spacing=200e3, + gate_published=False, ) @@ -409,7 +420,10 @@ def main() -> None: tle = run.element_set() print(f"element set: {tle[0][:32]}", flush=True) orbit = GeneralPerturbationsOrbit.from_tle(tle) - validate_swath(SETUP, run, reference, orbit, tle) + if SETUP.beams in run.configurations: + validate_beams(SETUP, run, reference, orbit, tle) + if SETUP.swath in run.configurations: + validate_swath(SETUP, run, reference, orbit, tle) if __name__ == "__main__": diff --git a/validation/catalog/validate_catalog_tropics.py b/validation/catalog/validate_catalog_tropics.py index 66b40392..37b9c182 100644 --- a/validation/catalog/validate_catalog_tropics.py +++ b/validation/catalog/validate_catalog_tropics.py @@ -18,6 +18,11 @@ python validation/catalog/validate_catalog_tropics.py 2024-08-15 --fit --platform tropics-03 python validation/catalog/validate_catalog_tropics.py 2024-10-01 --platform tropics-03 +It also validates each satellite's sample size configuration (`beams_tropics_0n`), +following `ValidateSampleSizes`: sizes are compared with the footprints of the 118 +GHz band published in the TROPICS L1 Radiance ATBD, which the gate tests, the +projected pixels with the spots' positions, and their spacing with that measured. + Without a day, it takes that of the entry's record (or, with `--fit`, of the fit). The satellites' element sets are read from the file of their history in `elements/` (or from a file given with `--elements`). With `--write`, it writes the entry's @@ -40,7 +45,15 @@ from tatc.constants import timescale from tatc.schemas import GeneralPerturbationsOrbit from tatc.utils import compute_projected_ray_position -from scanner import Product, Reference, Setup, fit, load_day, validate_swath +from scanner import ( + Product, + Reference, + Setup, + fit, + load_day, + validate_beams, + validate_swath, +) from validation_io import FIXTURES, TO_GEODETIC, RemoteFile, parse_run SCAN_PERIOD = 2.0 @@ -182,6 +195,20 @@ def product(number: str) -> Product: PLATFORMS = {f"tropics-{n}": n for n in ("03", "05", "06")} +# published footprints of the 118 GHz band (F): instrument, altitude (km), +# inclination (deg), scan angle (deg), and sizes along and across track (km), from +# Appendix C of the TROPICS L1 Radiance ATBD (beam positions 41, 37, 20, 11, and 1), +# at the nominal altitude of its Table 1 +PUBLISHED_FOOTPRINTS = tuple( + ("TROPICS 118 GHz", 550, 33, angle, along, cross) + for angle, along, cross in ( + (0, 23.0, 25.2), + (6, 23.2, 25.5), + (31.5, 27.5, 36.5), + (45, 34.1, 58.3), + (60, 54.5, 177.1), + ) +) def setup(platform: str) -> Setup: @@ -190,12 +217,13 @@ def setup(platform: str) -> Setup: name = product(number).short_name return Setup( swath=f"swath_tropics_{number}", - beams=None, - size_instrument=None, - published_footprints=(), + beams=f"beams_tropics_{number}", + size_instrument="TROPICS 118 GHz", + published_footprints=PUBLISHED_FOOTPRINTS, fixture_path=FIXTURES / f"tropics_{number}.npz", reference=f"{name} (118 GHz spot positions and times)", - published_reference="", + published_reference="Footprints of the TROPICS L1 Radiance ATBD; 118 GHz " + f"spot positions of {name}", time_steps=(SCAN_PERIOD, 32, 128), pass_radius=60, point_spacing=500e3, @@ -224,14 +252,11 @@ def main() -> None: tle = run.element_set() print(f"element set: {tle[0][:32]}", flush=True) orbit = GeneralPerturbationsOrbit.from_tle(tle) - validate_swath( - setup(run.platform), - run, - reference, - orbit, - tle, - fixture_extras=None, - ) + satellite_setup = setup(run.platform) + if satellite_setup.beams in run.configurations: + validate_beams(satellite_setup, run, reference, orbit, tle) + if satellite_setup.swath in run.configurations: + validate_swath(satellite_setup, run, reference, orbit, tle) if __name__ == "__main__": diff --git a/validation/catalog/validate_catalog_tropomi.py b/validation/catalog/validate_catalog_tropomi.py index 8a0753a9..9dcc44ad 100644 --- a/validation/catalog/validate_catalog_tropomi.py +++ b/validation/catalog/validate_catalog_tropomi.py @@ -23,6 +23,12 @@ python validation/catalog/validate_catalog_tropomi.py 2026-11-05 python validation/catalog/validate_catalog_tropomi.py 2026-11-10 +It also validates the entry's sample size configuration (`pixels`), following +`ValidateSampleSizes`: the projected boundaries of every 16th row are compared with +the product's (the midpoints of their aft corners on consecutive lines), and the +spacing of pixels with that measured. The only published pixel, at nadir, is +compared without the gate. + Without a day, it takes that of the entry's record (or, with `--fit`, that of the fit). With `--write`, it writes the entry's validation record and the reduced fixture from which unit tests recompute the results. @@ -44,8 +50,11 @@ from tatc.generation import generate_points_fibonacci_lattice from tatc.schemas import GeneralPerturbationsOrbit from tatc.utils import compute_projected_ray_position +from scanner import Setup, validate_beams from validation_io import ( EARTH_ROTATION, + FIXTURES, + TO_GEODETIC, RemoteFile, build_grid, ecef, @@ -84,6 +93,38 @@ FIXTURE_PASSES = 200 PRODUCT = "PRODUCT/" GEOLOCATION = PRODUCT + "SUPPORT_DATA/GEOLOCATIONS/" +# the part of a line of the views of the pixels configuration, by name +PART = re.compile(r"pixels (\d+) to (\d+)") +# the published pixel at nadir: instrument, altitude (km), inclination (deg), scan +# angle (deg), and sizes along and across track (km), from the TROPOMI L1b ATBD +# (along track) and Kleipool et al. (2018) (across track, binned rows), compared +# without the gate, as no other is published with an altitude +PUBLISHED_FOOTPRINTS = (("TROPOMI pixels 128 to 304", 824, 98.74, 0, 5.5, 3.5),) +PIXELS_SETUP = Setup( + swath=KEY, + beams="pixels", + size_instrument="TROPOMI pixels 128 to 304", + published_footprints=PUBLISHED_FOOTPRINTS, + fixture_path=FIXTURES / "tropomi.npz", + reference="Pixel bounds of S5P L2__AER_AI (boundaries of every 16th row)", + published_reference="Nadir pixel of the TROPOMI L1b ATBD (not gated); pixel " + "bounds of S5P L2__AER_AI (boundaries of every 16th row, midway between lines)", + time_steps=TIME_STEPS, + pass_radius=40, + gate_published=False, +) + + +def find_part(names: list[str], row: int) -> tuple[int, int, int]: + """ + Gets the index of the instrument (a part of the line) that holds the boundary at + the start of a row (or the end of the last row), and its first and last rows. + """ + for index, name in enumerate(names): + first, last = (int(group) for group in PART.search(name).groups()) + if first <= row < last or row == last == N_ROWS: + return index, first, last + raise ValueError(f"no part of the line holds row {row}") def list_granules(day: datetime) -> list[str]: @@ -160,7 +201,8 @@ def load_day(day: datetime, directory: pathlib.Path) -> dict: class Reference: """A day of TROPOMI lines, with what is derived from them.""" - def __init__(self, data: dict[str, np.ndarray]): + def __init__(self, data: dict[str, np.ndarray], day: datetime | None = None): + self.day = day good = ( np.all(np.isfinite(data["node_lat"]), axis=1) & np.all(np.isfinite(data["node_lon"]), axis=1) @@ -252,6 +294,89 @@ def observe_passes(self, points) -> pd.DataFrame: ) return pd.concat(rows, ignore_index=True).astype({"point_id": "int64"}) + def measure_pixels(self, satellite, _index: int, setup, _frame) -> np.ndarray: + """ + Gets rows of seconds from the start of the day, row, position difference + (km), and latitude and longitude of the boundaries of every 16th row on a + sample of lines, against those of the parts of the line of the pixels + configuration. A boundary's position on a line is the midpoint of its aft + corners on the line and the next, as the views were fitted (see + `measure_rays`). TROPOMI's rows run from left to right of the motion, and + TAT-C numbers pixels from the right, so the boundary at the start of a row is + half a pixel to the left of its pixel. + """ + names = [instrument.name for instrument in satellite.instruments] + orbit = satellite.orbit.to_gp_orbit() + regular = np.nonzero(self.is_next_contiguous[:-1])[0] + lines = regular[:: setup.pixel_stride] + track = orbit.get_orbit_track(list(self.time[lines].to_pydatetime())) + seconds = (self.time[lines] - pd.Timestamp(self.day)).total_seconds() + middle = (self.xyz[lines] + self.xyz[lines + 1]) / 2 + lon, lat, _ = TO_GEODETIC.transform(*np.moveaxis(middle, -1, 0)) + rows = [] + for node, row in enumerate(NODES): + index, first, last = find_part(names, int(row)) + cross = (last - first) - 0.5 - (row - first) + position = satellite.get_instrument(index).compute_projected_pixel_position( + track, cross, 0 + ) + difference = np.linalg.norm( + ecef(position.longitude.degrees, position.latitude.degrees) + - ecef(lon[:, node], lat[:, node]), + axis=-1, + ) + rows.append( + np.stack( + [ + seconds.to_numpy(), + np.full(len(lines), row), + difference / 1e3, + lat[:, node], + lon[:, node], + ], + axis=-1, + ) + ) + return np.concatenate(rows) + + def measure_spacing(self, setup) -> tuple[pd.DatetimeIndex, np.ndarray]: + """ + Measures the spacing of the pixels of the part of the line of the sample + size instrument, from half the distance between the boundaries on either + side (divided by the rows between them) and between the lines before and + after, on a sample of lines. Gets the times, and rows of latitude, longitude, + along-track and cross-track spacing (km). + """ + first, last = ( + int(group) for group in PART.search(setup.size_instrument).groups() + ) + nodes = np.nonzero((NODES > first) & (NODES < last))[0] + nodes = nodes[(NODES[nodes - 1] >= first) & (NODES[nodes + 1] <= last)] + regular = np.nonzero( + self.is_next_contiguous[:-1] & self.is_next_contiguous[1:] + )[0] + lines = regular[:: setup.spacing_stride] + 1 + along = ( + np.linalg.norm( + self.xyz[lines + 1][:, nodes] - self.xyz[lines - 1][:, nodes], axis=-1 + ) + / 2e3 + ) + cross = np.linalg.norm( + self.xyz[lines][:, nodes + 1] - self.xyz[lines][:, nodes - 1], axis=-1 + ) / (1e3 * (NODES[nodes + 1] - NODES[nodes - 1])) + times = pd.DatetimeIndex(np.repeat(self.time[lines], len(nodes))) + rows = np.stack( + [ + self.lat[lines][:, nodes].ravel(), + self.lon[lines][:, nodes].ravel(), + along.ravel(), + cross.ravel(), + ], + axis=-1, + ) + return times, rows + def measure_rays(reference: Reference, frame: str = "earth_fixed") -> dict: """ @@ -498,7 +623,7 @@ def satellite_for(time_step: float): def main() -> None: """Fits or validates the entry on a day of data.""" run = parse_run("tropomi", __doc__) - reference = Reference(load_day(run.day, run.directory)) + reference = Reference(load_day(run.day, run.directory), run.day) print( f"{run.day:%Y-%m-%d}: {len(reference.seconds)} lines, " f"{reference.n_dropped} dropped, {len(reference.arcs)} arcs, " @@ -509,7 +634,11 @@ def main() -> None: fit_geometry(reference) return tle = run.element_set() - validate(run, tle, GeneralPerturbationsOrbit.from_tle(tle), reference) + orbit = GeneralPerturbationsOrbit.from_tle(tle) + if PIXELS_SETUP.beams in run.configurations: + validate_beams(PIXELS_SETUP, run, reference, orbit, tle) + if KEY in run.configurations: + validate(run, tle, orbit, reference) if __name__ == "__main__": diff --git a/validation/catalog/validation_io/__init__.py b/validation/catalog/validation_io/__init__.py index bcfd8f12..48a31060 100644 --- a/validation/catalog/validation_io/__init__.py +++ b/validation/catalog/validation_io/__init__.py @@ -8,6 +8,8 @@ * `geometry`: coordinates, and the lattices of samples that scanners image; * `scoring`: comparisons through public TAT-C methods; * `records`: the validation records and reduced test fixtures. +* `footprints`: the footprints and spacing of beam instruments' samples. +* `grids`: the pixels of geostationary imagers' fixed grids. Scripts import these names from the package. @@ -27,6 +29,8 @@ read_element_set_file, ) from .cli import Run, parse_day, parse_run +from .footprints import Footprints, measure_along_spacing, validate_footprints +from .grids import FixedGrid, validate_fixed_grid from .geometry import ( EARTH_ROTATION, TO_ECEF, diff --git a/validation/catalog/validation_io/footprints.py b/validation/catalog/validation_io/footprints.py new file mode 100644 index 00000000..15d2657c --- /dev/null +++ b/validation/catalog/validation_io/footprints.py @@ -0,0 +1,146 @@ +""" +Scoring the sample size configurations of beam instruments (lidars, profilers, and +altimeters), whose footprints point near nadir: their sizes against published +footprints, and the spacing of their samples along track against that measured in +a product. + +@author: Paul T. Grogan +""" + +import pathlib +import warnings +from dataclasses import dataclass +from datetime import timedelta + +import numpy as np +import pandas as pd + +from .geometry import ecef +from .records import write_results +from .scoring import compute_published_errors, compute_spacing_ratios, score_published + + +@dataclass(frozen=True) +class Footprints: + """ + The sample size configuration of a beam instrument: its key, the published + footprints (see `scoring.compute_published_errors`), the reference, the + fixture, and whether the published footprints test the gate (those too few, or + from which the footprint's angle comes, are compared without it). + """ + + key: str + published_footprints: tuple + reference: str + fixture_path: pathlib.Path + gate_published: bool = True + fixture_spacing: int = 200 + + +def measure_along_spacing( + seconds: np.ndarray, + lat: np.ndarray, + lon: np.ndarray, + period: float, + samples: int = 1, +) -> np.ndarray: + """ + Measures the spacing (km) of a beam's samples along its track, from half the + distance between the kept samples before and after each, where both are one + period (s) of kept samples away, divided by the instrument's samples between + kept ones (of a product reduced to every so many, or of averages of so many). + Gets rows of latitude, longitude, along-track spacing (km), a cross-track + spacing (`NaN`, as a beam has one sample across track), and seconds. + """ + xyz = ecef(lon, lat) + gaps = np.diff(seconds) + regular = np.abs(gaps - period) < 0.25 * period + middle = np.nonzero(regular[:-1] & regular[1:])[0] + 1 + along = np.linalg.norm(xyz[middle + 1] - xyz[middle - 1], axis=-1) / (2e3 * samples) + return np.stack( + [ + lat[middle], + lon[middle], + along, + np.full(len(middle), np.nan), + seconds[middle], + ], + axis=-1, + ) + + +def validate_footprints( # pylint: disable=too-many-arguments + footprints: Footprints, + run, + satellite, + names: list[str], + rows: np.ndarray, + tle, +) -> None: + """ + Scores the sample size configuration of a beam instrument in a run (see + `cli.parse_run`): the sizes of its footprints against the published ones, and + the median ratio of predicted to measured spacing along track, for rows of + latitude, longitude, along-track spacing (km), cross-track spacing (`NaN`), and + seconds from the start of the day (see `measure_along_spacing`), each of the + instrument named in `names`. Writes its results if the run writes. + """ + entry = run.entry + within, largest = score_published( + compute_published_errors(entry, footprints.key, footprints.published_footprints) + ) + print( + f"published dimensions: {within:.1f}% within 3%, largest error {largest:.2f}%" + + ("" if footprints.gate_published else " (not gated)") + ) + published = {"sample_size_within_3pct": within} if footprints.gate_published else {} + times = pd.DatetimeIndex( + [pd.Timestamp(run.day) + timedelta(seconds=float(s)) for s in rows[:, 4]] + ) + along, _ = _ratios(satellite, names, times, rows) + error = 100 * abs(along - 1) + print(f"spacing along track, predicted / measured: {along:.4f} ({error:.2f}%)") + if not run.write: + return + rng = np.random.default_rng(4) + picks = np.sort( + rng.choice(len(rows), min(footprints.fixture_spacing, len(rows)), replace=False) + ) + fixture_along, _ = _ratios( + satellite, [names[i] for i in picks], times[picks], rows[picks] + ) + write_results( + run, + footprints.key, + reference=footprints.reference, + metrics=[ + *({"name": name, "value": value} for name, value in published.items()), + {"name": "sample_size_largest_error", "value": largest}, + {"name": "spacing_along_ratio_median", "value": along}, + {"name": "spacing_along_error", "value": error}, + ], + transfer_metrics={ + "spacing_along_ratio_median": along, + "spacing_along_error": error, + }, + fixture={ + "tle": np.array(tle), + "day": np.array(run.day.isoformat()), + "spacing": rows[picks, :4], + "spacing_seconds": rows[picks, 4], + "spacing_instruments": np.array([names[i] for i in picks]), + }, + fixture_path=footprints.fixture_path, + fixture_metrics={ + **(published or {"sample_size_largest_error": largest}), + "spacing_along_ratio_median": fixture_along, + }, + ) + + +def _ratios(satellite, names, times, rows) -> tuple[float, float]: + """The median ratios of predicted to measured spacing, ignoring cross track.""" + with warnings.catch_warnings(): + # a beam has no spacing across track, whose median is NaN + warnings.simplefilter("ignore", RuntimeWarning) + return compute_spacing_ratios(satellite, list(names), times, rows[:, :4]) diff --git a/validation/catalog/validation_io/grids.py b/validation/catalog/validation_io/grids.py new file mode 100644 index 00000000..e12882fc --- /dev/null +++ b/validation/catalog/validation_io/grids.py @@ -0,0 +1,211 @@ +""" +Scoring the sample size configurations of geostationary imagers, whose pixels are a +fixed grid of scan angles: the projected pixels against the positions of the +product's grid (seen from the nominal position, to which the products are +navigated), the spacing of pixels against that of the grid, and the published sizes. + +@author: Paul T. Grogan +""" + +import pathlib +from dataclasses import dataclass +from datetime import datetime + +import numpy as np +import pandas as pd + +from tatc.catalog.metrics import summarize +from tatc.schemas import GeosynchronousOrbit + +from .geometry import ecef +from .records import write_results +from .scoring import compute_published_errors, compute_spacing_ratios, score_published + + +@dataclass(frozen=True) +class FixedGrid: + """ + The sample size configuration of a geostationary imager: its key, the instrument + whose pixels are compared, the published pixels (see + `scoring.compute_published_errors`), whether they test the gate (sizes at the + sub-satellite point, which the grid's angle defines, are compared without it), + the reference, the fixture, and the samples of pixels. + """ + + key: str + instrument: str + published_footprints: tuple + reference: str + fixture_path: pathlib.Path + gate_published: bool = True + samples: int = 2000 + fixture_samples: int = 200 + + +def build_satellite(entry, key: str, longitude: float, time: datetime): + """ + Builds the satellite of a configuration at the nominal position of a fixed grid + (a geosynchronous orbit at its longitude, at the time of the data). + """ + orbit = GeosynchronousOrbit(longitude=longitude, epoch=time, inclination=0) + return entry.build(configuration=key, orbit=orbit).to_satellite( + orbit, name=entry.name + ) + + +def project_pixels(satellite, instrument: str, time: datetime, rows, columns, size): + """ + Projects pixels of a grid of `size` rows and columns (rows from the north, + columns from the west), as TAT-C numbers them from the right of the motion + (east, in the inertial frame of a geostationary platform): from the south and + from the east. Gets their latitudes and longitudes (deg). + """ + names = [i.name for i in satellite.instruments] + view = satellite.get_instrument(names.index(instrument)) + track = satellite.orbit.to_gp_orbit().get_orbit_track(time) + lat, lon = np.empty(len(rows)), np.empty(len(rows)) + for k, (row, column) in enumerate(zip(rows, columns)): + position = view.compute_projected_pixel_position( + track, size - 1 - int(row), size - 1 - int(column) + ) + lat[k], lon[k] = position.latitude.degrees, position.longitude.degrees + return lat, lon + + +def measure_grid_spacing(lat: np.ndarray, lon: np.ndarray, rows, columns): + """ + Measures the spacing (km) of a grid's pixels, east-west and north-south, from + half the distance between the pixels on either side. Gets rows of latitude, + longitude, east-west (along track), and north-south (across track) spacing. + """ + east_west = ( + np.linalg.norm( + ecef(lon[rows, columns + 1], lat[rows, columns + 1]) + - ecef(lon[rows, columns - 1], lat[rows, columns - 1]), + axis=-1, + ) + / 2e3 + ) + north_south = ( + np.linalg.norm( + ecef(lon[rows + 1, columns], lat[rows + 1, columns]) + - ecef(lon[rows - 1, columns], lat[rows - 1, columns]), + axis=-1, + ) + / 2e3 + ) + return np.stack( + [lat[rows, columns], lon[rows, columns], east_west, north_south], axis=-1 + ) + + +def validate_fixed_grid( # pylint: disable=too-many-arguments,too-many-locals + grid: FixedGrid, + run, + lat: np.ndarray, + lon: np.ndarray, + longitude: float, + time: datetime, +) -> None: + """ + Scores the sample size configuration of a geostationary imager in a run (see + `cli.parse_run`) against a product's grid of pixel latitudes and longitudes + (rows from the north, columns from the west; `NaN` off the Earth's disk) of a + scan at a time: the published sizes, the projected pixels of a sample of the + disk from the nominal position (the grid's longitude), and the spacing of the + pixels. Writes its results if the run writes. + """ + entry = run.entry + within, largest = score_published( + compute_published_errors(entry, grid.key, grid.published_footprints) + ) + print( + f"published dimensions: {within:.1f}% within 3%, largest error {largest:.2f}%" + + ("" if grid.gate_published else " (not gated)") + ) + published = {"sample_size_within_3pct": within} if grid.gate_published else {} + size = lat.shape[0] + # pixels of the disk whose neighbors are on it + on_disk = np.isfinite(lat) & np.isfinite(lon) + inner = np.zeros_like(on_disk) + inner[1:-1, 1:-1] = ( + on_disk[1:-1, 1:-1] + & on_disk[:-2, 1:-1] + & on_disk[2:, 1:-1] + & on_disk[1:-1, :-2] + & on_disk[1:-1, 2:] + ) + candidates = np.argwhere(inner) + rng = np.random.default_rng(5) + picks = candidates[ + np.sort(rng.choice(len(candidates), grid.samples, replace=False)) + ] + rows, columns = picks[:, 0], picks[:, 1] + satellite = build_satellite(entry, grid.key, longitude, time) + predicted_lat, predicted_lon = project_pixels( + satellite, grid.instrument, time, rows, columns, size + ) + difference = ( + np.linalg.norm( + ecef(predicted_lon, predicted_lat) + - ecef(lon[rows, columns], lat[rows, columns]), + axis=-1, + ) + / 1e3 + ) + stats = summarize(difference) + print( + f"pixel position: median {stats['median']:.3f} km, " + f"95th percentile {stats['p95']:.3f} km" + ) + spacing = measure_grid_spacing(lat, lon, rows, columns) + times = pd.DatetimeIndex([pd.Timestamp(time)] * len(spacing)) + along, cross = compute_spacing_ratios( + satellite, [grid.instrument] * len(spacing), times, spacing + ) + print( + f"spacing, predicted / measured: {along:.4f} east-west, {cross:.4f} " + "north-south" + ) + if not run.write: + return + reduced = rng.choice(len(rows), grid.fixture_samples, replace=False) + fixture_along, fixture_cross = compute_spacing_ratios( + satellite, [grid.instrument] * len(reduced), times[reduced], spacing[reduced] + ) + write_results( + run, + grid.key, + reference=grid.reference, + metrics=[ + *({"name": name, "value": value} for name, value in published.items()), + {"name": "sample_size_largest_error", "value": largest}, + {"name": "pixel_position_median", "value": stats["median"]}, + {"name": "pixel_position_p95", "value": stats["p95"]}, + {"name": "spacing_along_ratio_median", "value": along}, + {"name": "spacing_cross_ratio_median", "value": cross}, + ], + fixture={ + "time": np.array(time.isoformat()), + "longitude": np.array(longitude), + "size": np.array(size), + "pixels": np.stack( + [ + rows[reduced], + columns[reduced], + lat[rows[reduced], columns[reduced]], + lon[rows[reduced], columns[reduced]], + ], + axis=-1, + ), + "spacing": spacing[reduced], + }, + fixture_path=grid.fixture_path, + fixture_metrics={ + **(published or {"sample_size_largest_error": largest}), + "pixel_position_median": summarize(difference[reduced])["median"], + "spacing_along_ratio_median": fixture_along, + "spacing_cross_ratio_median": fixture_cross, + }, + period=f"{time:%Y-%m-%dT%H:%MZ}", + ) diff --git a/validation/catalog/validation_io/scoring.py b/validation/catalog/validation_io/scoring.py index 5c4ca79d..3ce9a481 100644 --- a/validation/catalog/validation_io/scoring.py +++ b/validation/catalog/validation_io/scoring.py @@ -45,23 +45,29 @@ def compute_published_errors(entry, key: str, footprints) -> np.ndarray: """ Gets the relative errors of sample sizes against published footprints, given as rows of instrument name, altitude (km), inclination (deg), scan angle (deg), and - the sizes (km) along and across track. Gives two errors for each row. + the sizes (km) along and across track, and optionally the angle (deg) along track + of a view pointed fore or aft. Gives two errors for each row. """ errors = [] - for name, altitude, inclination, angle, along, cross in footprints: + for name, altitude, inclination, angle, along, cross, *rest in footprints: + pitch = rest[0] if rest else 0 orbit = CircularOrbit( altitude=altitude * 1e3, inclination=inclination, epoch=PUBLISHED_EPOCH ) - satellite = entry.build(configuration=key, orbit=orbit).to_satellite( - orbit, name=entry.name - ) + # a day, for a configuration that schedules its attitude + satellite = entry.build( + configuration=key, + orbit=orbit, + start=PUBLISHED_EPOCH, + end=PUBLISHED_EPOCH + timedelta(days=1), + ).to_satellite(orbit, name=entry.name) time = PUBLISHED_EPOCH + timedelta(minutes=10) target = compute_projected_ray_position( orbit.to_gp_orbit().get_orbit_track(time), 0, 0, angle, - 0, + pitch, velocity_frame=VelocityFrame.INERTIAL, ) sizes = compute_sample_sizes( @@ -78,7 +84,8 @@ def compute_published_errors(entry, key: str, footprints) -> np.ndarray: sizes.sample_along.iloc[0] / 1e3 / along - 1, sizes.sample_cross.iloc[0] / 1e3 / cross - 1, ] - print(f"{name}, {angle} deg: {errors[-2]:+.2%} along, {errors[-1]:+.2%} across") + where = f"{angle} deg" + (f", {pitch} deg along track" if pitch else "") + print(f"{name}, {where}: {errors[-2]:+.2%} along, {errors[-1]:+.2%} across") return np.array(errors)