From 468ce56e1f96207c4ebf3da1c36cf908079918f8 Mon Sep 17 00:00:00 2001 From: msavinaud Date: Thu, 12 Jan 2023 09:49:06 +0100 Subject: [PATCH 1/2] fix the failed test about agera5 --- tests/test_bucket_ewoc.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/test_bucket_ewoc.py b/tests/test_bucket_ewoc.py index 0c2ccc2..f13b61c 100644 --- a/tests/test_bucket_ewoc.py +++ b/tests/test_bucket_ewoc.py @@ -37,11 +37,6 @@ def test_ewoc_aux_data(self): self.assertTrue((out_dirpath / "N53E031.hgt").exists()) self.assertTrue((out_dirpath / "N53E032.hgt").exists()) - # TODO Need to fix the following lines to avoid to use private attribute - with self.assertRaises(ValueError): - ewoc_auxdata_bucket.agera5_to_satio_csv() - - ewoc_auxdata_bucket._bucket_name = "ewoc-agera5-yearly" ewoc_auxdata_bucket.agera5_to_satio_csv() self.assertTrue((out_dirpath / "satio_agera5.csv").exists()) ewoc_auxdata_bucket.close() From 886b28c9ca721dedf4e98a9b6bccdb05d4fc7935 Mon Sep 17 00:00:00 2001 From: romain-bdc Date: Tue, 21 Feb 2023 11:34:27 +0100 Subject: [PATCH 2/2] add an if statement in function get_s2_product() in order to have the same date in the product name --- src/ewoc_dag/s2_dag.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ewoc_dag/s2_dag.py b/src/ewoc_dag/s2_dag.py index ad5722c..e96632c 100644 --- a/src/ewoc_dag/s2_dag.py +++ b/src/ewoc_dag/s2_dag.py @@ -63,6 +63,11 @@ def get_s2_product( ValueError: if the source is not supported """ + date_acq=prd_id.split('_')[2][:8] + date_end=prd_id.split('_')[-1][:8] + if date_acq!=date_end: + prd_id=prd_id.replace(date_acq, date_end) + if source is None: s2_provider = get_s2_default_provider() else: @@ -130,9 +135,9 @@ def get_s2_product( _L1C_PRD_ID = "S2B_MSIL1C_20210714T235249_N0301_R130_T57KUR_20210715T005654.SAFE" _L2A_PRD_ID = "S2B_MSIL2A_20210714T131719_N0301_R124_T28WDB_20210714T160455.SAFE" - get_s2_product(_L1C_PRD_ID, source="eodag") + #get_s2_product(_L1C_PRD_ID, source="eodag") # get_s2_product(_L1C_PRD_ID, source="aws") - # get_s2_product(_L2A_PRD_ID, source="aws") + get_s2_product(_L2A_PRD_ID, source="aws") # get_s2_product(_L2A_PRD_ID, source="aws", l2_mask_only=True) # get_s2_product(_L2A_PRD_ID, source="aws", aws_l2a_cogs=True) # get_s2_product(_L2A_PRD_ID, source="aws", aws_l2a_cogs=True, l2_mask_only=True)