Skip to content

Commit

Permalink
fix blink detection
Browse files Browse the repository at this point in the history
closes #15
  • Loading branch information
ihrke committed Mar 22, 2021
1 parent 2c02f01 commit fbf0656
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pypillometry/preproc.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ def detect_blinks_zero(sy, min_duration, blink_val=0):
x=np.r_[0, np.diff((sy==blink_val).astype(np.int))]
starts=np.where(x==1)[0]
ends=np.where(x==-1)[0]-1
if sy[0]==blink_val: ## first value missing?
starts=np.r_[0,starts]
if ends.size!=starts.size:
## is the first start earlier than the first end?
if starts[0]>ends[0]:
Expand Down

0 comments on commit fbf0656

Please sign in to comment.