conf = nlread('device.nc',DeviceConfiguration)[0]

#setup energies
energies = numpy.linspace(-2,3,100) * eV

#calculate the dos from the Left electrode
dos = DeviceDensityOfStates(conf, energies=energies, contributions=Left)

#calculate the projections on the atoms in the central region
dos_projection = [
     dos.evaluate(projection_list = ProjectionList([i])) for i in range(3,11)
     ]

#plot the data
import pylab
pylab.figure()
for i in range(3,11):
    label = conf.elements()[i].symbol()+'('+str(i)+')'
    pylab.plot(
        energies.inUnitsOf(eV),
	dos_projection[i-3].inUnitsOf(eV**-1),
	label=label
	)
pylab.legend()
pylab.xlabel("Energy (eV)")
pylab.ylabel("dos (1/eV)")
pylab.show()