# OIP-0020: Earth-observation products: coverage observations, product lineage, analysis-ready-data claims, detections and EO calibration

| Field | Value |
|---|---|
| Status | DRAFT |
| Functions | `describe` (§5.3), `observe` (§5.5), `qualify` (§5.6), `correct` (§5.9), `exchange` (§5.10); no new function (the register keeps exactly twelve) and no new profile |
| Affects | §4.2, §5.10; new schemas `coverage-observation`, `ard-claim`, `detection`; `product-manifest` and `calibration-record` (additive fields, both stay `3.1.0`); `registers/functions.yaml` (objects of observe, qualify, exchange); `registers/requirements.yaml` (regenerated, 79 requirements); new cases CT-GRID-080 to CT-GRID-083, CT-PROVIDER-080 and CT-PROVIDER-081, CT-CONSUMER-080 to CT-CONSUMER-083 |
| Protocol version | obsp/0.1 |
| Work packages | WP-IM-06 (coverage observations and products), WP-IM-07 (detections and response tracking), WP-PR-04 (Earth-observation products and calibration) |
| Requires | OIP-0006 (universal observation: `result.coverageRef` and `result.eventRef`, the origin vocabulary, the observed-property register ids). Acceptance order: OIP-0006 first. The patches here apply to the current tree on their own; they read OIP-0006 terms by name only |
| References | OIP-0009 (STAC `obsp:ard_claim` placeholder; the missing product extent, its open questions 5 and 6), OIP-0010 (processing level of delivered products), OIP-0012 (model runs; the origin order) |
| Last call | 30 days (new objects and additive fields) unless the editors rule otherwise |

## Problem

The protocol can say that an observation's result is a coverage or an event (OIP-0006 `coverageRef`, `eventRef`), but
it cannot describe either. For Earth-observation data that leaves five gaps:

1. **Coverages.** Nothing says on which grid or discrete global grid a raster lives, what each band measures and in
   which unit, what marks a missing cell, or which bytes make it up. A consumer reading Zarr v3 chunks or Cloud
   Optimized GeoTIFF tiles cannot check that the chunk it read is the chunk the producer signed.
2. **Products.** `product-manifest` has no spatial or temporal extent (OIP-0009, open question 5), no processing level
   and no lineage pinned by digest, so a correction of an input (§5.9) cannot find the products that depend on it, and
   a loop in lineage goes unnoticed.
3. **Analysis-ready-data claims.** OIP-0009 left `obsp:ard_claim` as a placeholder (open question 6). A product can be
   said to be analysis ready with no specification, no version, no level per requirement group and no assessment,
   and the wording can drift into certification.
4. **Detections.** A methane plume, a flood onset or a fire found in imagery has no record that carries its hazard
   type, magnitude with uncertainty, evidence, and who was told and what they did. Response tracking (notified,
   acknowledged, action reported, closed) is what makes such detections accountable; without an append-only history it
   can be rewritten.
5. **Calibration of imagers.** `calibration-record` holds coefficients without uncertainty and has no place for a
   spectral response function, a geometric accuracy or the vicarious and fiducial reference measurements that
   Earth-observation calibration and validation rest on.

## Change

### Normative text

§5.10 Exchange gains the paragraph "Earth-observation products (OIP-0020)" and an id table EOP-1 to EOP-9 (full text in
`patches/spec.patch`); §4.2 gains the rows `CoverageObservation, Detection | coverage-observation, detection | Observe,
Exchange` and `ArdClaim | ard-claim | Qualify, Exchange`. In short:

1. **EOP-1.** A coverage describes its domain as a grid (CRS URI, size, and an affine transform or an origin with a
   resolution, never both) or as a DGGS zone set (reference system, refinement level, zones); each band names a register
   property, a UCUM unit and its nodata value (null when every cell carries one, never omitted).
2. **EOP-2.** Every chunk is listed with its digest; a signed chunk manifest carries the RFC 8785 digest of that list. A
   consumer verifies each chunk it reads and never uses a chunk whose digest differs or that is not listed.
