events timing problem

Dear mne experts,

I record MEG with 5000 Hz sampling rate. My 1st event [198] is around 17.3
sec from the beginning of the file (as I can see it in the mne_browse_raw),
while the events I obtain using mne.find_eventscontain contain very
different values:

array( [[ 553744, 0, 198],

[ 559801, 0, 1],

[ 565846, 0, 1],

?

It means that the 1st event is at 553744/5000 = 110.7488 sec

The events were obtained as:

events= mne.find_events(raw, stim_channel='STI101', consecutive=True,
verbose=True, shortest_event=1, output ='onset' )

Why event times do not correspond to what I see at the trigger channel?

Thank you,

Elena
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20151207/1a9f1756/attachment.html

hi Elena,

did you try to plot your stim channel?

events are also defined taking into account the first_samp attribute.

See raw.first_samp

HTH
Alex

Thank you!
When I add the raw.first_samp, the latency is correct.
However, it is a bit confusing since the mne.find_events help states that

'The first column contains the event time in samples...'
and says nothing about that it is not from the first raw data sample (i.e.
the moment when the MEG record button) was pressed.
It might be good to put some comment on that.

Best, Elena

hi Elena,

fine with adding some info to the doc.

you can do this by editing the file online:

https://github.com/mne-tools/mne-python/edit/master/mne/event.py#L478

thanks for your help.

Alex

Sorry Alex,
this reference is to event.py.
It says:

    Parameters

mne.find_events is defined in mne,events.py
if you edit the function in events.py the documentation in mne.find_events
will change

--Denis

Hi,
It could be useful to add information about events timing (i.e. to explain
that the 1st column contains time in samples counting from the moment
before the actual data recording - 'minus raw.first sample time' )
Since the events are mentioned in a few places, I am not sure where to add
this info.
I leave it to you guys.
Best,
Elena

Elena,

thanks for your feedback. My present feeling is that all developers of
MNE know this
and such doc improvement would be much better phrased by less experience users.
Just because you know where you would have expected to see this in the doc.

It does not take much time to edit the file directly on github and
it's a big help for the project if our users spend a tiny bit of their
time making the code more user friendly.

Alex