def get_traj(self, file_input): """ Read and store the trajectory :param file_input: binary file read by Konrad Hinsen's package GromacsTrajectory """ traj = XTCTrajectory(file_input) while traj.readStep(): f = Frame() f.create_frame(traj.coordinates, traj.frame_counter, traj.natoms, traj.step, traj.time) self.frame.append(f)
from GromacsTrajectory import XTCTrajectory t = XTCTrajectory("trajectory.xtc") while t.readStep(): print "Frame number ", t.frame_counter print "Simulation step ", t.step print "Time %f ps" % t.time print "Box vectors (nm):" print t.box print "Coordinates of the first five atoms (nm):" print t.coordinates[:5] print