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