Commit 83ffad1e authored by Gaetano Raffaele's avatar Gaetano Raffaele

FIX: Rollback to folder name parsing for retrieving S2 THEIA tile and date.

parent 2dbcc9a2
......@@ -84,11 +84,14 @@ def S2_readTile(fld):
out = str(data['utmZone']) + str(data['latitudeBand']) + str(data['gridSquare'])
return out
'''
# Rollback to folder name solution
loc_id = os.path.basename(fld)
out = loc_id.split('_')[-1]
return out
def S2THEIA_readDate(fld):
'''
mtd = glob.glob(fld + '/*_MTD_ALL.xml')[0]
loc_id = os.path.basename(os.path.split(mtd)[0])
if 'MOSAIC' in loc_id:
......@@ -97,8 +100,14 @@ def S2THEIA_readDate(fld):
dte = ET.parse(mtd).getroot().iter('ACQUISITION_DATE').next().text
out = dte[0:4] + dte[5:7] + dte[8:10]
return out
'''
# Rollback to folder name solution
loc_id = os.path.basename(fld)
out = loc_id.split('_')[-2]
return out
def S2THEIA_readTile(fld):
'''
mtd = glob.glob(fld + '/*_MTD_ALL.xml')[0]
loc_id = os.path.basename(os.path.split(mtd)[0])
if 'MOSAIC' in loc_id:
......@@ -106,6 +115,11 @@ def S2THEIA_readTile(fld):
else:
out = ET.parse(mtd).getroot().iter('GEOGRAPHICAL_ZONE').next().text[1:]
return out
'''
# Rollback to folder name solution
loc_id = os.path.basename(fld)
out = loc_id.split('_')[-1]
return out
def checkCoregistered(f, cfg):
......
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