Commit d6009f81 authored by Lozac'h Loic's avatar Lozac'h Loic
Browse files

UDPADTE: finding date in serie pipeline

parent e6356254
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
__author__ = "Loic Lozach" __author__ = "Loic Lozach"
__date__ = "$Dec 14, 2018 12:40:21 PM$" __date__ = "$Dec 14, 2018 12:40:21 PM$"
import os, argparse, subprocess, math, datetime,glob import os, argparse, subprocess, math, datetime,glob, re
import otbApplication import otbApplication
from osgeo import gdal, osr, ogr from osgeo import gdal, osr, ogr
from subprocess import Popen, PIPE from subprocess import Popen, PIPE
...@@ -965,8 +965,13 @@ if __name__ == "__main__": ...@@ -965,8 +965,13 @@ if __name__ == "__main__":
print("Resolving filenames for " + sard) print("Resolving filenames for " + sard)
sardata = os.path.basename(sard) sardata = os.path.basename(sard)
sarsplit = sardata.split('_') fdate = re.findall("20\d{6}T\d{6}",sardata)
sardate = sarsplit[4].split('T') if not(fdate):
print("Impossible de trouver la date dans le nom de fichier : "+n)
exit
# sarsplit = sardata.split('_')
# sardate = sarsplit[4].split('T')
sardate = fdate[0].split('T')
annee =sardate[0][:4] annee =sardate[0][:4]
mois =sardate[0][4:6] mois =sardate[0][4:6]
print(annee+" / "+mois) print(annee+" / "+mois)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment