yasa.SWResults.get_sync_events#
- SWResults.get_sync_events(center='NegPeak', time_before=0.4, time_after=0.8, filt=(None, None), mask=None, as_dataframe=True)[source]#
Return the raw 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 negative peak of the slow-wave.
- 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, andfilt=(None, 40)will apply a 40 Hz lowpass filter. Filtering is done using default parameters in themne.filter.filter_datafunction.- 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).
- as_dataframeboolean
If True (default), returns a long-format pandas dataframe. If False, returns a list of numpy arrays. Each element of the list a unique channel, and the shape of the numpy arrays within the list is (n_events, n_times).
- Returns:
- df_sync
pandas.DataFrameor list Ouput long-format dataframe (if
as_dataframe=True):'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 'Stage': Sleep stage in which the events occured (if available)
- df_sync