pymovements.events.amplitude#

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

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 – The column name of the position tuples.

  • n_components – Number of positional components. Usually these are the two components yaw and pitch.

Raises:

ValueError – If number of components is not 2.