Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update edfreader.py to store which eye is being read for events #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions pygazeanalyser/edfreader.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,27 +199,31 @@ def message(msg):
# fixation start
elif line[0:4] == "SFIX":
message("fixation start")
eye = line[5] # detect which eye 08/24/2022 by Han
l = line[9:]
events['Sfix'].append(int(l))
events['Sfix'].append([eye,int(l)])
# fixation end
elif line[0:4] == "EFIX":
message("fixation end")
eye = line[5] # detect which eye 08/24/2022 by Han
l = line[9:]
l = l.split('\t')
st = int(l[0]) # starting time
et = int(l[1]) # ending time
dur = int(l[2]) # duration
sx = replace_missing(l[3], missing=missing) # x position
sy = replace_missing(l[4], missing=missing) # y position
events['Efix'].append([st, et, dur, sx, sy])
events['Efix'].append([eye, st, et, dur, sx, sy])
# saccade start
elif line[0:5] == 'SSACC':
message("saccade start")
eye = line[6] # detect which eye 08/24/2022 by Han
l = line[9:]
events['Ssac'].append(int(l))
events['Ssac'].append([eye,int(l)])
# saccade end
elif line[0:5] == "ESACC":
message("saccade end")
eye = line[6] # detect which eye 08/24/2022 by Han
l = line[9:]
l = l.split('\t')
st = int(l[0]) # starting time
Expand All @@ -229,21 +233,23 @@ def message(msg):
sy = replace_missing(l[4], missing=missing) # start y position
ex = replace_missing(l[5], missing=missing) # end x position
ey = replace_missing(l[6], missing=missing) # end y position
events['Esac'].append([st, et, dur, sx, sy, ex, ey])
events['Esac'].append([eye, st, et, dur, sx, sy, ex, ey])
# blink start
elif line[0:6] == "SBLINK":
message("blink start")
eye = line[7] # detect which eye 08/24/2022 by Han
l = line[9:]
events['Sblk'].append(int(l))
events['Sblk'].append([eye, int(l)])
# blink end
elif line[0:6] == "EBLINK":
message("blink end")
eye = line[7] # detect which eye 08/24/2022 by Han
l = line[9:]
l = l.split('\t')
st = int(l[0])
et = int(l[1])
dur = int(l[2])
events['Eblk'].append([st,et,dur])
events['Eblk'].append([eye, st,et,dur])

# regular lines will contain tab separated values, beginning with
# a timestamp, follwed by the values that were asked to be stored
Expand Down