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

UDPADTE: finding date in serie pipeline

parent e6356254
......@@ -6,7 +6,7 @@
__author__ = "Loic Lozach"
__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
from osgeo import gdal, osr, ogr
from subprocess import Popen, PIPE
......@@ -965,8 +965,13 @@ if __name__ == "__main__":
print("Resolving filenames for " + sard)
sardata = os.path.basename(sard)
sarsplit = sardata.split('_')
sardate = sarsplit[4].split('T')
fdate = re.findall("20\d{6}T\d{6}",sardata)
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]
mois =sardate[0][4:6]
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