Skip to content

Commit 4f8d216

Browse files
committed
improve dt unit handling
1 parent 10c94bc commit 4f8d216

File tree

1 file changed

+6
-1
lines changed
  • package/MDAnalysis/coordinates

1 file changed

+6
-1
lines changed

package/MDAnalysis/coordinates/DCD.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ def __init__(self, filename, convert_units=True, **kwargs):
118118
self.n_atoms = self._file.n_atoms
119119

120120

121-
dt = self._file.delta
121+
delta = mdaunits.convert(self._file.delta, self.units['time'], 'ps')
122+
dt = delta * self._file.nsavc
122123

123124
self.ts = self._Timestep(self.n_atoms, **self._ts_kwargs)
124125
frame = self._file.read()
@@ -194,6 +195,10 @@ def _frame_to_ts(self, frame, ts):
194195

195196
return ts
196197

198+
@property
199+
def dt(self):
200+
return self.ts.dt
201+
197202

198203
class DCDWriter(base.WriterBase):
199204
"""Base class for libmdaxdr file formats xtc and trr"""

0 commit comments

Comments
 (0)