mne.find_stim_steps

mne.find_stim_steps(raw, pad_start=None, pad_stop=None, merge=0, stim_channel=None)[source]

Find all steps in data from a stim channel.

Parameters
rawRaw object

The raw data.

pad_startNone | int

Values to assume outside of the stim channel (e.g., if pad_start=0 and the stim channel starts with value 5, an event of [0, 0, 5] will be inserted at the beginning). With None, no steps will be inserted.

pad_stopNone | int

Values to assume outside of the stim channel, see pad_start.

mergeint

Merge steps occurring in neighboring samples. The integer value indicates over how many samples events should be merged, and the sign indicates in which direction they should be merged (negative means towards the earlier event, positive towards the later event).

stim_channelNone | str | list of str

Name of the stim channel or all the stim channels affected by the trigger. If None, the config variables ‘MNE_STIM_CHANNEL’, ‘MNE_STIM_CHANNEL_1’, ‘MNE_STIM_CHANNEL_2’, etc. are read. If these are not found, it will default to ‘STI101’ or ‘STI 014’, whichever is present.

Returns
stepsarray, shape = (n_samples, 3)

For each step in the stim channel the values [sample, v_from, v_to]. The first column contains the event time in samples (the first sample with the new value). The second column contains the stim channel value before the step, and the third column contains value after the step.

See also

find_events

More sophisticated options for finding events in a Raw file.

Examples using mne.find_stim_steps