From 5b1049d6ab31c6693dfd74ee1c369f58f1bfbfb2 Mon Sep 17 00:00:00 2001 From: Impact <pascal.mouquet@ird.fr> Date: Fri, 1 Oct 2021 13:31:35 +0400 Subject: [PATCH] sen2cor 2.9 compatibility --- sen2chain/sen2cor.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sen2chain/sen2cor.py b/sen2chain/sen2cor.py index 3a96930..94fcda5 100644 --- a/sen2chain/sen2cor.py +++ b/sen2chain/sen2cor.py @@ -83,6 +83,18 @@ def process_sen2cor( sorted(l2a_product_path_tmp.glob("*.SAFE"))[0].rename(l2a_product_path.parent / (l2a_product_path.stem + '.SAFE')) l2a_product_path_tmp.rmdir() + elif s2c_v == '02.09.00': + logger.info("sen2cor {} processing: {}".format(s2c_v, l1c_product_path)) + command = "/bin/bash, -c, source {sen2cor_bashrc} && L2A_Process --processing_baseline {processing_baseline} --output_dir {out_dir} {l1c_folder}".format( + sen2cor_bashrc = str(sen2cor_bashrc_path), + processing_baseline = pb, + out_dir = l2a_product_path_tmp, + l1c_folder = str(l1c_product_path) + ) + process = subprocess.run(command.split(", ")) + sorted(l2a_product_path_tmp.glob("*.SAFE"))[0].rename(l2a_product_path.parent / (l2a_product_path.stem + '.SAFE')) + l2a_product_path_tmp.rmdir() + elif s2c_v is not None: logger.info('Sen2Cor version {} is not compatible with Sen2Chain'.format(s2c_v)) -- GitLab