from ASE.Visualization.VMD import VMD
from Dacapo import Dacapo
#outfile is the name of the outfile you want to plot
atoms=Dacapo.ReadAtoms('outfile.nc')
#Plot the atom, .Repeat can be used to repeat the unit cell
VMD(atoms.Repeat((1,1,1)))


#Saving ListOfatoms and the electron density as a .Cube file
from ASE.IO.Cube import WriteCube
calc=atoms.GetCalculator()
density_array=calc.GetDensityArray()
WriteCube(atoms,density_array,'densityarray.cube')

