Skip to content

Commit

Permalink
fix: New Aqua filename syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
castelao committed Oct 5, 2023
1 parent be7d658 commit 03b79c3
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions OceanColor/backend/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,9 @@ def mission(self):

if attrs["platform"] == "S":
return "SeaWIFS"
elif attrs["platform"] == "A":
elif attrs["platform"] == "AQUA_MODIS":
return "MODIS-Aqua"
elif attrs["platform"] == "T":
elif attrs["platform"] == "TERRA_MODIS":
return "MODIS-Terra"
elif attrs["platform"] == "V":
if attrs["instrument"] == "JPSS1":
Expand All @@ -265,7 +265,8 @@ def dirname(self):
self.mission,
self.attrs["mode"],
self.attrs["year"],
self.attrs["doy"],
self.attrs["month"],
self.attrs["day"],
)
return path

Expand Down Expand Up @@ -305,14 +306,16 @@ def parse_filename(filename: str):
- V2018006230000.L2_JPSS1_OC.nc
"""
rule = r"""
(?P<platform>[S|A|T|V])
(?P<platform>S|V|(?:AQUA_MODIS)|(?:TERRA_MODIS))
.
(?P<year>\d{4})
(?P<doy>\d{3})
(?P<time>\d+)?
\.
(?P<month>\d{2})
(?P<day>\d{2})
.
(?P<mode>(L2)|(L3m))
(?:_DAY)?
_ (?P<instrument>(?:SNPP)|(?:JPSS1))?
(?:.DAY)?
.
(?P<instrument>(?:SNPP)|(?:JPSS1))?
.*?
\.nc
"""
Expand Down

0 comments on commit 03b79c3

Please sign in to comment.