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

Messages not parsed in edf file #15

Open
m-guggenmos opened this issue Jul 24, 2019 · 5 comments
Open

Messages not parsed in edf file #15

m-guggenmos opened this issue Jul 24, 2019 · 5 comments

Comments

@m-guggenmos
Copy link

m-guggenmos commented Jul 24, 2019

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

@gschwim
Copy link
Contributor

gschwim commented Jul 24, 2019

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
Copy link
Contributor

gschwim commented Jul 24, 2019

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.

@chrysapa
Copy link

chrysapa commented Jul 1, 2020

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

@gschwim
Copy link
Contributor

gschwim commented Jul 28, 2021

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.

@chrysapa
Copy link

chrysapa commented Sep 1, 2021

This works, thank you!

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

No branches or pull requests

3 participants