"manually" add events from timestamps and trigger names arrays

Hi everyone,

I’m currently building an epochs object from scratch. I created an info object and nested arrays containing my data, so that should work I guess, but now I’d like to add triggers, too. My trigger names are in one array, my trigger timestamps are in another one. Does anyone know how I can create events using the two arrays?

Thanks in advance for your help!

Merle

Hi Merle,

you can use your two arrays for the onset and description entries of a new Annotation object. You would keep the duration at 0, if you want to “simulate” TTL triggers.

See this example: Annotating continuous data — MNE 0.24.1 documentation

Then, once you have your annotations object, you can get the events through this function: mne.events_from_annotations — MNE 0.24.1 documentation