Skip to content

Commit 74d1bd6

Browse files
committed
Fixing bug that caused falling edges to go undetected
1 parent 76154a1 commit 74d1bd6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

neo/rawio/spikeglxrawio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ def _get_event_timestamps(self, block_index, seg_index, event_channel_index, t_s
266266
ch_idx = 7 - int(channel[2:]) # They are in the reverse order
267267
this_stream = event_data[:,ch_idx]
268268
this_rising = np.where(np.diff(this_stream)==1)[0] + 1
269-
this_falling = np.where(np.diff(this_stream)==-1)[0] + 1
269+
this_falling = np.where(np.diff(this_stream)==255)[0] + 1 #behcause the data is in unsigned 8 bit, -1 = 255!
270270
if len(this_rising) > 0:
271271
timestamps.extend(this_rising)
272272
labels.extend([channel + ' ON']*len(this_rising))

0 commit comments

Comments
 (0)