Skip to content
Snippets Groups Projects
Commit 7e61f7a6 authored by Gaëlle USSEGLIO's avatar Gaëlle USSEGLIO
Browse files

STYLE : Pattern description for image selection into check_image_pattern

parent 36f180e4
No related branches found
No related tags found
No related merge requests found
...@@ -258,14 +258,24 @@ def check_image_pattern(img, mode="S1SM") : ...@@ -258,14 +258,24 @@ def check_image_pattern(img, mode="S1SM") :
if 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}']) pattern = "".join(["s1.", "-", '\w{1}', '\d', "-slc-", '\w{2}', "-", '\d{8}', "t", '\d{6}', "-", '\d{8}', "t", '\d{6}'])
if re.match(pattern, img) : if re.match(pattern, img) :
correct_pattern = True correct_pattern = True
elif mode == "Cosmo": 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']) pattern = "".join(["CSKS", '\d'])
if re.match(pattern, img) : if re.match(pattern, img) :
...@@ -276,7 +286,14 @@ def check_image_pattern(img, mode="S1SM") : ...@@ -276,7 +286,14 @@ def check_image_pattern(img, mode="S1SM") :
correct_pattern = True correct_pattern = True
else : 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}']) pattern = "".join(["s1.", "-", '\w{2}', '\d', "-slc-", '\w{2}', "-", '\d{8}', "t", '\d{6}', "-", '\d{8}', "t", '\d{6}'])
if re.match(pattern, img) : if re.match(pattern, img) :
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment