From 423f2a4b9dd9ebc3c91cd46b8285e001a57b2e98 Mon Sep 17 00:00:00 2001
From: Narcon Nicolas <nicolas.narcon@inrae.fr>
Date: Tue, 15 Mar 2022 15:20:17 +0100
Subject: [PATCH] FIX: wrong order for mosaic

---
 decloud/production/monthly_synthesis_processor_s2s1.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/decloud/production/monthly_synthesis_processor_s2s1.py b/decloud/production/monthly_synthesis_processor_s2s1.py
index 4243e9f..10adc0a 100644
--- a/decloud/production/monthly_synthesis_processor_s2s1.py
+++ b/decloud/production/monthly_synthesis_processor_s2s1.py
@@ -272,7 +272,7 @@ if __name__ == "__main__":
             input_s1_products.sort(key=_closest_date, reverse=True)
             input_s1_images_10m = [product.get_raster_10m() for product in input_s1_products]
             # creating a mosaic with the N closest S1 images
-            s1t = pyotb.App('Mosaic', input_s1_images_10m[:s1_Nimages], nodata=0)
+            s1t = pyotb.App('Mosaic', input_s1_images_10m[-s1_Nimages:], nodata=0)
 
             candidates.append({'s2': s2_product, 's1': s1t})
 
-- 
GitLab