yasa.get_sync_events

yasa.get_sync_events(data=None, sf=None, detection=None, center='NegPeak', time_before=0.4, time_after=0.8)[source]

Return the raw data of each detected slow-waves / spindles, after centering to a specific timepoint.

This function can be used to plot an average template of the detected slow-waves / spindles.

For more details, please refer to the Jupyter notebook

Parameters
dataarray_like or mne.io.BaseRaw

1D or 2D EEG data. Can also be mne.io.BaseRaw, in which case data and sf will be automatically extracted.

sffloat

The sampling frequency of data. Can be omitted if data is a mne.io.BaseRaw.

detectionpandas.DataFrame

YASA’s detection dataframe returned by the yasa.sw_detect(), yasa.spindles_detect(), yasa.sw_detect_multi(), and yasa.spindles_detect_multi() functions.

centerstr

Landmark of the slow-waves / spindles to synchronize the timing on. Default is to use the negative peak.

time_beforefloat

Time (in seconds) before center.

time_afterfloat

Time (in seconds) after center.

Returns
df_swpandas.DataFrame

Ouput detection dataframe:

'Event' : Event number
'Time' : Timing of the events (in seconds)
'Amplitude' : Raw data for event
'Chan' : Channel (only in multi-channel detection)