To visualize the trajectory you can use VMD and use its pbctools
vmd trajectory.xyz
> pbc set {a b c alpha betta gamma} -all
> pbc wrap
where a
, b
, and c
are the lattice vectors and alpha
, beta
, and gamma
the angles. The angles can be omitted if the box is orthorhombic. For more information see here: https://www.ks.uiuc.edu/Research/vmd/plugins/pbctools
To process the trajectory I'd recommend using one of the available python packages. Here is a code snippet using the Atomic Simulation Environment (ASE):
from ase import io
xyz=io.read('trajectory.xyz',index=":")
for frame in xyz:
frame.set_cell([a,b,c],[alpha,beta,gamma])
frame.set_pbc([True,True,True])
frame.wrap()
io.xyz.write_xyz('trajectory_wrapped.xyz',xyz)
Because the xyz-file contains no information about the cell you have to supply it separately. You can also use ASE to further process the coordinates if you wish. The documentation is here: https://wiki.fysik.dtu.dk/ase/
trjconv
explicitely with the-fit rot+trans
argument. That said, I feel more details are needed to answer the question for real. $\endgroup$