OpenMM
|
DCDFile provides methods for creating DCD files. More...
Public Member Functions | |
def | __init__ |
Create a DCD file and write out the header. | |
def | writeModel |
Write out a model to the DCD file. |
DCDFile provides methods for creating DCD files.
DCD is a file format for storing simulation trajectories. It is supported by many programs, such as CHARMM, NAMD, and X-PLOR. Note, however, that different programs produce subtly different versions of the format. This class generates the CHARMM version. Also note that there is no standard byte ordering (big-endian or little-endian) for this format. This class always generates files with little-endian ordering.
To use this class, create a DCDFile object, then call writeModel() once for each model in the file.
def __init__ | ( | self, | |
file, | |||
topology, | |||
dt, | |||
firstStep = 0 , |
|||
interval = 1 |
|||
) |
Create a DCD file and write out the header.
file | (file) A file to write to |
topology | (Topology) The Topology defining the molecular system being written |
dt | (time) The time step used in the trajectory |
firstStep | (int=0) The index of the first step in the trajectory |
interval | (int=1) The frequency (measured in time steps) at which states are written to the trajectory |
def writeModel | ( | self, | |
positions, | |||
unitCellDimensions = None , |
|||
periodicBoxVectors = None |
|||
) |
Write out a model to the DCD file.
The periodic box can be specified either by the unit cell dimensions (for a rectangular box), or the full set of box vectors (for an arbitrary triclinic box). If neither is specified, the box vectors specified in the Topology will be used. Regardless of the value specified, no dimensions will be written if the Topology does not represent a periodic system.
positions | (list) The list of atomic positions to write |
unitCellDimensions | (Vec3=None) The dimensions of the crystallographic unit cell. |
periodicBoxVectors | (tuple of Vec3=None) The vectors defining the periodic box. |