def _read_frame(self):
<EOL>line = self._get_line()<EOL>pos = line.rfind("<STR_LIT>")<EOL>if pos >= <NUM_LIT:0>:<EOL><INDENT>time = float(line[pos+<NUM_LIT:2>:])*picosecond<EOL><DEDENT>else:<EOL><INDENT>time = <NUM_LIT:0.0><EOL><DEDENT>num_atoms = int(self._get_line())<EOL>if self.num_atoms is not None and self.num_atoms != num_atoms:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>pos = np.zeros((num_atoms, <NUM_LIT:3>), np.float32)<EOL>vel = np.zeros((num_atoms, <NUM_LIT:3>), np.float32)<EOL>for i in range(num_atoms):<EOL><INDENT>words = self._get_line()[<NUM_LIT>:].split()<EOL>pos[i, <NUM_LIT:0>] = float(words[<NUM_LIT:0>])<EOL>pos[i, <NUM_LIT:1>] = float(words[<NUM_LIT:1>])<EOL>pos[i, <NUM_LIT:2>] = float(words[<NUM_LIT:2>])<EOL>vel[i, <NUM_LIT:0>] = float(words[<NUM_LIT:3>])<EOL>vel[i, <NUM_LIT:1>] = float(words[<NUM_LIT:4>])<EOL>vel[i, <NUM_LIT:2>] = float(words[<NUM_LIT:5>])<EOL><DEDENT>pos *= nanometer<EOL>vel *= nanometer/picosecond<EOL>cell = np.zeros((<NUM_LIT:3>, <NUM_LIT:3>), np.float32)<EOL>words = self._get_line().split()<EOL>if len(words) >= <NUM_LIT:3>:<EOL><INDENT>cell[<NUM_LIT:0>, <NUM_LIT:0>] = float(words[<NUM_LIT:0>])<EOL>cell[<NUM_LIT:1>, <NUM_LIT:1>] = float(words[<NUM_LIT:1>])<EOL>cell[<NUM_LIT:2>, <NUM_LIT:2>] = float(words[<NUM_LIT:2>])<EOL><DEDENT>if len(words) == <NUM_LIT:9>:<EOL><INDENT>cell[<NUM_LIT:1>, <NUM_LIT:0>] = float(words[<NUM_LIT:3>])<EOL>cell[<NUM_LIT:2>, <NUM_LIT:0>] = float(words[<NUM_LIT:4>])<EOL>cell[<NUM_LIT:0>, <NUM_LIT:1>] = float(words[<NUM_LIT:5>])<EOL>cell[<NUM_LIT:2>, <NUM_LIT:1>] = float(words[<NUM_LIT:6>])<EOL>cell[<NUM_LIT:0>, <NUM_LIT:2>] = float(words[<NUM_LIT:7>])<EOL>cell[<NUM_LIT:1>, <NUM_LIT:2>] = float(words[<NUM_LIT:8>])<EOL><DEDENT>cell *= nanometer<EOL>return time, pos, vel, cell<EOL>
Read one frame