@@ -209,7 +209,7 @@ def get_stack_date(
209
209
block_y : int ,
210
210
stack_path : str ,
211
211
low_datebound : int = 0 ,
212
- high_datebound : int = 0 ,
212
+ high_datebound : int = 999999 ,
213
213
nband : int = 8 ,
214
214
):
215
215
"""
@@ -238,15 +238,10 @@ def get_stack_date(
238
238
)
239
239
for folder_name in img_files
240
240
]
241
- if low_datebound > 0 :
242
- img_dates , img_files = zip (
243
- * filter (lambda x : x [0 ] >= low_datebound , zip (tuple (img_dates ), tuple (img_files )))
244
- )
245
- if high_datebound > 0 :
246
- img_dates , img_files = zip (
247
- * filter (lambda x : x [0 ] <= high_datebound , zip (tuple (img_dates ), tuple (img_files )))
248
- )
249
- files_date_zip = sorted (zip (img_dates , img_files ))
241
+ img_dates_selected = [img_dates [i ] for i , date in enumerate (img_dates ) if img_dates [i ] >= low_datebound and img_dates [i ] <= high_datebound ]
242
+ img_files_selected = [img_files [i ] for i , date in enumerate (img_dates ) if img_dates [i ] >= low_datebound and img_dates [i ] <= high_datebound ]
243
+
244
+ files_date_zip = sorted (zip (img_dates_selected , img_files_selected ))
250
245
img_files_sorted = [x [1 ] for x in files_date_zip ]
251
246
img_dates_sorted = np .asarray ([x [0 ] for x in files_date_zip ])
252
247
img_tstack = np .dstack (
@@ -336,7 +331,7 @@ def main(
336
331
low_datebound = parse (low_datebound ).toordinal ()
337
332
338
333
if upper_datebound is None :
339
- upper_datebound = 0
334
+ upper_datebound = 999999
340
335
else :
341
336
upper_datebound = parse (upper_datebound ).toordinal ()
342
337
0 commit comments