Skip to content

Commit

Permalink
Check S2_SIN after all others
Browse files Browse the repository at this point in the history
  • Loading branch information
remi-braun committed Nov 14, 2023
1 parent e1efa83 commit 9ee2c2e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions eoreader/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ class Constellation(ListEnum):
Constellation.S2: r"S2[AB]_MSIL(1C|2A)_\d{8}T\d{6}_N\d{4}_R\d{3}_T\d{2}\w{3}_\d{8}T\d{6}",
# Element84 : S2A_31UDQ_20230714_0_L2A, Sinergise: 0 or 1...
Constellation.S2_E84: r"S2[AB]_\d{2}\w{3}_\d{8}_\d_L(1C|2A)",
Constellation.S2_SIN: r"\d",
Constellation.S2_THEIA: r"SENTINEL2[AB]_\d{8}-\d{6}-\d{3}_L(2A|1C)_T\d{2}\w{3}_[CDH](_V\d-\d|)",
Constellation.S3_OLCI: r"S3[AB]_OL_[012]_\w{6}_\d{8}T\d{6}_\d{8}T\d{6}_\d{8}T\d{6}_\w{17}_\w{3}_[OFDR]_(NR|ST|NT)_\d{3}",
Constellation.S3_SLSTR: r"S3[AB]_SL_[012]_\w{6}_\d{8}T\d{6}_\d{8}T\d{6}_\d{8}T\d{6}_\w{17}_\w{3}_[OFDR]_(NR|ST|NT)_\d{3}",
Expand Down Expand Up @@ -266,6 +265,7 @@ class Constellation(ListEnum):
],
Constellation.HLS: r"HLS\.[LS]30\.T\d{2}\w{3}\.\d{7}T\d{6}\.v2\.0",
Constellation.GS2: r"DE2_(PM4|PSH|PS3|PS4|MS4|PAN)_L1[A-D]_\d{6}_\d{8}T\d{6}_\d{8}T\d{6}_DE2_\d{5}_.{4}",
Constellation.S2_SIN: [r"\d", r"B12\.jp2"],
}

MTD_REGEX = {
Expand All @@ -276,13 +276,6 @@ class Constellation(ListEnum):
},
Constellation.S2: {"nested": 3, "regex": r"MTD_TL.xml"},
Constellation.S2_E84: rf"{CONSTELLATION_REGEX[Constellation.S2_E84]}\.json",
Constellation.S2_SIN: {
"nested": -1, # File that can be found at any level (product/**/file)
"regex": [
r"metadata\.xml", # Too generic name, check also a band
r"B12\.jp2",
],
},
Constellation.S2_THEIA: rf"{CONSTELLATION_REGEX[Constellation.S2_THEIA]}_MTD_ALL\.xml",
Constellation.S3_OLCI: r"Oa\d{2}_radiance.nc",
Constellation.S3_SLSTR: r"S\d_radiance_an.nc",
Expand Down Expand Up @@ -361,6 +354,13 @@ class Constellation(ListEnum):
r"IMAGERY\.TIF",
],
},
Constellation.S2_SIN: {
"nested": 1, # File that can be found at any level (product/**/file)
"regex": [
r"metadata\.xml", # Too generic name, check also a band
r"B12\.jp2",
],
},
}


Expand Down

0 comments on commit 9ee2c2e

Please sign in to comment.