mstk.trajectory.Xtc¶
- class mstk.trajectory.Xtc(file, mode='r')¶
Read and write step, cell and positions from XTC file.
Simulation time is ignored.
Currently mstk use chemfiles to support XTC format.
Methods
__init__(file[, mode])close()Close the handler.
get_handler_for_file(file)Get the appropriate handler class for a trajectory file.
get_info()Get the number of atoms and frames in the trajectory.
read_frame(i_frame, frame)Read a single frame.
register_format(extension, Handler)Register a handler class for a trajectory format based on the extension name
write_frame(frame[, subset])Write a frame into the opened XTC file
- close()¶
Close the handler.
- get_info()¶
Get the number of atoms and frames in the trajectory.
Also record the offset of lines and frames, so that we can read arbitrary frame later. It assumes all frames have the same number of atoms.
- Returns:
n_atom (int)
n_frame (int)