Is your feature request related to a problem? Please describe.
It would be useful to know the angular velocity of the mouse head at every frame
Describe the solution you'd like
I made this draft method:
def get_angular_velocity(angles, sampling_rate):
# angles are in degrees
# angles = np.deg2rad(angles)
diffs = np.diff(angles)
# remove outliers
diffs = np.where(np.abs(diffs) > 0.05, 0, diffs)
angular_velocity = diffs / sampling_rate
return angular_velocity, diffs
angles_array = derotate.interpolated_angles
sampling_rate = 1 / 179200 # 1 / Hz
angular_velocity, diffs = get_angular_velocity(angles_array, sampling_rate)