From 29418e96557bd4be44edbe06fe66524b25e9b19a Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Mon, 27 Feb 2023 11:51:19 -0500 Subject: [PATCH] Avoid index-from-time slicing including gaps Not sure why this was ever allowed but, for slicing to the sample *before* whatever target time stamp is passed in we should definitely not return the prior index as for the slice start since that might include a very large gap prior to whatever sample is scanned to have the earliest matching time stamp. This was essential to fixing overlay intersect points searching in our ``ui.view_mode`` machinery.. --- piker/data/_pathops.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/piker/data/_pathops.py b/piker/data/_pathops.py index adaed041..d8c15511 100644 --- a/piker/data/_pathops.py +++ b/piker/data/_pathops.py @@ -395,7 +395,7 @@ def slice_from_time( # f'diff: {t_diff}\n' # f'REMAPPED START i: {read_i_start} -> {new_read_i_start}\n' # ) - read_i_start = new_read_i_start - 1 + read_i_start = new_read_i_start t_iv_stop = times[read_i_stop - 1] if (