def read_elm(filename,orbitals): """ Read element data form .elm-file. """ f = open(filename,'r') data = {} data['symbol'] = find_value(f,'symbol') data['energies'] = [float(find_value(f,'epsilon_%s' %orb)) for orb in orbitals] data['U'] = float(find_value(f,'U')) data['FWHM'] = float(find_value(f,'FWHM')) f.close() return data
def read_elm(filename, orbitals): """ Read element data form .elm-file. """ f = open(filename, 'r') data = {} data['symbol'] = find_value(f, 'symbol') data['energies'] = [ float(find_value(f, 'epsilon_%s' % orb)) for orb in orbitals ] data['U'] = float(find_value(f, 'U')) data['FWHM'] = float(find_value(f, 'FWHM')) f.close() return data
def read_par(el1, el2, filename): """ Read parameter files. """ f = open(filename, 'r') tables = {} t12 = find_value(f, '%s_%s_table' % (el1, el2), fmt='matrix') t21 = find_value(f, '%s_%s_table' % (el2, el1), fmt='matrix') tables['N'] = len(t12[:, 0]) dr = t12[1, 0] - t12[0, 0] dr2 = t21[1, 0] - t21[0, 0] assert abs(dr - dr2) < 1E-13 tables['dr'] = dr tables['grid'] = t12[:, 0] tables['%s%s' % (el1, el2)] = t12[:, 1:] tables['%s%s' % (el2, el1)] = t21[:, 1:] rep = find_value(f, 'repulsion', fmt='matrix') return tables, rep
def read_par(el1,el2,filename): """ Read parameter files. """ f = open(filename,'r') tables = {} t12 = find_value(f,'%s_%s_table' %(el1,el2),fmt='matrix') t21 = find_value(f,'%s_%s_table' %(el2,el1),fmt='matrix') tables['N'] = len(t12[:,0]) dr = t12[1,0]-t12[0,0] dr2 = t21[1,0]-t21[0,0] assert abs(dr-dr2)<1E-13 tables['dr'] = dr tables['grid'] = t12[:,0] tables['%s%s' %(el1,el2)] = t12[:,1:] tables['%s%s' %(el2,el1)] = t21[:,1:] rep = find_value(f,'repulsion',fmt='matrix') return tables, rep