diff --git a/sen2chain/sen2cor.py b/sen2chain/sen2cor.py index 3a96930dd9efc0fe3650bfe587f6d23041a02523..94fcda51560a8fdfe875ef0c0c0f55e7698217bf 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))