mne.event.define_target_events

mne.event.define_target_events(events, reference_id, target_id, sfreq, tmin, tmax, new_id=None, fill_na=None)[source]

Define new events by co-occurrence of existing events.

This function can be used to evaluate events depending on the temporal lag to another event. For example, this can be used to analyze evoked responses which were followed by a button press within a defined time window.

Parameters
eventsndarray

Array as returned by mne.find_events.

reference_idint

The reference event. The event defining the epoch of interest.

target_idint

The target event. The event co-occurring in within a certain time window around the reference event.

sfreqfloat

The sampling frequency of the data.

tminfloat

The lower limit in seconds from the target event.

tmaxfloat

The upper limit border in seconds from the target event.

new_idint

new_id for the new event

fill_naint | None

Fill event to be inserted if target is not available within the time window specified. If None, the ‘null’ events will be dropped.

Returns
new_eventsndarray

The new defined events

lagndarray

time lag between reference and target in milliseconds.

Examples using mne.event.define_target_events