From 7e61f7a6be82676a7105f28aea5f88ec5e597faf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ga=C3=ABlle=20USSEGLIO?= <gaelle.usseglio@cnes.fr>
Date: Mon, 20 Jul 2020 11:27:26 +0000
Subject: [PATCH] STYLE : Pattern description for image selection into
 check_image_pattern

---
 python_src/utils/func_utils.py | 23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)

diff --git a/python_src/utils/func_utils.py b/python_src/utils/func_utils.py
index 5c7d36b..a82cdd2 100644
--- a/python_src/utils/func_utils.py
+++ b/python_src/utils/func_utils.py
@@ -258,14 +258,24 @@ def check_image_pattern(img, mode="S1SM") :
     
     
     if mode == "S1SM" :
-        # Mode S1 SM
+        # Mode S1 SM : mmm-bb-ttt-pp-yyyymmddthhmmss-yyyymmddthhmmss*
+        # mmm : Mission identifier (s1a or s1b)
+        # bb : Mode/Beam (s1-s6 for SM)
+        # ttt : Product type (always slc here)
+        # pp : Polarisations (2 letters : hh or vv or vh or hv)
+        # yyyymmddthhmmss : Product start/stop date and times 
+        # (14 digits representing the date and time separated by the character "t")
+        # * : Others representations such as orbits number or images number ...
         pattern = "".join(["s1.", "-", '\w{1}', '\d', "-slc-", '\w{2}', "-", '\d{8}', "t", '\d{6}', "-", '\d{8}', "t", '\d{6}'])
         
         if re.match(pattern, img) :
             correct_pattern = True
 
     elif mode == "Cosmo":
-        # Mode Cosmo
+        # Mode Cosmo : CSKS<i>_*_<YYYYMMDDhhmmss>_<YYYYMMDDhhmmss>
+        # i : Identifier of the satellite (1, 2, 3 or 4)
+        # YYYYMMDDhhmmss : Product start/stop date and times 
+        # * : Others representations such as identifier for orbit direction or look side
         pattern = "".join(["CSKS", '\d'])
         
         if re.match(pattern, img) :
@@ -276,7 +286,14 @@ def check_image_pattern(img, mode="S1SM") :
                 correct_pattern = True
         
     else :
-        # Mode S1 IW
+        # Mode S1 IW : mmm-bb-ttt-pp-yyyymmddthhmmss-yyyymmddthhmmss*
+        # mmm : Mission identifier (s1A or s1B)
+        # bb : Mode/Beam (iw1-iw3 for IW)
+        # ttt : Product type (always slc here)
+        # pp : Polarisations (2 letters : hh or vv or vh or hv)
+        # yyyymmddthhmmss : Product start/stop date and times 
+        # (14 digits representing the date and time separated by the character "t")
+        # * : Others representations such as orbits number or images number ...
         pattern = "".join(["s1.", "-", '\w{2}', '\d', "-slc-", '\w{2}', "-", '\d{8}', "t", '\d{6}', "-", '\d{8}', "t", '\d{6}'])
         
         if re.match(pattern, img) :
-- 
GitLab