How to calculate average coordinate over all the time steps

GROMACS version:2020
GROMACS modification: No
Here post your question
Dear all,
I am a graduate student that is using the MARTINI force field for simulation and seeking any help to be given on the analysis of lipid membrane.
I have 2 difficulties: in calculating the membrane cross-section profile and cross section lipid membrane thickness, respectively. The details are shown below,
I have simulated a DPPC coarse-grained membrane that subjected a lateral pressure, and the result is like this,
Fig. Lipid Membrane cross-section profile.

The above result is only for the last time step.
Since, I had lots of time step results like the above, during the production process. It is a better choice to get the average coordinate for each lipid bead “NC3”. So that the profile of the membrane can be described accurately. I currently can get the bilayer bead index (Gromacs gmx make_ndx command )for the last time step but that seems improper. And I searched the internet for suggestions of using “gmx densmap”, but still not too sure that is correct.
So, could you give any guides on getting the average coordinate all over the time steps? so I can get the membrane cross section profile and cross section thickness.
I don’t want to bother you, but it seems I have no other ways to get help currently.

Thanks a lot for any attention.

Taking the average coordinate of a single molecule doesn’t make sense when that molecule is freely diffusing within the membrane. The average of each individual bead is probably outside of the membrane itself and gives you no idea of its shape.

I haven’t used gmx densmap, but is that a buckle shape? If so, densmap might work since the curvature is only in two dimensions, you’d use the -aver flag to average over whatever dimension is constant.

Otherwise you’ll probably need to come up with some manual analysis, using MDAnalysis or similar tools to get access to trajectory frame data.

Thanks for the guide, kexinboyd. Yes, that is a kind of buckle shape. The command is
gmx densmap -f output.xtc -s output.gro -n headgroupID.ndx -bin 0.01 -o try.xpm
But, how to do further is a problem for me. I will keep working on that, thanks again for your help.