diff --git a/eoreader/products/sar/rcm_product.py b/eoreader/products/sar/rcm_product.py index bc4f4567..43241886 100644 --- a/eoreader/products/sar/rcm_product.py +++ b/eoreader/products/sar/rcm_product.py @@ -228,7 +228,7 @@ def _set_product_type(self) -> None: """Set products type""" # Get MTD XML file root, nsmap = self.read_mtd() - namespace = nsmap[None] + namespace = nsmap.get(None, "") # Open identifier prod_type = root.findtext(f".//{namespace}productType") @@ -263,7 +263,7 @@ def _set_sensor_mode(self) -> None: """ # Get metadata root, nsmap = self.read_mtd() - namespace = nsmap[None] + namespace = nsmap.get(None, "") # Get sensor mode # WARNING: this word may differ from the Enum !!! (no docs available) @@ -303,7 +303,7 @@ def get_datetime(self, as_datetime: bool = False) -> Union[str, datetime]: """ # Get MTD XML file root, nsmap = self.read_mtd() - namespace = nsmap[None] + namespace = nsmap.get(None, "") # Open identifier acq_date = root.findtext(f".//{namespace}rawDataStartTime") @@ -426,7 +426,7 @@ def get_orbit_direction(self) -> OrbitDirection: """ # Get MTD XML file root, nsmap = self.read_mtd() - namespace = nsmap[None] + namespace = nsmap.get(None, "") # Get the orbit direction try: diff --git a/eoreader/products/sar/rs2_product.py b/eoreader/products/sar/rs2_product.py index ab8748d3..5b4859a8 100644 --- a/eoreader/products/sar/rs2_product.py +++ b/eoreader/products/sar/rs2_product.py @@ -379,7 +379,7 @@ def _pre_init(self, **kwargs) -> None: # SNAP can process non-complex archive root, nsmap = self.read_mtd() - namespace = nsmap[None] + namespace = nsmap.get(None, "") # Open identifier prod_type = root.findtext(f".//{namespace}productType") @@ -458,7 +458,7 @@ def _set_sensor_mode(self) -> None: """ # Get metadata root, nsmap = self.read_mtd() - namespace = nsmap[None] + namespace = nsmap.get(None, "") # Get sensor mode # WARNING: this word may differ from the Enum !!! (no docs available) @@ -499,7 +499,7 @@ def get_datetime(self, as_datetime: bool = False) -> Union[str, datetime]: if self.datetime is None: # Get MTD XML file root, nsmap = self.read_mtd() - namespace = nsmap[None] + namespace = nsmap.get(None, "") # Open identifier acq_date = root.findtext(f".//{namespace}rawDataStartTime") @@ -596,7 +596,7 @@ def get_orbit_direction(self) -> OrbitDirection: """ # Get MTD XML file root, nsmap = self.read_mtd() - namespace = nsmap[None] + namespace = nsmap.get(None, "") # Get the orbit direction try: