Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1import numpy as np
3from ase.atom import Atom
4from ase.atoms import Atoms
5from ase.units import Bohr
8def read_cmdft(fileobj):
9 lines = fileobj.readlines()
10 del lines[0]
11 finished = False
12 s = Atoms()
13 while not finished:
14 w = lines.pop(0).split()
15 if w[0].startswith('"'):
16 position = Bohr * np.array([float(w[3]), float(w[4]), float(w[5])])
17 s.append(Atom(w[0].replace('"', ''), position))
18 else:
19 finished = True
21 yield s