cedalion.sigproc.epochs

Extract epochs from a time series based on stimulus events.

Functions

to_epochs(ts, df_stim, trial_types, before, ...)

Extract epochs from the time series based on stimulus events.

cedalion.sigproc.epochs.to_epochs(
ts: cdt.NDTimeSeries,
df_stim: pd.DataFrame,
trial_types: list[str],
before: cdt.QTime,
after: cdt.QTime,
)[source]

Extract epochs from the time series based on stimulus events.

Parameters:
  • ts – the time series

  • df_stim – DataFrame containing stimulus events.

  • trial_types – List of trial types to include in the epochs.

  • before – Time before stimulus event to include in epoch.

  • after – Time after stimulus event to include in epoch.

Returns:

Array containing the extracted epochs.

Return type:

xarray.DataArray