Skip to content

Commit fe38716

Browse files
author
Derek Tan
committed
Use real Collection 4 manifest and correct data object IDs
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.
1 parent 3be1efe commit fe38716

38 files changed

Lines changed: 2832 additions & 132 deletions

src/stactools/sentinel3/constants.py

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -737,11 +737,58 @@
737737
# products were added. See:
738738
# https://user.eumetsat.int/news-events/news/update-to-sentinel-3-olci-level-2-water-processing
739739
OLCI_L2_WATER_ASSET_KEYS_C4 = [
740-
"chlorAData",
741-
"fluorescenceData",
740+
"chlor_aData",
741+
"fluoData",
742742
"iopLsdData",
743743
]
744744

745+
# Maps each OLCI L2 water data object ID to the OLCI bands it is derived from.
746+
# Data objects without an entry here (annotation files, and the Collection 4
747+
# chlor_a/fluorescence/iop_lsd products) carry no eo:bands.
748+
OLCI_L2_WATER_BAND_KEYS = {
749+
"chlNnData": [
750+
"Oa01",
751+
"Oa02",
752+
"Oa03",
753+
"Oa04",
754+
"Oa05",
755+
"Oa06",
756+
"Oa07",
757+
"Oa08",
758+
"Oa09",
759+
"Oa10",
760+
"Oa11",
761+
"Oa12",
762+
"Oa16",
763+
"Oa17",
764+
"Oa18",
765+
"Oa21",
766+
],
767+
"tsmNnData": [
768+
"Oa01",
769+
"Oa02",
770+
"Oa03",
771+
"Oa04",
772+
"Oa05",
773+
"Oa06",
774+
"Oa07",
775+
"Oa08",
776+
"Oa09",
777+
"Oa10",
778+
"Oa11",
779+
"Oa12",
780+
"Oa16",
781+
"Oa17",
782+
"Oa18",
783+
"Oa21",
784+
],
785+
"chlOc4meData": ["Oa03", "Oa04", "Oa05", "Oa06"],
786+
"iopNnData": ["Oa01", "Oa12", "Oa16", "Oa17", "Oa21"],
787+
"iwvData": ["Oa18", "Oa19"],
788+
"trspData": ["Oa04", "Oa06"],
789+
"wAerData": ["Oa05", "Oa06", "Oa17"],
790+
}
791+
745792
SLSTR_L1_ASSET_KEYS = [
746793
"SLSTR_S1_RAD_AN_Data",
747794
"SLSTR_S2_RAD_AN_Data",

src/stactools/sentinel3/metadata_links.py

Lines changed: 2 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -559,53 +559,6 @@ def strip_prefix(prefix: str, content: str) -> str:
559559
asset_identifier_list.append(asset_key)
560560
asset_list.append(asset_obj)
561561
elif "_WFR_" in product_type:
562-
# Map each water data object ID to the OLCI bands it is
563-
# derived from. Data objects without an entry here (annotation
564-
# files, and the Collection 4 chlor_a/fluorescence/iop_lsd
565-
# products) carry no eo:bands.
566-
band_key_map = {
567-
"chlNnData": [
568-
"Oa01",
569-
"Oa02",
570-
"Oa03",
571-
"Oa04",
572-
"Oa05",
573-
"Oa06",
574-
"Oa07",
575-
"Oa08",
576-
"Oa09",
577-
"Oa10",
578-
"Oa11",
579-
"Oa12",
580-
"Oa16",
581-
"Oa17",
582-
"Oa18",
583-
"Oa21",
584-
],
585-
"tsmNnData": [
586-
"Oa01",
587-
"Oa02",
588-
"Oa03",
589-
"Oa04",
590-
"Oa05",
591-
"Oa06",
592-
"Oa07",
593-
"Oa08",
594-
"Oa09",
595-
"Oa10",
596-
"Oa11",
597-
"Oa12",
598-
"Oa16",
599-
"Oa17",
600-
"Oa18",
601-
"Oa21",
602-
],
603-
"chlOc4meData": ["Oa03", "Oa04", "Oa05", "Oa06"],
604-
"iopNnData": ["Oa01", "Oa12", "Oa16", "Oa17", "Oa21"],
605-
"iwvData": ["Oa18", "Oa19"],
606-
"trspData": ["Oa04", "Oa06"],
607-
"wAerData": ["Oa05", "Oa06", "Oa17"],
608-
}
609562
# Iterate over both the legacy water keys and the Collection 4
610563
# (v4.01) additions. Data objects that are not present in this
611564
# particular manifest are skipped, so the same code handles
@@ -617,8 +570,8 @@ def strip_prefix(prefix: str, content: str) -> str:
617570
):
618571
if len(manifest.findall(f".//dataObject[@ID='{asset_key}']")) == 0:
619572
continue
620-
if asset_key in band_key_map:
621-
band_key_list = band_key_map[asset_key]
573+
if asset_key in constants.OLCI_L2_WATER_BAND_KEYS:
574+
band_key_list = constants.OLCI_L2_WATER_BAND_KEYS[asset_key]
622575
elif asset_key.startswith("Oa") and asset_key.endswith(
623576
"_reflectanceData"
624577
):

0 commit comments

Comments
 (0)