Skip to content

Commit 9ff30f1

Browse files
committed
oops
1 parent 7eca54d commit 9ff30f1

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

src/python/pycold/imagetool/tile_processing.py

+6-11
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ def get_stack_date(
209209
block_y: int,
210210
stack_path: str,
211211
low_datebound: int = 0,
212-
high_datebound: int = 0,
212+
high_datebound: int = 999999,
213213
nband: int = 8,
214214
):
215215
"""
@@ -238,15 +238,10 @@ def get_stack_date(
238238
)
239239
for folder_name in img_files
240240
]
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))
250245
img_files_sorted = [x[1] for x in files_date_zip]
251246
img_dates_sorted = np.asarray([x[0] for x in files_date_zip])
252247
img_tstack = np.dstack(
@@ -336,7 +331,7 @@ def main(
336331
low_datebound = parse(low_datebound).toordinal()
337332

338333
if upper_datebound is None:
339-
upper_datebound = 0
334+
upper_datebound = 999999
340335
else:
341336
upper_datebound = parse(upper_datebound).toordinal()
342337

0 commit comments

Comments
 (0)