3. **EOP-3.** Processing level (`L0`, `L1A`, `L1B`, `L1C`, `L2`, `L2A`, `L3`, `L4`), acquisition interval (ordered),
   footprint with CRS, origin; a model-derived coverage references its model run.
4. **EOP-4.** A product manifest with a processing level states product UNI and version, spatial and temporal extent,
   origin aggregate and lineage (each input by UNI, version and digest with the provenance, model run or processing run
   that used it).
5. **EOP-5.** Lineage is acyclic; inputs present in the set match their digest; the origin aggregate is not stronger
   than the weakest input (order of OIP-0012); a product is not at a lower processing level than a coverage it is made
   from.
6. **EOP-6.** An ARD claim names the product version, the product family specification (family, identifier, version),
   the level per requirement group (`THRESHOLD`, `TARGET`, `NOT_MET`) and the assessment with the assessor's role; the
   claimed level does not exceed the lowest group; the claim is self-assessed unless it references the assessor's
   credential, and never states or implies a certification.
7. **EOP-7.** A detection names a hazard code (UNDRR-ISC Hazard Information Profiles), location with CRS, phenomenon and
   detection times, origin and at least one evidence reference; a magnitude always carries its uncertainty.
8. **EOP-8.** Notifications and responses form an append-only history: dated in order, none before the detection or the
   first notification, forward-only states, current state equal to the last entry, and every earlier revision's entries
   kept unchanged.
9. **EOP-9.** `eoCalibration` states radiometric gain and offset with unit and uncertainty, the spectral response
   function by URI and digest, at least one reference measurement (vicarious, fiducial reference, cross-calibration,
   onboard), and SHOULD state geometric accuracy as CE90 in metres; a coverage that cites a calibration lies in its
   validity window and carries its band.

Names follow the repository's conventions: the design text's response states `none`, `acknowledged`,
`action-reported`, `closed` are `NONE`, `ACKNOWLEDGED`, `ACTION_REPORTED`, `CLOSED`.

### Contracts (schemaVersion `3.1.0`)

`coverage-observation` (`urn:obsp:schema:v3.1:coverageobservation`): `coverageUni`, `version`, `observer`
(`observerUni`, class `SPACE_SEGMENT`, `PLATFORM`, `INSTRUMENT`, `MODEL`), `procedure` (`<UNI>@<version>`),
`processingLevel`, `acquisitionTime` `{start, end}`, `resultTime?`, `footprint` (geometry with CRS), `domain` (`GRID`
or `DGGS`), `bands[]` (`name`, `observedProperty`, `unit`, `dataType`, `nodata`, `scale?`, `offset?`,
`centralWavelength?`, `polarisation?`), `encoding` (`ZARR_V3` or `COG`, `storeUri`, `chunkShape?`), `chunks[]`
(`key`, `digest`, `bytes?`), `chunkManifest` (`digest`, `signature`, `uri?`), `origin`, `modelRunRef` (required for
`MODEL_DERIVED` and `SIMULATED`), `calibrationRefs?`, `provenanceRef?`, `operatorUni`, `recordedAt`.

`ard-claim` (`urn:obsp:schema:v3.1:ardclaim`): `claimUni`, `version`, `productRef` (UNI, version, digest),
`specification` (`family`: `SURFACE_REFLECTANCE`, `SURFACE_TEMPERATURE`, `AQUATIC_REFLECTANCE`,
`NIGHTTIME_LIGHT_RADIANCE`, `NORMALISED_RADAR_BACKSCATTER`, `POLARIMETRIC_RADAR`, `GEOCODED_SINGLE_LOOK_COMPLEX`,
`INTERFEROMETRIC_RADAR`, `OTHER`; `identifier`; `version`; `uri?`), `claimedLevel` (`THRESHOLD`, `TARGET`),
`requirementGroups[]` (`group`: `GENERAL_METADATA`, `PER_PIXEL_METADATA`, `RADIOMETRIC_CORRECTIONS`,
`GEOMETRIC_CORRECTIONS`, `OTHER` with `label`; `level`; `evidenceRef?`), `assessment` (`recordRef`, `assessedAt`,
`assessorRole`, `assessorUni`), `selfAssessed` (default true), `assessorCredentialRef` (required when `selfAssessed` is
false), `recordedAt`. There is no field and no value that states a certification.

