Derive other Reader and Writer classes from the classes in this module. The derived classes must follow the Trajectory API in MDAnalysis.coordinates.__init__.
Timestep data for one frame
Methods : | ts = Timestep(numatoms)
ts[i]
ts[start:stop:skip]
for x in ts
|
---|
numpy.ndarray of dtype float32 of shape (numatoms, 3) and internal FORTRAN order, holding the raw cartesian coordinates (in MDAnalysis units, i.e. Å).
Note
Normally one does not directly access _pos but uses the coordinates() method of an AtomGroup but sometimes it can be faster to directly use the raw coordinates. Any changes to this array are immediately reflected in atom positions. If the frame is written to a new trajectory then the coordinates are changed. If a new trajectory frame is loaded, then all contents of _pos are overwritten.
numpy.ndarray of dtype float32. of shape (numatoms, 3), holding the raw velocities (in MDAnalysis units, i.e. typically Å/ps).
Note
Normally velocities are accessed through the velocities() method of an AtomGroup but this attribute is documented as there can be occasions when it is required (e.g. in order to change velocities) or much more convenient or faster to access the raw velocities directly.
_velocities only exists if the underlying trajectory format supports velocities. Your code should check for its existence or handle an AttributeError gracefully.
New in version 0.7.5.
number of atoms
unitcell dimensions (A, B, C, alpha, beta, gamma)
lengths a, b, c are in the MDAnalysis length unit (Å), and angles are in degrees.
dimensions is read-only because it transforms the actual format of the unitcell (which differs between different trajectory formats) to the representation described here, which is used everywhere in MDAnalysis.
volume of the unitcell
Base class bundling common functionality for trajectory I/O.
Close the trajectory file.
Specific implementation of trajectory closing.
In-place conversion of coordinate array x from native units to base units.
By default, the input x is modified in place and also returned.
Changed in version 0.7.5: Keyword inplace can be set to False so that a modified copy is returned unless no conversion takes place, in which case the reference to the unmodified x is returned.
Conversion of coordinate array x from base units to native units.
By default, the input x is modified in place and also returned.
Changed in version 0.7.5: Keyword inplace can be set to False so that a modified copy is returned unless no conversion takes place, in which case the reference to the unmodified x is returned.
Convert time t from native units to base units.
By default, the input t is modified in place and also returned (although note that scalar values t are passed by value in Python and hence an in-place modification has no effect on the caller.)
Changed in version 0.7.5: Keyword inplace can be set to False so that a modified copy is returned unless no conversion takes place, in which case the reference to the unmodified x is returned.
Convert time t from base units to native units.
By default, the input t is modified in place and also returned. (Also note that scalar values t are passed by value in Python and hence an in-place modification has no effect on the caller.)
Changed in version 0.7.5: Keyword inplace can be set to False so that a modified copy is returned unless no conversion takes place, in which case the reference to the unmodified x is returned.
In-place conversion of coordinate array v from native units to base units.
By default, the input v is modified in place and also returned.
New in version 0.7.5.
In-place conversion of coordinate array v from base units to native units.
By default, the input v is modified in place and also returned.
New in version 0.7.5.
override to define trajectory format of the reader/writer (DCD, XTC, ...)
dict with units of of time and length (and velocity, force, ... for formats that support it)
Base class for trajectory readers.
See the Trajectory API definition in MDAnalysis.coordinates.__init__ for the required attributes and methods.
Returns a writer appropriate for filename.
Sets the default keywords start, step and delta (if available). numatoms is always set from Reader.numatoms.
See also
Reader.Writer() and MDAnalysis.Writer()
Returns a trajectory writer with the same properties as this trajectory.
Time between two trajectory frames in picoseconds.
Frame number of the current time step.
This is a simple short cut to Timestep.frame.
Forward one step to next frame.
Position at beginning of trajectory
Time of the current frame in MDAnalysis time units (typically ps).
time = Timestep.frame * Reader.dt
Total length of the trajectory numframes * dt.
Reader that concatenates multiple trajectories on the fly.
Known issues
Set up the chain reader.
Arguments : |
|
---|
Reader instance from which frames are being read.
Cumulative frame number of the current time step.
Note
The frame number is 1-based, i.e. the first frame has frame number 1. However, frame indices (used for indexing and slicing with the trajectory[frame_index] notation use a 0-based index, i.e. frame - 1.
Set current frame to the beginning.
Cumulative time of the current frame in MDAnalysis time units (typically ps).
Base class for trajectory writers.
See Trajectory API definition in MDAnalysis.coordinates.__init__ for the required attributes and methods.
Read dimensions from timestep ts and return appropriate unitcell
Returns True if all values are within limit values of their formats.
Due to rounding, the test is asymmetric (and min is supposed to be negative):
min < x <= max
Arguments : |
|
---|---|
Returns : | boolean |