pymovements.events.amplitude#

pymovements.events.amplitude(*, position_column: str = 'position', n_components: int = 2) Expr#

Amplitude of an event.

The amplitude is calculated as:

\[\text{Amplitude} = \sqrt{(x_{\text{max}} - x_{\text{min}})^2 + (y_{\text{max}} - y_{\text{min}})^2}\]

where \((x_{\text{min}},\; x_{\text{max}})\) and \((y_{\text{min}},\; y_{\text{max}})\) are the minimum and maximum values of the \(x\) and \(y\) components of the gaze positions during an event.

Parameters:
  • position_column (str) – The column name of the position tuples. (default: ‘position’)

  • n_components (int) – Number of positional components. Usually these are the two components yaw and pitch. (default: 2)

Returns:

The amplitude of the event.

Return type:

pl.Expr

Raises:

ValueError – If number of components is not 2.