compute_velocity and other kinematic functions crash with IndexError: index 0 is out of bounds for axis 0 with size 0 when the input has only one time frame. The error comes from numpy's gradient function inside xarray.differentiate, which needs at least 2 points. A guard in compute_time_derivative would catch this early with a clear message.
compute_velocity and other kinematic functions crash with
IndexError: index 0 is out of bounds for axis 0 with size 0when the input has only one time frame. The error comes from numpy's gradient function inside xarray.differentiate, which needs at least 2 points. A guard in compute_time_derivative would catch this early with a clear message.