Skip to content

Commit 375e474

Browse files
committed
blackrockrawio - do not search for timestamp jumps in unknown event types
Fixes #1181
1 parent e30d270 commit 375e474

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

neo/rawio/blackrockrawio.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,8 +1148,13 @@ def __get_event_segment_ids(self, raw_event_data, masks, nev_data_masks):
11481148
reset_ev_ids = np.where(reset_ev_mask)[0]
11491149

11501150
# consistency check for monotone increasing time stamps
1151-
# Use logical comparator (instead of np.diff) to avoid unsigned dtype issues.
1152-
jump_ids = np.where(raw_event_data['timestamp'][1:] < raw_event_data['timestamp'][:-1])[0] + 1
1151+
# - Use logical comparator (instead of np.diff) to avoid unsigned dtype issues.
1152+
# - Only consider handled/known event types.
1153+
mask_handled = np.any(np.vstack([value[nev_data_masks[key]] for key, value in masks.items()]), axis=0)
1154+
jump_ids_handled = np.where(
1155+
raw_event_data['timestamp'][mask_handled][1:] < raw_event_data['timestamp'][mask_handled][:-1]
1156+
)[0] + 1
1157+
jump_ids = np.where(mask_handled)[0][jump_ids_handled] # jump ids in full set of events (incl. unhandled)
11531158
overlap = np.in1d(jump_ids, reset_ev_ids)
11541159
if not all(overlap):
11551160
# additional resets occurred without a reset event being stored

0 commit comments

Comments
 (0)