Calculating temperature from trr file

GROMACS version: 5.1.1
GROMACS modification: No

Hi, I’ve been trying to calculate the average temperature from a group of atoms based on velocities from the trr files. The reason I cannot use gmx energy is because I would only only the group of atoms post-simulation run, hence wouldn’t be able to define a tc-group as such.

I read in the [manual]( that you can do so by computing the kinetic energy for the system, however there’s a degree of freedom consideration (N_df, Eq 9), and I am confused how I would define these for my system. Would someone be able to advise and help?

Thank you in advance.

Eq 9 states that Ndf = 3N−Nc−Ncom
where Nc is the number of constraints imposed on the system. N = number of particles. Can you specify what you can not define?
Thank you