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
Make a new Timestep containing a subset of the original Timestep.
ts.copy_slice(slice(start, stop, skip)) ts.copy_slice([list of indices])
Returns : | A Timestep object of the same type containing all header information and all atom information relevent to the selection. |
---|
Note
The selection must be a 0 based slice or array of the atom indices in this Timestep
New in version 0.8.
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.
Base class bundling common functionality for trajectory I/O.
Changed in version 0.8: Added context manager protocol.
In-place conversion of forces array force from native units to base units.
By default, the input force is modified in place and also returned.
New in version 0.7.7.
In-place conversion of force array force from base units to native units.
By default, the input force is modified in place and also returned.
New in version 0.7.7.
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 velocities 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.
Reader that concatenates multiple trajectories on the fly.
Known issues
Set up the chain reader.
Arguments : |
|
---|
Changed in version 0.8: The delta keyword was added.
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.
The default is to return [A,B,C,alpha,beta,gamma]; if this is not appropriate then this method has to be overriden.
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 |