yasa.REMResults.get_sync_events#

REMResults.get_sync_events(center='Peak', time_before=0.4, time_after=0.4, filt=(None, None), mask=None)[source]#

Return the raw or filtered data of each detected event after centering to a specific timepoint.

Parameters:
centerstr

Landmark of the event to synchronize the timing on. Default is to use the peak of the REM.

time_beforefloat

Time (in seconds) before center.

time_afterfloat

Time (in seconds) after center.

filttuple

Optional filtering to apply to data. For instance, filt=(1, 30) will apply a 1 to 30 Hz bandpass filter, and filt=(None, 40) will apply a 40 Hz lowpass filter. Filtering is done using default parameters in the mne.filter.filter_data function.

maskarray_like or None

Custom boolean mask. Only the detected events for which mask is True will be included. Default is None, i.e. no masking (all events are included).

Returns:
df_syncpandas.DataFrame

Ouput long-format dataframe:

'Event' : Event number
'Time' : Timing of the events (in seconds)
'Amplitude' : Raw or filtered data for event
'Channel' : Channel
'IdxChannel' : Index of channel in data