set_events#

pypillometry.set_events(events)#

Pipeline step for set_events() (d | pp.set_events(...)).

Replace the events of the dataset (in-place).

The onsets are converted to ms (the internal storage format) if needed. The time range of the data is not stored with the events. A warning is given for events that are marked as being on another clock (needs_sync, see sync_clocks()).

Parameters:

events (Events) – the new events (onsets, labels and metadata)

Return type:

EyeData

Returns:

the object itself, with the new events (use d.copy() first to keep the old events)

Raises:
  • TypeError – if events is not an Events object

  • ValueError – if an onset is outside the time range of the data

See also

events

the events of the dataset

add_events

add events to the existing ones

Examples

>>> d = d.set_events(d.events.filter("stim"))
>>> d = d.set_events(d.events.parse_labels(r"_(?P<trial>\d+)"))