`detection` (`urn:obsp:schema:v3.1:detection`): `detectionUni`, `revision`, `eventType` (`scheme`
`UNDRR-ISC-HIP`, `hazardCode` `^[A-Z]{2}[0-9]{4}$`, `label?`), `location`, `phenomenonTime`, `detectedAt`,
`magnitude?` (`observedProperty`, `value`, `unit`, `uncertainty` required), `evidenceRefs[≥1]`, `origin`,
`modelRunRef` (required for `MODEL_DERIVED` and `SIMULATED`), `detectorUni?`, `notifications[]` (`notifiedAt`,
`recipientRole`, `recipientUni?`, `noticeRef?`), `responseState`, `responseHistory[]` (`state`, `at`, `byRole`,
`byUni?`, `actionRef?`, `note?`), `operatorUni`, `recordedAt`. Recipient roles: `CONSUMER`, `GRID_OPERATOR`,
`PROVIDER`, `FACILITY_OPERATOR`, `COMPETENT_AUTHORITY`, `EMERGENCY_SERVICE`, `PUBLIC` (roles, never names). A
notice sent through the CAP binding (OIP-0005) is referenced by `noticeRef`.

`product-manifest` (additive): `productUni`, `version`, `processingLevel`, `extent` (`spatial` `{crs, bbox}`,
`temporal` `{start, end}`), `lineage[]` (`uni`, `version`, `digest`, `objectKind?`, `origin?`, `activityRef`
`{kind: PROVENANCE | MODEL_RUN | PROCESSING_RUN, uni, digest}`), `originAggregate`, `ardClaimRefs?`.
`dependentRequired`: `lineage` needs `productUni` and `version`; `processingLevel` needs those plus `extent`, `lineage`
and `originAggregate`. Existing manifests without these fields stay valid.

`calibration-record` (additive): `eoCalibration` (`band`, `centralWavelength?`, `radiometric` `{gain, offset}` each
`{value, unit, uncertainty}`, `spectralResponseRef` `{uri, digest}`, `geometricAccuracy?` `{ce90, unit: m,
referenceRef}`, `referenceMeasurements[≥1]` `{kind: VICARIOUS | FIDUCIAL_REFERENCE | CROSS_CALIBRATION | ONBOARD, ref,
target?, measuredAt?}`).

### Invariants (suite module `sdk/python/src/obsp/eo_products.py`, merged into the suite's table by three lines after the `Case` dataclass of `conformance.py`; 33 unit tests in `sdk/python/tests/test_eo_products.py`)

| Invariant | Rule |
|---|---|
| `coverage-domain-consistent` | acquisition interval ordered; grid transform not singular; band names unique; footprint rings closed (EOP-1, EOP-3) |
| `coverage-chunks-in-manifest` | chunk keys unique; `chunkManifest.digest` is the RFC 8785 digest of `chunks` (EOP-2). `verify_chunk(coverage, key, bytes)` is the consumer check: listed key, matching digest and length |
| `product-lineage-acyclic` | no input twice; no product among its own inputs; no cycle through the products of the set; inputs present in the set match by digest; origin aggregate not stronger than the weakest input; processing level not below a coverage input; extent ordered (EOP-4, EOP-5) |
| `ard-claim-consistent` | claimed level not above the lowest group; groups not repeated; the product is in the set by UNI, version and digest and states a processing level; no string of the claim says certified (EOP-6) |
| `detection-magnitude-uncertainty` | an interval uncertainty is ordered and contains the value; evidence not repeated; phenomenon time ordered; detection not before the phenomenon (EOP-7) |
| `detection-response-append-only` | notifications ordered and not before detection; responses dated in order, not before the first notification, forward only (`ACTION_REPORTED` may repeat), nothing after `CLOSED`, current state equal to the last entry; across revisions of one detection, earlier notifications and responses are a prefix of later ones (EOP-8) |
| `eo-calibration-consistent` | reference measurements not repeated; a coverage's calibration found in the set matches by digest, has `eoCalibration`, covers the acquisition interval and calibrates one of its bands (EOP-9) |

