Vtotav.py: Difference between revisions

From Wiki
Jump to navigation Jump to search
QiangLi (talk | contribs)
No edit summary
No edit summary
Line 1: Line 1:
There is a script written by Python to convert LOCPOT for visualization.
There is a script written in Python to convert LOCPOT for visualization.


The source of this script is from  Github [https://github.com/compphys/ase_tools/blob/master/scripts/vtotav.py]
The source of this script is from  Github [https://github.com/compphys/ase_tools/blob/master/scripts/vtotav.py]
Line 11: Line 11:
   pip install --upgrade --user ase  
   pip install --upgrade --user ase  


2 Uncompress and copy it to your bin folder  
2 Uncompress and copy it to your bin folder ($HOME/bin)


3 make it executable   
3 make it executable   
Line 23: Line 23:
5 You will get output file named  LOCPOT_Z  
5 You will get output file named  LOCPOT_Z  


6 Because there are many spaces in the output file, I wrote a script (commands below) to convert those spaces into the excel format data (already in [[Image:Vtotav.tgz]]):
6 You can also use the script to plot workfunction [[Image:workplot.py]], though it gives huge figures :p (see below)  


  sed -i '1d' LOCPOT_Z &&  sed -i 's/  */\t/g' LOCPOT_Z &&  sed -i 's/^[ \t]*//' LOCPOT_Z
7 It has additional options too; the first argument passed in the commandline sets the title (use dashes ''). Add two additional numbers to specify the range on the x-axis.


  For convenience, just copy the commands above and run it in terminal,
8 Alternatively you can load the script into Excel, Libreoffice or Origin. You'll first have to convert the file to the right format by running the line below in the terminal:


7 Copy the numbers from modified LOCPOT_Z to excel or Origin, and draw the figures
  sed -i '1d' LOCPOT_Z &&  sed -i 's/  */\t/g' LOCPOT_Z &&  sed -i 's/^[ \t]*//' LOCPOT_Z


8 You can also use the script to plot workfunction [[Image:Workplot.tgz]], it looks like a little bit larger (Sooooory) : [[Image: Workfunction.png]]
9 [[Image: Workfunction.png]]

Revision as of 16:48, 17 November 2016

There is a script written in Python to convert LOCPOT for visualization.

The source of this script is from Github [1]

You can download it by clicking the link or from our Wiki:

File:Vtotav.tgz

1 install ASE environment[2]:

 pip install --upgrade --user ase 

2 Uncompress and copy it to your bin folder ($HOME/bin)

3 make it executable

 chmod u+x ~/bin/vtotav.py 

4 In terminal, go to the folder containing work function calculation and run it with command:

  vtotav.py  LOCPOT  z   (z is the direction, you can use x,y,and z, depending on your system)

5 You will get output file named LOCPOT_Z

6 You can also use the script to plot workfunction File:Workplot.py, though it gives huge figures :p (see below)

7 It has additional options too; the first argument passed in the commandline sets the title (use dashes ). Add two additional numbers to specify the range on the x-axis.

8 Alternatively you can load the script into Excel, Libreoffice or Origin. You'll first have to convert the file to the right format by running the line below in the terminal:

 sed -i '1d' LOCPOT_Z &&  sed -i 's/  */\t/g' LOCPOT_Z &&  sed -i 's/^[ \t]*//' LOCPOT_Z

9