def __init__(self, f, sub=slice(None), pos_unit=angstrom,<EOL>vel_unit=angstrom/picosecond, frc_unit=amu*angstrom/picosecond**<NUM_LIT:2>,<EOL>time_unit=picosecond, mass_unit=amu, restart=False,<EOL>):
SlicedReader.__init__(self, f, sub)<EOL>self._counter = <NUM_LIT:1> <EOL>self.pos_unit = pos_unit<EOL>self.vel_unit = vel_unit<EOL>self.frc_unit = frc_unit<EOL>self.time_unit = time_unit<EOL>self.mass_unit = mass_unit<EOL>restart = self._detect_restart()<EOL>if restart is None:<EOL><INDENT>try:<EOL><INDENT>self.header = next(self._f)[:-<NUM_LIT:1>]<EOL>integers = tuple(int(word) for word in next(self._f).split())<EOL>if len(integers) != <NUM_LIT:3>:<EOL><INDENT>raise FileFormatError("<STR_LIT>")<EOL><DEDENT>self.keytrj, self.imcon, self.num_atoms = integers<EOL><DEDENT>except StopIteration:<EOL><INDENT>raise FileFormatError("<STR_LIT>")<EOL><DEDENT>except ValueError:<EOL><INDENT>raise FileFormatError("<STR_LIT>")<EOL><DEDENT><DEDENT>else:<EOL><INDENT>self.header = '<STR_LIT>'<EOL>self.num_atoms, self.keytrj, self.imcon = restart<EOL><DEDENT>self._frame_size = <NUM_LIT:4> + self.num_atoms*(self.keytrj+<NUM_LIT:2>)<EOL>
Arguments:
  | ``f``  --  a filename or a file-like object

Optional arguments:
  | ``sub``  --  a slice indicating the frames to be skipped/selected
  | ``pos_unit``, ``vel_unit``, ``frc_unit``, ``time_unit``,
    ``mass_unit``  --  The conversion factors for the unit conversion
     from the units in the data file to atomic units. The defaults of
     these optional arguments correspond to the defaults of dlpoly.

When the file starts with a line that satisfies the following
conditions, it is assumed that this is a history restart file:

* line consists of 6 words
* first word equals 'timestep'
* the following for words are integers
* the last word is a float