### Standards mapped (cited by name; no text reproduced)

| Standard or source | Used for | Checked |
|---|---|---|
| Zarr storage specification version 3 (chunk keys and store layout) | `encoding.format` `ZARR_V3`, `chunks[].key` | not checked |
| OGC Cloud Optimized GeoTIFF standard (1.0) | `encoding.format` `COG` | not checked |
| OGC Topic 21 / ISO 19170-1 (discrete global grid systems) | `domain` `DGGS` terms (reference system, refinement level, zone) | not checked |
| Earth-observation data processing levels as published by space agencies and CEOS (L0 to L4 with sub-levels) | `processingLevel` | not checked |
| CEOS analysis-ready data (CEOS-ARD) product family specifications, by name: Surface Reflectance, Surface Temperature, Aquatic Reflectance, Nighttime Light Radiance, Normalised Radar Backscatter, Polarimetric Radar, Geocoded Single-Look Complex, Interferometric Radar; threshold and target levels; requirement groups | `ard-claim.specification`, `claimedLevel`, `requirementGroups` | not checked |
| UNDRR-ISC Hazard Information Profiles (2020 edition), identifier pattern | `detection.eventType.hazardCode` | not checked |
| JCGM 100:2008 (GUM) | uncertainty kinds | not checked |
| QA4EO (Quality Assurance Framework for Earth Observation) principles: traceability, uncertainty, reference measurements | `eoCalibration` | not checked |
| RFC 8785 (JSON canonicalization) | chunk manifest digest, document digests (as the suite computes them, `obsp.canonical`) | not checked |

### Relation rows for acceptance (not in the patches)

`registers/implements-edges.json` is generated from `registers/relations.yaml`; so that this proposal does not change
that generated file, the patches add no relation rows. Acceptance adds them, then runs `python3 tools/build_edges.py`:

```yaml
  - { id: EXT-ZARR, standard: 'Zarr storage specification version 3', kind: aligns-with, functions: [observe, exchange], schemas: [coverage-observation] }
  - { id: EXT-COG, standard: 'OGC Cloud Optimized GeoTIFF', kind: aligns-with, functions: [observe, exchange], schemas: [coverage-observation] }
  - { id: EXT-DGGS, standard: 'OGC Topic 21 and ISO 19170-1 (discrete global grid systems)', kind: aligns-with, functions: [observe], schemas: [coverage-observation] }
  - { id: EXT-CEOS-ARD, standard: 'CEOS analysis-ready data product family specifications', kind: aligns-with, functions: [qualify, exchange], schemas: [ard-claim, product-manifest] }
  - { id: EXT-HIP, standard: 'UNDRR-ISC Hazard Information Profiles', kind: aligns-with, functions: [observe], schemas: [detection] }
  - { id: EXT-QA4EO, standard: 'QA4EO principles (quality assurance for Earth observation)', kind: aligns-with, functions: [describe, qualify], schemas: [calibration-record] }
```

`EXT-RFC8785` and `EXT-STAC` may gain `coverage-observation` and `product-manifest` respectively where the editors see
fit.

## Compatibility

Additive: three new objects; optional fields on `product-manifest` and `calibration-record`, which stay `3.1.0`; no
existing record changes meaning. No profile changes: the cases join OBSP-GRID, OBSP-PROVIDER and OBSP-CONSUMER under
functions those profiles already list, and the three example sets gain the documents the cases need.

