# find\_events report a wrong time

**URL:** <https://mne.discourse.group/t/find-events-report-a-wrong-time/4910>\
**Category:** Support & Discussions\
**Tags:** meg, event-codes\
**Created:** [May 19, 2022, 1:12pm UTC](https://mne.discourse.group/t/find-events-report-a-wrong-time/4910 "2022-05-19T13:12:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![elvisjade](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/elvisjade/32/122_2.png) [@elvisjade](https://mne.discourse.group/u/elvisjade)\
**Post date:** [May 19, 2022, 1:12pm UTC](https://mne.discourse.group/t/find-events-report-a-wrong-time/4910/1 "2022-05-19T13:12:42Z")

</div>

My data is only about 500s(551000 samples), but it seems that the last event (748072.00 samples)is longer than the length of my data.  
This code seems to find the event(32) appearing at a different time than the actual mark time I hit, I should have hit the mark around 20 seconds.

I have a lot of files that present this error.

My code is :

```python
data = mne.io.read_raw_fif(path, preload=False)
events = mne.find_events(data, stim_channel='STI101',shortest_event=1)
event = mne.pick_events(events, include=32)

```

The event I found is  
|229629.00 |0.00 |32.00 |  
|721529.00 |0.00 |128.00 |  
|731592.00 |0.00 |64.00 |  
|748072.00 |0.00 |128.00 |

- MNE version: 1.0
- operating system: Ubuntu 20.04

---

<div class="post-metadata">

**Author:** ![agramfort](https://avatars.discourse-cdn.com/v4/letter/a/7c8e57/32.png) [@agramfort](https://mne.discourse.group/u/agramfort)\
**Post date:** [May 19, 2022, 1:45pm UTC](https://mne.discourse.group/t/find-events-report-a-wrong-time/4910/2 "2022-05-19T13:45:28Z")

</div>

what is raw.first\_samp for you?

index in data is given by: events[:, 0] - raw.first\_samp

see [https://mne.tools/stable/glossary.html#term-first\_samp](https://mne.tools/stable/glossary.html#term-first_samp)

Alex

---

<div class="post-metadata">

**Author:** ![elvisjade](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/elvisjade/32/122_2.png) [@elvisjade](https://mne.discourse.group/u/elvisjade)\
**Post date:** [May 19, 2022, 1:54pm UTC](https://mne.discourse.group/t/find-events-report-a-wrong-time/4910/3 "2022-05-19T13:54:16Z")

</div>

data.first\_samp is 208000

So the actual time should be events[:, 0] - raw.first\_samp/ sample rate?  
(229629.00 - 208000 )/1000 = 21.629

---

<div class="post-metadata">

**Author:** ![agramfort](https://avatars.discourse-cdn.com/v4/letter/a/7c8e57/32.png) [@agramfort](https://mne.discourse.group/u/agramfort)\
**Post date:** [May 19, 2022, 2:20pm UTC](https://mne.discourse.group/t/find-events-report-a-wrong-time/4910/4 "2022-05-19T14:20:00Z")

</div>

if you sfreq is 1000 yes this is the latency after the event from the start of the available data

Alex
