Editing trajectory based on time

GROMACS version:
GROMACS modification: Yes/No
I have calculated the angle of rotation of a particular side chain in each frame of the trajectory. I want to edit the trajectory such that all those frames that have a value greater then a threshold are saved in a separate trajectory. Can anyone help me with this?

I think a reasonable tool for that would be MDAnalysis (https://www.mdanalysis.org/). But I think you will have to read its documentation to see how to do what you want to do.