The ARD claim fills OIP-0009's placeholder: once both are accepted, BND-STAC-07's `obsp:ard_claim` is written from an
ArdClaim (`specification`, `version`, basis `SELF_ASSESSMENT` when `selfAssessed`, assessment href and digest from
`assessment.recordRef`), and the STAC Item's extent from the manifest's `extent`. OIP-0010's per-product
`processingLevel` and OIP-0012's `processingLevel` use the pattern `^L[0-4][A-D]?$`; every value listed here matches it.

Draft interplay: the patches apply to the current tree on their own. Where placement is free they avoid the lines other
drafts edit: the suite hook sits after the `Case` dataclass of `conformance.py`. The CT-CONSUMER-083 attestation is
appended to `conformance/examples/OBSP-CONSUMER/attestations.yaml`, where OIP-0001 also appends (OIP-0005 and OIP-0009
insert at its top and still apply). Lines shared by design remain, as for other drafts: the §4.2 table and §5.10
(also edited by OIP-0001, OIP-0002, OIP-0005, OIP-0006, OIP-0007, OIP-0008 and the profile drafts), the object lists of
observe, qualify and exchange in `registers/functions.yaml` (OIP-0001, OIP-0005, OIP-0006, OIP-0007, OIP-0011,
OIP-0012), the properties and `$defs` of `product-manifest` (OIP-0001), and `registers/requirements.yaml`, which is
generated (`python3 tools/requirements.py`) and is regenerated by whichever proposal is accepted second.

## Tests

| Requirement | Case | Kind | Evidence and invariants |
|---|---|---|---|
| EOP-1, EOP-2, EOP-3 | CT-GRID-080 | invariant | `coverage-observation`; `coverage-domain-consistent`, `coverage-chunks-in-manifest` |
| EOP-4, EOP-5 | CT-GRID-081 | invariant | `product-manifest`, `coverage-observation`; `product-lineage-acyclic` |
| EOP-6 | CT-GRID-082 | invariant | `ard-claim`, `product-manifest`; `ard-claim-consistent` |
| EOP-7, EOP-8 | CT-GRID-083 | invariant | `detection`; `detection-magnitude-uncertainty`, `detection-response-append-only` |
| EOP-9 | CT-PROVIDER-080 | invariant | `calibration-record`, `coverage-observation`; `eo-calibration-consistent` |
| EOP-4, EOP-6 | CT-PROVIDER-081 | invariant | `product-manifest`, `ard-claim`; `product-lineage-acyclic`, `ard-claim-consistent` |
| EOP-2 | CT-CONSUMER-080 | invariant | `coverage-observation`; `coverage-chunks-in-manifest` |
| EOP-5 | CT-CONSUMER-081 | invariant | `product-manifest`; `product-lineage-acyclic` |
| EOP-8 | CT-CONSUMER-082 | invariant | `detection`; `detection-response-append-only` |
| EOP-2, EOP-6 | CT-CONSUMER-083 | manual | the application rejects an altered and an unlisted chunk and shows a claim as a self-assessment |

Example sets (generic names, no mission named): OBSP-GRID gains a C-band SAR backscatter coverage at `L2` (COG, origin
and resolution grid), its product with lineage and a target-level Normalised Radar Backscatter claim backed by an
assessor credential, a flood-extent coverage on a DGGS (model-derived, `L3`) with its product whose lineage pins the SAR
coverage by digest, and two revisions of a methane plume detection (1450 kg/h, expanded uncertainty 520 kg/h with k = 2,
notified to the facility operator and the competent authority, acknowledged, action reported, closed). OBSP-PROVIDER
gains the red-band calibration of an imager, a `L2A` surface-reflectance tile (Zarr v3, affine transform) citing it, its
product and a self-assessed threshold Surface Reflectance claim. OBSP-CONSUMER gains the flood coverage and product and
the two detection revisions, and the attestation of CT-CONSUMER-083.

