# events timing problem

**URL:** <https://mne.discourse.group/t/events-timing-problem/934>\
**Category:** Mailing List Archive (read-only)\
**Tags:** list-archive\
**Created:** [December 7, 2015, 9:56am UTC](https://mne.discourse.group/t/events-timing-problem/934 "2015-12-07T09:56:37Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [December 7, 2015, 9:56am UTC](https://mne.discourse.group/t/events-timing-problem/934/1 "2015-12-07T09:56:37Z")

</div>

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](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20151207/1a9f1756/attachment.html)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [December 7, 2015, 10:15am UTC](https://mne.discourse.group/t/events-timing-problem/934/2 "2015-12-07T10:15:14Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [December 7, 2015, 10:26am UTC](https://mne.discourse.group/t/events-timing-problem/934/3 "2015-12-07T10:26:47Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [December 7, 2015, 10:42am UTC](https://mne.discourse.group/t/events-timing-problem/934/4 "2015-12-07T10:42:14Z")

</div>

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](https://github.com/mne-tools/mne-python/edit/master/mne/event.py#L478)

thanks for your help.

Alex

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [December 7, 2015, 10:57am UTC](https://mne.discourse.group/t/events-timing-problem/934/5 "2015-12-07T10:57:13Z")

</div>

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

&nbsp;&nbsp;&nbsp;&nbsp;Parameters

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [December 7, 2015, 11:02am UTC](https://mne.discourse.group/t/events-timing-problem/934/6 "2015-12-07T11:02:25Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [December 7, 2015, 11:23am UTC](https://mne.discourse.group/t/events-timing-problem/934/7 "2015-12-07T11:23:12Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [December 7, 2015, 1:24pm UTC](https://mne.discourse.group/t/events-timing-problem/934/8 "2015-12-07T13:24:18Z")

</div>

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
