Skip to content

Support OLCI Collection 4 (v4.01) L2 water processing baseline - #37

Merged
gadomski merged 2 commits into
stactools-packages:mainfrom
DerekTan1:fix/olci-collection-4-water-baseline
Jun 29, 2026
Merged

gadomski merged 2 commits into
stactools-packages:mainfrom
DerekTan1:fix/olci-collection-4-water-baseline

Conversation

@DerekTan1

Copy link
Copy Markdown
Contributor

Summary

The OLCI Collection 4 (v4.01) L2 water processing baseline replaced the OC4Me chlorophyll product (chl_oc4me.nc / chlOc4meData) with chlor_a.nc and added fluorescence.nc and iop_lsd.nc. Manifests from the new baseline no longer contain chlOc4meData, which caused create_item to raise RuntimeError: Xpath returns no href: .//dataObject[@ID='chlOc4meData']//fileLocation and abort item creation.

Ref: https://user.eumetsat.int/news-events/news/update-to-sentinel-3-olci-level-2-water-processing

Changes

  • Skip water data objects absent from the manifest instead of raising, so both the legacy and Collection 4 baselines are handled.
  • Add the new Collection 4 water data object keys (chlorAData, fluorescenceData, iopLsdData) so they become assets when present.
  • Make the WFR branch data-driven via a band lookup map and return only the asset keys actually present, fixing a latent misalignment between the returned asset key list and the asset/identifier lists.
  • Add regression tests for the missing-data-object case and the new Collection 4 assets.

Open item for review

The exact Collection 4 dataObject ID strings (chlorAData, etc.) and band associations for the new products are inferred from the EUMETSAT notice and not yet confirmed against a real v4.01 product, since one was not available at the time of writing. These should be verified once a Collection 4 WFR product is accessible; only the constants would need updating if the IDs differ.

Testing

  • pytest: 47 passed
  • flake8, black --check, isort --check, mypy: clean

The OLCI Collection 4 (v4.01) processing baseline replaced the OC4Me
chlorophyll product (chl_oc4me.nc / chlOc4meData) with chlor_a.nc and
added new fluorescence (fluorescence.nc) and inherent optical properties
(iop_lsd.nc) products. Manifests from the new baseline no longer contain
the chlOc4meData data object, which caused create_item to raise
"RuntimeError: Xpath returns no href" and abort item creation.

Changes:
- Skip water data objects that are absent from the manifest instead of
  raising, so both the legacy and Collection 4 baselines are handled.
- Add the new Collection 4 water data object keys (chlorAData,
  fluorescenceData, iopLsdData) so they become assets when present.
- Make the WFR branch data-driven via a band lookup map and return only
  the asset keys actually present, fixing a latent misalignment between
  the returned asset key list and the asset/identifier lists.
- Add regression tests covering the missing-data-object case and the new
  Collection 4 assets.

Note: the exact Collection 4 dataObject ID strings and band associations
for the new products should be confirmed against a real v4.01 product
once available.

See: https://user.eumetsat.int/news-events/news/update-to-sentinel-3-olci-level-2-water-processing
@gadomski
gadomski self-requested a review June 29, 2026 16:39

@gadomski gadomski left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix feels fine (the original code is pretty awkward so changing it will also be awkward), just one request to use real-world metadata files (instead of synthetic regex changes) for the tests.

Comment thread src/stactools/sentinel3/metadata_links.py Outdated
Comment thread tests/test_metadata.py Outdated
Address review feedback:
- Verified the new water data object IDs against the real Collection 4
  (v4.01) product that caused the original failure (fetched from the
  Planetary Computer sentinel3euwest store). The actual IDs are
  chlor_aData and fluoData (not the previously guessed chlorAData /
  fluorescenceData); iopLsdData was correct.
- Move the water band lookup from a function-scoped dict to the
  module-level OLCI_L2_WATER_BAND_KEYS constant.
- Replace the synthetic regex-based tests with tests that use a real
  Collection 4 manifest committed under tests/data-files (NetCDF assets
  stripped to header-only stubs, matching the existing fixtures), plus a
  command-level test that builds and validates a full item.

@gadomski gadomski left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the changes! I'll cut a release after merging.

@gadomski
gadomski merged commit 1d5a57d into stactools-packages:main Jun 29, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants