From feebada878df63f1a3da064160bd832085317bd3 Mon Sep 17 00:00:00 2001
From: Aurore Dupuis <aurore.dupuis@cnes.fr>
Date: Fri, 15 Apr 2022 21:21:18 +0000
Subject: [PATCH] Fix metadata retrieving

---
 python/s2snow/fsc_config.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/python/s2snow/fsc_config.py b/python/s2snow/fsc_config.py
index eafa5557..8a642504 100755
--- a/python/s2snow/fsc_config.py
+++ b/python/s2snow/fsc_config.py
@@ -321,6 +321,9 @@ class FscConfig:
                 if blue_band_path is not None:
                     self.blue_band_path = blue_band_path  # surcharge avec la valeur dans le fichier de configuration
             
+            if self.blue_band_no_band is None:
+                self.blue_band_no_band = 1  # default value
+
             green_band = input.get("green_band", None)
             if green_band is not None:
                 green_band_no_band = green_band.get("no_band", None)
@@ -366,7 +369,9 @@ class FscConfig:
             if self.swir_band_no_band is None:
                 self.swir_band_no_band = 1  # default value
 
-            self.metadata = input.get("metadata", None)
+            metadata = input.get("metadata", None)
+            if metadata is not None:
+                self.metadata = metadata  # surcharge avec la valeur dans le fichier de configuration
 
     def update_dem(self, dem):
         if dem is not None:
-- 
GitLab