Attachment 'CO_wavefunction.py'

Download

   1 """ plot wavefunction, together with atoms using VTK. 
   2 
   3 CO molecule is used as an example. 
   4 
   5 Usage: python -i plotwavefunction.py <bandno>
   6 
   7 """
   8 from ASE import Atom,ListOfAtoms
   9 from ASE.Visualization.VTK import VTKPlotWaveFunction
  10 from ASE.Visualization.VTK import VTKPlotAtoms
  11 from Dacapo import Dacapo
  12 import os.path,sys
  13 
  14 args = sys.argv[1:]
  15 if len(args) != 1:
  16    band = 0
  17 else:
  18    band = int(args[0])
  19 
  20 print 'plotting wavefunction for band number ',band
  21 
  22 #Insert the name of the nc output file here (if you have a different one)
  23 atoms = Dacapo.ReadAtoms(filename='out_CO.nc')
  24 calc = atoms.GetCalculator()
  25 
  26 
  27 # make a combined plot of the wavefunction and the atoms
  28 atomplot = VTKPlotAtoms(atoms)
  29 wfplot = VTKPlotWaveFunction(atoms, band=band, parent=atomplot)
  30 atomplot.Update()
  31 
  32 # The appearence of the individual atomic elements can also be changed.
  33 # Finding aluminium atom avatar (found in the dictionary of species avatars)
  34 p1_O=atomplot.GetDictOfSpecies()['O']
  35 p1_C=atomplot.GetDictOfSpecies()['C']
  36 
  37 # Change the radius to 2.0 AA and set the color to blue
  38 p1_C.SetRadius(0.5)
  39 p1_O.SetRadius(0.7)
  40 
  41 #The color is given in an rgb (red,green,blue) scale
  42 p1_C.SetColor((1,0,0))
  43 p1_O.SetColor((0,1,0))
  44 atomplot.Render()
  45 
  46 # The unitcell can be removed
  47 unitcell=atomplot.unitcell
  48 atomplot.RemoveAvatar(unitcell)
  49 atomplot.Render()

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2006-02-03 13:40:31, 0.7 KB) [[attachment:Al-fcc.py]]
  • [get | view] (2006-02-03 13:41:10, 78.7 KB) [[attachment:Al_dos.jpg]]
  • [get | view] (2006-02-03 14:04:32, 27.8 KB) [[attachment:CO_dos.jpg]]
  • [get | view] (2006-02-03 13:28:17, 85.3 KB) [[attachment:CO_eigenstates.jpg]]
  • [get | view] (2006-02-03 13:24:30, 4.1 KB) [[attachment:CO_moscheme.gif]]
  • [get | view] (2006-02-03 13:27:59, 1.3 KB) [[attachment:CO_wavefunction.py]]
  • [get | view] (2006-02-03 13:33:40, 0.5 KB) [[attachment:Fe-anti.py]]
  • [get | view] (2006-02-03 13:33:18, 0.5 KB) [[attachment:Fe-ferro_compl.py]]
  • [get | view] (2006-02-03 13:33:58, 0.5 KB) [[attachment:Fe-non.py]]
  • [get | view] (2006-02-03 13:39:48, 28.7 KB) [[attachment:Fe_anti_viz.jpg]]
  • [get | view] (2006-02-03 13:28:48, 1.9 KB) [[attachment:Fe_atom_magn.gif]]
  • [get | view] (2006-02-03 13:34:47, 91.0 KB) [[attachment:Fe_dos_anti.jpg]]
  • [get | view] (2006-02-03 13:34:30, 100.7 KB) [[attachment:Fe_dos_ferro.jpg]]
  • [get | view] (2006-02-03 13:35:29, 85.6 KB) [[attachment:Fe_dos_non.jpg]]
  • [get | view] (2006-02-03 13:43:25, 0.9 KB) [[attachment:Si-diamond.py]]
  • [get | view] (2006-02-03 14:04:11, 67.5 KB) [[attachment:Si_dos.jpg]]
  • [get | view] (2006-02-03 13:38:47, 1.1 KB) [[attachment:dos.py]]
  • [get | view] (2006-02-03 13:39:11, 0.6 KB) [[attachment:viz_Fe_anti.py]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.