#!/usr/bin/python from Dacapo import Dacapo from ASE.Utilities.DOS import DOS myfile="al.nc" atoms=Dacapo.ReadAtoms(myfile) # Read in the atom and restart the calculator: atoms = Dacapo.ReadAtoms(myfile) calc=atoms.GetCalculator() E_f=calc.GetFermiLevel() N=calc.GetValenceElectrons() # Create a DOS object and extract data: dos = DOS(atoms, width=0.4) e = dos.GetEnergies() dos0 = dos.GetDOS(0) if dos.nspins == 2: # Spin polarized calculation: dos1 = dos.GetDOS(1) f=file('dos.dat', 'w') for i in range(len(e)): if e[i] < -e[0]: if dos.nspins == 1: print >> f, e[i], dos0[i] else: print >> f, e[i], dos0[i], dos1[i] # xmgrace -nxy dos.dat