def __init__(self, f, sub=slice(None), file_unit=angstrom):
xyz_reader = XYZReader(f, sub, file_unit=file_unit)<EOL>self.file_unit = file_unit<EOL>self.numbers = xyz_reader.numbers<EOL>self.symbols = xyz_reader.symbols<EOL>self.titles = []<EOL>if sub.stop is not None:<EOL><INDENT>start = sub.start<EOL>if start is None: start = <NUM_LIT:0><EOL>step = sub.step<EOL>if step is None: step = <NUM_LIT:1><EOL>count = (sub.stop - start + step - <NUM_LIT:1>)//step<EOL>self.geometries = np.zeros((count, len(self.numbers), <NUM_LIT:3>), float)<EOL>for counter, (title, coordinates) in enumerate(xyz_reader):<EOL><INDENT>self.titles.append(title)<EOL>self.geometries[counter] = coordinates<EOL><DEDENT>assert counter+<NUM_LIT:1> == count<EOL><DEDENT>else:<EOL><INDENT>geometries = []<EOL>for title, coordinates in xyz_reader:<EOL><INDENT>self.titles.append(title)<EOL>geometries.append(coordinates)<EOL><DEDENT>self.geometries = np.array(geometries, float)<EOL><DEDENT>
Initialize an XYZFile object

           Argument:
            | ``f``  --  a filename or a file-like object to read from

           Optional arguments:
            | ``sub``  --  a slice indicating which frames to read/skip
            | ``file_unit``  --  the conversion constant to convert data into atomic
                                 units [default=angstrom]

           XYZFile instances always have to following attriubtes:
            | ``numbers``  --  The atom numbers (of one frame)
            | ``symbols``  --  The atom symbols (of one frame)
            | ``titles``   --  The titles of all the frames
            | ``geometries``  --  A MxNx3 array with all the atom coordinates