From b00a25806b0d36d36e7e307b4d31dc56baa153a7 Mon Sep 17 00:00:00 2001 From: Kilian Vos Date: Mon, 10 Aug 2020 17:30:57 +1000 Subject: [PATCH] minor fix to merging overlapping S2 images --- coastsat/SDS_download.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/coastsat/SDS_download.py b/coastsat/SDS_download.py index 7ce4eab4..a4a66994 100644 --- a/coastsat/SDS_download.py +++ b/coastsat/SDS_download.py @@ -767,7 +767,10 @@ def merge_overlapping_images(metadata,inputs): # rewrite the .txt file with a new metadata file with open(fn_im[0][3], 'w') as f: for key in metadict0.keys(): - f.write('%s\t%s\n'%(key,metadict0[key])) + f.write('%s\t%s\n'%(key,metadict0[key])) + + # update filenames list (in case there are triplicates) + filenames[pair[0]] = metadict0['filename'] print('%d out of %d Sentinel-2 images were merged (overlapping or duplicate)'%(len(pairs), len(filenames)))