Skip to content

Commit

Permalink
Update not real constellations with STAC flavors of S1 and S2
Browse files Browse the repository at this point in the history
  • Loading branch information
remi-braun committed Nov 4, 2024
1 parent dbe4784 commit 62fac80
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 39 deletions.
6 changes: 6 additions & 0 deletions CI/SCRIPTS/test_others.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,12 @@ def test_constellations():
assert Constellation.SPOT45 not in real_const
assert Constellation.MAXAR not in real_const
assert Constellation.CUSTOM not in real_const
assert Constellation.S2_E84 not in real_const
assert Constellation.S2_MPC not in real_const
assert Constellation.S2_SIN not in real_const
assert Constellation.S1_RTC_ASF not in real_const
assert Constellation.S1_RTC_MPC not in real_const

assert Constellation.is_real_constellation(Constellation.S2)
assert not Constellation.is_real_constellation(Constellation.MAXAR)
assert not Constellation.is_real_constellation(Constellation.S1_RTC_ASF)
100 changes: 61 additions & 39 deletions eoreader/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,46 +73,16 @@ class Constellation(ListEnum):
S1 = "Sentinel-1"
"""Sentinel-1"""

S1_RTC_ASF = "Sentinel-1 RTC ASF"
"""
Sentinel-1 RTC processed by ASF: https://hyp3-docs.asf.alaska.edu/guides/rtc_product_guide/
"""

S1_RTC_MPC = "Sentinel-1 RTC MPC"
"""
Sentinel-1 RTC processed by MPC: https://planetarycomputer.microsoft.com/dataset/sentinel-1-rtc
"""

S2 = "Sentinel-2"
"""Sentinel-2"""

S2_E84 = "Sentinel-2 stored on AWS and processed by Element84"
"""
Sentinel-2 stored on AWS and processed by Element84:
- Element84: arn:aws:s3:::sentinel-cogs - https://registry.opendata.aws/sentinel-2-l2a-cogs
Not a real constellation, only used for regex.
"""

S2_MPC = "Sentinel-2 stored on Azure and processed by Microsoft Planetary Computer"
"""
Sentinel-2 stored on Azure and processed by Microsoft Planetary Computer:
https://planetarycomputer.microsoft.com/dataset/sentinel-2-l2a
Not a real constellation, only used for regex.
"""

S2_SIN = "Sentinel-2 stored on AWS and processed by Sinergise"
S2_THEIA = "Sentinel-2 Theia"
"""
Sentinel-2 stored on AWS and processed by Sinergise:
arn:aws:s3:::sentinel-s2-l1c and arn:aws:s3:::sentinel-s2-l2a - https://registry.opendata.aws/sentinel-2/
Sentinel-2, reprocessed by Theia.
Not a real constellation, only used for regex.
Considered as a new constellation as the product is completely different different from Sentinel-2.
"""

S2_THEIA = "Sentinel-2 Theia"
"""Sentinel-2 Theia"""

S3_OLCI = "Sentinel-3 OLCI"
"""Sentinel-3 OLCI"""

Expand Down Expand Up @@ -189,7 +159,11 @@ class Constellation(ListEnum):
"""GEOSAT-2 (ex. DEIMOS-2)"""

HLS = "HLS"
"""Harmonized Landsat-Sentinel"""
"""
Harmonized Landsat-Sentinel
Considered as a new constellation as the products are completely different from Sentinel-2 and Landsat.
"""

QB02 = "QuickBird"
"""QuickBird"""
Expand Down Expand Up @@ -230,21 +204,69 @@ class Constellation(ListEnum):
CAPELLA = "Capella"
"""Capella"""

# Under here, not real constellations: either CUSTOM, templates or different flavors from the same constellation
CUSTOM = "CUSTOM"
"""Custom stack"""

S1_RTC_ASF = "Sentinel-1 RTC ASF"
"""
Sentinel-1 RTC processed by ASF: https://hyp3-docs.asf.alaska.edu/guides/rtc_product_guide/
Not a real constellation, only used for regex.
"""

S1_RTC_MPC = "Sentinel-1 RTC MPC"
"""
Sentinel-1 RTC processed by MPC: https://planetarycomputer.microsoft.com/dataset/sentinel-1-rtc
Not a real constellation, only used for regex.
"""

S2_E84 = "Sentinel-2 stored on AWS and processed by Element84"
"""
Sentinel-2 stored on AWS and processed by Element84:
- Element84: arn:aws:s3:::sentinel-cogs - https://registry.opendata.aws/sentinel-2-l2a-cogs
Not a real constellation, only used for regex.
"""

S2_MPC = "Sentinel-2 stored on Azure and processed by Microsoft Planetary Computer"
"""
Sentinel-2 stored on Azure and processed by Microsoft Planetary Computer:
https://planetarycomputer.microsoft.com/dataset/sentinel-2-l2a
Not a real constellation, only used for regex.
"""

S2_SIN = "Sentinel-2 stored on AWS and processed by Sinergise"
"""
Sentinel-2 stored on AWS and processed by Sinergise:
arn:aws:s3:::sentinel-s2-l1c and arn:aws:s3:::sentinel-s2-l2a - https://registry.opendata.aws/sentinel-2/
Not a real constellation, only used for regex.
"""

SPOT45 = "Spot-4/5"
"""SPOT-4/5 (not a real constellation, but used as a template for SPOT4/5 products)"""

MAXAR = "Maxar"
"""Maxar (not a real constellation, but used as a template for every Maxar products)"""

CUSTOM = "CUSTOM"
"""Custom stack"""

@classmethod
def get_real_constellations(cls):
"""
Get only constellations of existing satellite (discard CUSTOM, templates etc)
Get only constellations of existing satellite (discard CUSTOM, templates, flavors etc.)
"""
not_real = [cls.MAXAR, cls.SPOT45, cls.CUSTOM]
not_real = [
cls.S2_E84,
cls.S2_MPC,
cls.S2_SIN,
cls.S1_RTC_ASF,
cls.S1_RTC_MPC,
cls.MAXAR,
cls.SPOT45,
cls.CUSTOM,
]
return {const for const in cls.__members__.values() if const not in not_real}

@classmethod
Expand Down

0 comments on commit 62fac80

Please sign in to comment.