From 2da8a60810faf7edae46205c5c8bdd813cf99558 Mon Sep 17 00:00:00 2001 From: jteulade Date: Mon, 6 May 2024 15:28:39 +0200 Subject: [PATCH] Fix #140: replace QB satellite ID with QB02 satellite ID --- CHANGES.md | 1 + eoreader/products/optical/maxar_product.py | 8 ++++---- eoreader/reader.py | 8 ++++---- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 0d6dabdf..1b5039c4 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,7 @@ ## 0.21.2 (2024-mm-dd) +- FIX: Fix `Maxar` product with `QB02` satellite ID ([#140](https://github.com/sertit/eoreader/issues/140)) - ENH: `to_str` and `to_band`: add a `as_list` argument defaulting to `True`. When set as False, return a str from `to_str` and a band from `to_band` ([#138](https://github.com/sertit/eoreader/issues/138)). Thanks @jsetty! - FIX: Fix issue with geocoding with unzipped `Sentinel-3 OLCI` product ([#137](https://github.com/sertit/eoreader/issues/137)) - FIX: Fix iceye product when extent file (*.kml) not found ([#135](https://github.com/sertit/eoreader/pull/135)) diff --git a/eoreader/products/optical/maxar_product.py b/eoreader/products/optical/maxar_product.py index 9aceb60d..3495fc0f 100644 --- a/eoreader/products/optical/maxar_product.py +++ b/eoreader/products/optical/maxar_product.py @@ -123,7 +123,7 @@ NIR: GainOffset(gain=1.0, offset=0.0), NARROW_NIR: GainOffset(gain=1.0, offset=0.0), }, # 2017v0 - Constellation.QB: { + Constellation.QB02: { PAN: GainOffset(gain=0.870, offset=-1.491), BLUE: GainOffset(gain=1.105, offset=-2.820), GREEN: GainOffset(gain=1.071, offset=-3.338), @@ -191,7 +191,7 @@ NIR: 937.8, NARROW_NIR: 937.8, }, - Constellation.QB: { + Constellation.QB02: { PAN: 1370.92, BLUE: 1949.59, GREEN: 1823.64, @@ -432,7 +432,7 @@ def _set_instrument(self) -> None: elif self.constellation == Constellation.WV04: # SpaceView-110 camera self.instrument = "SpaceView-110 camera" - elif self.constellation == Constellation.QB: + elif self.constellation == Constellation.QB02: # Ball Global Imaging System 2000 self.instrument = "BGIS-2000" elif self.constellation == Constellation.GE01: @@ -575,7 +575,7 @@ def _get_spectral_bands(self) -> dict: }, ), } - elif self.constellation == Constellation.QB: + elif self.constellation == Constellation.QB02: spectral_bands = { "pan": SpectralBand( eoreader_name=PAN, diff --git a/eoreader/reader.py b/eoreader/reader.py index 95712077..ef3ed91d 100644 --- a/eoreader/reader.py +++ b/eoreader/reader.py @@ -183,7 +183,7 @@ class Constellation(ListEnum): HLS = "HLS" """Harmonized Landsat-Sentinel""" - QB = "QuickBird" + QB02 = "QuickBird" """QuickBird""" GE01 = "GeoEye-1" @@ -275,7 +275,7 @@ class Constellation(ListEnum): Constellation.SPOT5: r"SP05_HRG_(HM_|J__|T__|X__|TX__|HMX)__\d_\d{8}T\d{6}_\d{8}T\d{6}_.*", Constellation.VIS1: r"VIS1_(PAN|BUN|PSH|MS4)_.+_\d{2}-\d", Constellation.RCM: r"RCM\d_OK\d+_PK\d+_\d_.{4,}_\d{8}_\d{6}(_(HH|VV|VH|HV|RV|RH)){1,4}_(SLC|GRC|GRD|GCC|GCD)", - Constellation.QB: r"\d{12}_\d{2}_P\d{3}_(MUL|PAN|PSH|MOS)", + Constellation.QB02: r"\d{12}_\d{2}_P\d{3}_(MUL|PAN|PSH|MOS)", Constellation.GE01: r"\d{12}_\d{2}_P\d{3}_(MUL|PAN|PSH|MOS)", Constellation.WV01: r"\d{12}_\d{2}_P\d{3}_(MUL|PAN|PSH|MOS)", Constellation.WV02: r"\d{12}_\d{2}_P\d{3}_(MUL|PAN|PSH|MOS)", @@ -347,7 +347,7 @@ class Constellation(ListEnum): r"\d+_[RHV]{2}\.tif", ], }, - Constellation.QB: r"\d{2}\w{3}\d{8}-.{4}(_R\dC\d|)-\d{12}_\d{2}_P\d{3}.TIL", + Constellation.QB02: r"\d{2}\w{3}\d{8}-.{4}(_R\dC\d|)-\d{12}_\d{2}_P\d{3}.TIL", Constellation.GE01: r"\d{2}\w{3}\d{8}-.{4}(_R\dC\d|)-\d{12}_\d{2}_P\d{3}.TIL", Constellation.WV01: r"\d{2}\w{3}\d{8}-.{4}(_R\dC\d|)-\d{12}_\d{2}_P\d{3}.TIL", Constellation.WV02: r"\d{2}\w{3}\d{8}-.{4}(_R\dC\d|)-\d{12}_\d{2}_P\d{3}.TIL", @@ -922,7 +922,7 @@ def create_product( constellation = None # All product names are the same, so assess it with MTD # Maxar-like constellations elif constellation in [ - Constellation.QB, + Constellation.QB02, Constellation.GE01, Constellation.WV01, Constellation.WV02,