From 2ff73cf0edb63f2c042e6696cc1626956b4663b9 Mon Sep 17 00:00:00 2001 From: BRAUN REMI Date: Mon, 4 Nov 2024 17:29:02 +0100 Subject: [PATCH] Create TDX and PAZ classes to disambiguate there constellations --- eoreader/products/sar/paz_product.py | 25 +++++++++++++++++++++++++ eoreader/products/sar/tdx_product.py | 25 +++++++++++++++++++++++++ eoreader/reader.py | 6 +----- 3 files changed, 51 insertions(+), 5 deletions(-) create mode 100644 eoreader/products/sar/paz_product.py create mode 100644 eoreader/products/sar/tdx_product.py diff --git a/eoreader/products/sar/paz_product.py b/eoreader/products/sar/paz_product.py new file mode 100644 index 00000000..d593d7e9 --- /dev/null +++ b/eoreader/products/sar/paz_product.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Copyright 2024, SERTIT-ICube - France, https://sertit.unistra.fr/ +# This file is part of eoreader project +# https://github.com/sertit/eoreader +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +""" +PAZ products +More info `here `_. +""" +from eoreader.products import TsxProduct + + +class PazProduct(TsxProduct): + """Class for PAZ Products""" diff --git a/eoreader/products/sar/tdx_product.py b/eoreader/products/sar/tdx_product.py new file mode 100644 index 00000000..8fef6806 --- /dev/null +++ b/eoreader/products/sar/tdx_product.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Copyright 2024, SERTIT-ICube - France, https://sertit.unistra.fr/ +# This file is part of eoreader project +# https://github.com/sertit/eoreader +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +""" +TanDEM-X products +More info `here `_. +""" +from eoreader.products import TsxProduct + + +class TdxProduct(TsxProduct): + """Class for TanDEM-X Products""" diff --git a/eoreader/reader.py b/eoreader/reader.py index 8bf00056..18b609de 100644 --- a/eoreader/reader.py +++ b/eoreader/reader.py @@ -981,12 +981,8 @@ def create_product( sat_class = constellation.name.lower() + "_product" # Channel correctly the constellations to their generic files (just in case) - # TerraSAR-like constellations - if constellation in [Constellation.TDX, Constellation.PAZ]: - sat_class = "tsx_product" - constellation = None # All product names are the same, so assess it with MTD # Maxar-like constellations - elif constellation in [ + if constellation in [ Constellation.QB02, Constellation.GE01, Constellation.WV01,