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

ENH: Read and store "START" and "END" events from EDF file #22

Merged
merged 2 commits into from
Feb 11, 2025

Conversation

scott-huberty
Copy link
Owner

@scott-huberty scott-huberty commented Feb 5, 2025

Closes #17

These events indicate when the Eye-tracker started and stopped recording, respectively. There can be multiple of these events, meaning that the eye-tracker started recording, paused, and then started recording again (e.g. during a calibration sequence or between trials). Sometimes there is a large time span between an END event and a subsequent START event, meaning there is a pause/gap in the recording that the user might want to know about.

The pyeparse authors appeared to know about "START" and "END events in EDF files, but they just used python's pass to skip these events when reading the EDF files.

I adjusted our event handlers to give both start and end events an entry in EDF["discrete"].

For example

import eyelinkio
fname = eyelinkio.utils._get_test_fnames()[2]
edf = eyelinkio.read_edf(fname)

edf["discrete"]["starts"]
array([(  0.   ,), ( 11.032,), ( 17.674,), ( 39.3  ,), ( 60.926,),
       ( 67.562,), ( 78.766,), ( 85.402,), ( 92.022,), ( 98.844,),
       (120.47 ,), (142.086,), (156.532,), (175.848,), (197.466,)],
      dtype=[('stime', '<f8')])
edf["discrete"]["ends"]
array([( 11.0300007 ,), ( 17.67200078,), ( 39.29800084,), ( 60.92400067,),
       ( 67.56000069,), ( 78.76400077,), ( 85.40000075,), ( 92.02000076,),
       ( 98.84200089,), (120.46800086,), (142.0840008 ,), (156.53000088,),
       (175.84600069,), (197.4640009 ,), (199.644     ,)],
      dtype=[('stime', '<f8')])

and for reference, attached is an ASCII version of the same file used in the example above, where you can see the START and END events.

test_raw_binocular.txt

These events indicate when the Eyetracking started and stopped recording, respectively. There can be multiple of these events, meaning that the eyetracker started and paused (e.g. during a calibration sequence or between trials).

The pyeparse authors appeared to know about "START" and "END events in EDF files, but they just used python's `pass` to skip handling these events.

I adjusted our event handlers to give both start and end events an entry in `EDF["discrete"].

It's important to store this info because for some recordings (read: users) there is a time gap between an end event and the subsequent start event. In other words, there is a pause/gap in the recording that the user might want to know about.
@scott-huberty
Copy link
Owner Author

@teonbrooks would you be available to provide a review?

@scott-huberty scott-huberty merged commit aabcf18 into main Feb 11, 2025
9 checks passed
@scott-huberty scott-huberty deleted the recording_blocks branch February 11, 2025 01:13
@teonbrooks
Copy link
Contributor

sorry I didn't get around to this in time

@scott-huberty
Copy link
Owner Author

sorry I didn't get around to this in time

No worries!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Read (and store) START and END events
2 participants