pymovements.base.Experiment.pos2vel

Experiment.pos2vel(arr: list[float] | list[list[float]] | np.ndarray, method: str = 'smooth', **kwargs) np.ndarray[source]

Compute velocity time series from 2-dimensional position time series.

Methods ‘smooth’, ‘neighbors’ and ‘preceding’ are adapted from

Engbert et al.: Microsaccade Toolbox 0.9.

Parameters
  • arr (array_like) – Continuous 2D position time series

  • method (str) – Computation method. See pos2vel() for details, default: smooth.

  • kwargs (dict) – Additional keyword arguments used for savitzky golay method.

Returns

velocities – Velocity time series in input_unit / sec

Return type

array_like

Raises

ValueError – If selected method is invalid, input array is too short for the selected method or the sampling rate is below zero