Also, an enhancement we should put on the todo list (it's not a blocker for this PR, but it would be nice to have) is a function that does this same task but doesn't require loading up the entire trajectories into memory first.