Skip to content
Snippets Groups Projects
Commit c147f916 authored by pascal.mouquet_ird.fr's avatar pascal.mouquet_ird.fr
Browse files

added possibility that Tile().l2a is empty in latest_ql computing

parent 282139a9
No related branches found
No related tags found
No related merge requests found
Pipeline #29 failed
......@@ -887,19 +887,22 @@ class Tile:
And remove previous ones
"""
p = self.l2a.last.identifier
l2a = L2aProduct(p)
outfullpath = l2a.path.parent / "QL" / (l2a.tile + '_' + p[0:4] + Tile._get_date(p).strftime("%Y%m%d") + '_QL_latest.jpg')
outfullpath.parent.mkdir(parents=True, exist_ok=True)
old_ql = list((l2a.path.parent / "QL").glob('*_QL_latest.jpg*'))
liste=[a for a in old_ql if str(outfullpath) not in str(a)]
for f in liste:
f.unlink()
if outfullpath in old_ql:
logger.info("{} - Latest QL already done".format(self.name))
return
if p:
l2a = L2aProduct(p)
outfullpath = l2a.path.parent / "QL" / (l2a.tile + '_' + p[0:4] + Tile._get_date(p).strftime("%Y%m%d") + '_QL_latest.jpg')
outfullpath.parent.mkdir(parents=True, exist_ok=True)
old_ql = list((l2a.path.parent / "QL").glob('*_QL_latest.jpg*'))
liste=[a for a in old_ql if str(outfullpath) not in str(a)]
for f in liste:
f.unlink()
if outfullpath in old_ql:
logger.info("{} - Latest QL already done".format(self.name))
return
else:
l2a.process_ql(out_path = outfullpath, out_resolution=(750,750), jpg = True)
else:
l2a.process_ql(out_path = outfullpath, out_resolution=(750,750), jpg = True)
logger.info("No L2A product available")
def move_old_quicklooks(self):
"""
......
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