get_traj_velocities function

Recompute trajectory-specific velocities