diff --git a/sen2chain/download_eodag.py b/sen2chain/download_eodag.py index 3283dffa2b5b974cbef9cf3e75a6bd91a2a5a442..11d474a1cf199454caf7ce0ea62a6198b60eb748 100644 --- a/sen2chain/download_eodag.py +++ b/sen2chain/download_eodag.py @@ -143,7 +143,14 @@ class S2cEodag: else: logger.info("{} - local l1c {} - local l2a {} - remote {}".format(p.properties["title"], l1c_presence, l2a_presence, p.properties["storageStatus"])) - # elif ref == "ndvi" or indice: + elif ref == "indice": + toto = 12 + l2a_identifier = p.properties["title"].replace("L1C_", "L2A_").replace("__OPER__", "_USER_") + l2aProduct(l2a_identifier) + + + elif isinstance(ref, list): + toto = 24 # toto = 13 diff --git a/sen2chain/jobs.py b/sen2chain/jobs.py index 28dbfafd79e1c60561f636f445c5cea6d1d19fb0..17e3a8b339e8ae0b17d1753ab87232c0a7b9c45f 100644 --- a/sen2chain/jobs.py +++ b/sen2chain/jobs.py @@ -753,10 +753,13 @@ class Job: t = Tile(row.tile) prodlist = [p for p in l1c_process_list if row.tile in p] t.remove_l1c(prodlist) - logger.info("Removing downloaded l1c products: {}".format(prodlist)) + logger.info("Removed {} downloaded l1c products: {}".format(len(prodlist), prodlist)) if self.logs: - f.write("{}\nRemoving downloaded l1c products: {}\n\n".format(datetime.datetime.now(), prodlist)) - f.flush() + f.write("{}\nRemoved {} downloaded l1c products:\n".format(datetime.datetime.now(), len(prodlist))) + for l1c in prodlist: + f.write("{}\n".format(l1c)) + f.write("\n") + f.flush() # Comuting cloudmasks (from L2A) logger.info("Computing cloudmasks") @@ -950,11 +953,12 @@ class Job: t = Tile(row.tile) prodlist = [p for p in l2a_remove_list if row.tile in p] t.remove_l2a(prodlist) - logger.info("Removing {} produced l2a product(s): {}".format(len(prodlist), prodlist)) + logger.info("Removed {} produced l2a product(s): {}".format(len(prodlist), prodlist)) if self.logs: - f.write("Removing {} produced l2a products: {}\n".format(len(prodlist))) + f.write("{}\nRemoved {} produced l2a products:\n".format(datetime.datetime.now(), len(prodlist))) for l2a in prodlist: - f.write("{}\n\n".format(l2a)) + f.write("{}\n".format(l2a)) + f.write("\n") f.flush() # Cleaning after diff --git a/sen2chain/tiles.py b/sen2chain/tiles.py index f0666229affeba9e388186c5c1828a3b1dbbc5d5..37889193b9da11decf9dd430cad11d4ece7fac6c 100644 --- a/sen2chain/tiles.py +++ b/sen2chain/tiles.py @@ -781,7 +781,6 @@ class Tile: Returns tile's L2A products that don't have indices as a ProductsList. """ prodlist = ProductsList() - try: if not nodata_clouds: missings_indice_set = set(self.l2a.products) - { @@ -835,6 +834,9 @@ class Tile: tries: int = 1, sleep: int = 0, ): + """ + function to download L1C products using EODAG + """ if provider == "scihub": NUM_THREADS = 4 else: