aeye-lab / pymovements

A python package for processing eye movement data
https://pymovements.readthedocs.io
MIT License
61 stars 11 forks source link

Add transforms.pos2acc() #300

Closed dkrako closed 1 year ago

dkrako commented 1 year ago

Description of the problem

Computing the acceleration would be very nice to have.

Description of a solution

The first iteration should at least use the savgol_filter from scipy: https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.savgol_filter.html#scipy.signal.savgol_filter

Minimum acceptance criteria

Sample Code

This could be the signature:

def pos2acc(
        arr: list[float] | list[list[float]] | np.ndarray,
        sampling_rate: float = 1000,
        window_length: int = 7,
        polyorder:int = 2,
        delta: float = 1.0,
        mode: str = 'interp',
        cval: float = 0.0,
) -> np.ndarray:
dkrako commented 1 year ago

closed with #424