pymovements.dataset.Dataset.detect_events#
- Dataset.detect_events(method: Callable[..., EventDataFrame] | str, *, eye: str = 'auto', clear: bool = False, verbose: bool = True, **kwargs: Any) Dataset #
Detect events by applying a specific event detection method.
- Parameters:
method (Callable[..., EventDataFrame] | str) – The event detection method to be applied.
eye (str) – Select which eye to choose. Valid options are
auto
,left
,right
orNone
. Ifauto
is passed, eye is inferred in the order['right', 'left', 'eye']
from the availablegaze
dataframe columns. (default: ‘auto’)clear (bool) –
- If
True
, event DataFrame will be overwritten with new DataFrame instead of being merged into the existing one. (default: False)
- If
verbose (bool) – If
True
, show progress bar. (default: True)**kwargs (Any) – Additional keyword arguments to be passed to the event detection method.
- Returns:
Returns self, useful for method cascading.
- Return type:
- Raises:
AttributeError – If gaze files have not been loaded yet or gaze files do not contain the right columns.