pyedfread icon indicating copy to clipboard operation
pyedfread copied to clipboard

Messages not parsed in edf file

Open m-guggenmos opened this issue 6 years ago • 5 comments

The "messages" from our edf files generated from our EyeLink 1000 Plus are not parsed by pyedfread (see attachment for an example edf file). We'd be greatful for an hint on what's going on.

The following code

from pyedfread import edf
samples, events, messages = edf.pread('blub.edf')
print(messages)

prints

Empty DataFrame
Columns: []
Index: []

Our pyedfread version is the latest from GitHub.

blub.zip

m-guggenmos avatar Jul 24 '19 17:07 m-guggenmos

What is in your samples table?

print(samples)

If you indeed have data in there you probably need to set a trial_marker parameter. For example:

edf.pread('blub.edf', trial_marker='<something>']

When I need to determine a useful trial marker I use the SR tool edf2asc to dump the edf out as ascii, then parse the lines beginning with MSG until I find a suitable indicator of the start of a message for a given trial.

.gs

gschwim avatar Jul 24 '19 18:07 gschwim

Side note - the above seems to not be necessary with data that I have from a Duo. I'm not 100% sure why. Could be how the capture was run and messages injected but not sure.

gschwim avatar Jul 24 '19 18:07 gschwim

Hello,

We are having the same issue with our EDF files coming from an Eyelink 1000 Plus. As in the first comment, the following code (the EDF file is attached)

from pyedfread import edf
samples, events, messages = edf.pread('blub.edf')
print(messages)

gives

Empty DataFrame
Columns: []
Index: []

Using filter =‘all’ yields the same result. Now, if I do

edf.pread('eyetest.edf', trial_marker = b’xDAT’]

as suggested, it parses the messages.

However, I am interested in a more general application of the tool where users would be able to parse all the messages without specifying trial markers in one call of edf.pread. Is that something that is possible? Thank you for any help!

eyetest.edf.zip

chrysapa avatar Jul 01 '20 16:07 chrysapa

Try this: s, e, m = edf.pread('eyetest.edf', trial_marker=b'') This should give you a df with all messages in two columns trialid and trialid_time.

gschwim avatar Jul 28 '21 15:07 gschwim

This works, thank you!

chrysapa avatar Sep 01 '21 15:09 chrysapa