Positive fixtures: `coverage-observation` (`surface-reflectance-l2a`, `sar-backscatter-nrb`, `flood-extent-dggs`),
`product-manifest` (`eo-surface-reflectance`, `eo-flood-extent`), `ard-claim` (`surface-reflectance`,
`sar-nrb-assessor-credential`), `detection` (`methane-plume`, `flood-onset`), `calibration-record` (`eo-radiometric`).

Negative fixtures, one broken rule each (43): `coverage-observation.` `domain-grid-with-zones`,
`grid-transform-and-resolution`, `grid-without-crs`, `dggs-without-reference-system`, `band-free-text-property`,
`band-unit-not-ucum`, `band-without-nodata`, `chunk-without-digest`, `empty-chunks`, `manifest-unsigned`,
`unknown-processing-level`, `missing-acquisition-time`, `footprint-without-crs`, `model-derived-without-model-run`;
`product-manifest.` `eo-without-extent`, `eo-without-lineage`, `eo-without-origin-aggregate`,
`lineage-input-without-digest`, `lineage-input-without-activity`, `lineage-without-product-uni`,
`bad-processing-level`, `bbox-three-numbers`; `ard-claim.` `assessor-without-credential`, `missing-assessment`,
`certified-level`, `empty-requirement-groups`, `specification-without-version`, `missing-product-ref`,
`other-group-without-label`; `detection.` `magnitude-without-uncertainty`, `expanded-without-coverage-factor`,
`interval-without-probability`, `bad-hazard-code`, `empty-evidence`, `location-without-crs`,
`unknown-response-state`, `history-entry-without-time`, `notification-without-recipient-role`,
`model-derived-without-model-run`; `calibration-record.` `eo-gain-without-uncertainty`,
`eo-without-spectral-response`, `eo-without-reference-measurements`, `eo-ce90-not-metres`. Rules a schema cannot
express are proved by the 33 unit tests, including the three profile runs on their example sets (PASS, report valid)
and a broken copy of the OBSP-GRID set in which only CT-GRID-081 fails.

## Open questions

1. Processing levels: the list `L0`, `L1A`, `L1B`, `L1C`, `L2`, `L2A`, `L3`, `L4` is the one in the work package; no
   agency or CEOS document was opened. Should `L1`, `L2B`, `L3A` and so on be allowed (OIP-0010 and OIP-0012 accept
   `^L[0-4][A-D]?$`), and should one published scheme be named?
2. CEOS-ARD: the family names, the requirement group names, the threshold and target terms and the specification
   versions in the examples (5.0, 5.5) are from memory and illustrative; none was checked. Editors to check the names
   and decide whether `specification.identifier` should be a controlled list.
3. UNDRR-ISC Hazard Information Profiles: the identifier pattern (two letters, four digits) and the codes in the
   examples (`TL0103`, `MH0600`) were not checked against the published list; they illustrate the pattern only.
4. QA4EO is cited as principles; should the protocol also name the CEOS guidance on fiducial reference measurements,
   and should `eoCalibration` carry an uncertainty budget per contribution?
5. Zarr v3 chunk keys and COG tiling: is a whole COG file one chunk (as in the SAR example), or must each internal tile
   be listed? Listing tiles gives finer verification at a larger manifest.
6. The chunk manifest's signature uses the signature shape of `attestation-result`. Once OIP-0008 (signature envelope)
   is accepted, should `chunkManifest.signature` move to that envelope?
7. Recipient roles of a detection are new role names outside §3 (they are not protocol participants). Keep them on the
   object, or register them?
8. Should a detection with a magnitude above a threshold be required to produce a CAP notice (OIP-0005), referenced by
   `noticeRef`?
9. Case numbers start at 080 in each profile to stay clear of parallel drafts; editors may renumber.

Acceptance needs appointed editors and a last-call window. Until then this proposal stays at DRAFT.
