Commit 6e18cd74 authored by Gaetano Raffaele's avatar Gaetano Raffaele

FIX: Rollback to folder name solution to retrieve S2 date and tile.

parent a77b4318
......@@ -55,6 +55,7 @@ def L8_readDate(fld):
def S2_readDate(fld):
'''
tli = glob.glob(fld + '/tileInfo.json')[0]
loc_id = os.path.basename(os.path.split(tli)[0])
if 'MOSAIC' in loc_id:
......@@ -64,9 +65,15 @@ def S2_readDate(fld):
data = json.load(json_data)
out = data['timestamp'][0:10].replace('-', '')
return out
'''
# Rollback to folder name solution
loc_id = os.path.basename(fld)
out = loc_id.split('_')[-2]
return out
def S2_readTile(fld):
'''
tli = glob.glob(fld + '/tileInfo.json')[0]
loc_id = os.path.basename(os.path.split(tli)[0])
if 'MOSAIC' in loc_id:
......@@ -76,7 +83,10 @@ def S2_readTile(fld):
data = json.load(json_data)
out = str(data['utmZone']) + str(data['latitudeBand']) + str(data['gridSquare'])
return out
'''
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]
......
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