pymovements.gaze.transforms.pos2vel#

pymovements.gaze.transforms.pos2vel(*, sampling_rate: float, method: str, n_components: int, degree: int | None = None, window_length: int | None = None, padding: str | float | int | None = 'nearest', position_column: str = 'position', velocity_column: str = 'velocity') pl.Expr[source]#

Compute velocitiy data from positional data.

Parameters:
  • sampling_rate – Sampling rate of input time series.

  • method – The method to use for velocity calculation.

  • degree – The degree of the polynomial to use. This has only an effect if using savitzky_golay as calculation method.

  • window_length – The window size to use. This has only an effect if using savitzky_golay as calculation method.

  • padding – The padding to use. This has only an effect if using savitzky_golay as calculation method.

  • n_components – Number of components in input column.

  • position_column – The input position column name.

  • velocity_column – The output velocity column name.

Notes

There are three methods available for velocity calculation:

  • savitzky_golay: velocity is calculated by a polynomial of fixed degree and window length. See savitzky_golay() for further details.

  • five_point: velocity is calculated from the difference of the mean values of the subsequent two samples and the preceding two samples

  • neighbors: velocity is calculated from difference of the subsequent sample and the preceding sample

  • preceding: velocity is calculated from the difference of the current sample to the preceding sample