Generate figures

From Wiki
Revision as of 17:20, 10 July 2012 by Rgarcia (talk | contribs) (New page: To map several molecules at once, put together the CONTCAR files (CONT*). Then use this script: ---- # # # # # # # # # # # # # # # # # # # # # # # Edited by Rodrigo García, July 10, 2...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

To map several molecules at once, put together the CONTCAR files (CONT*). Then use this script:



  1. # # # # # # # # # # # # # # # # # # # # #
  2. Edited by Rodrigo García, July 10, 2012.#
  3. This program requires v2kxsf conversor. # <--- Available on https://nano.tu-dresden.de/~jkunstmann/software.html
  4. Tested on vasp 5.x files #
  5. Author: David Karhanek #
  6. # # # # # # # # # # # # # # # # # # # # #
  1. Batch conversion .pos (POSCAR) to .xsf (XCRYSDEN)

mkdir xsf eps # pos echo "Converting POSCARs to XSF files..." for j in `ls CONT*` ; do

 ./v2xsf $j           # You need the program v2kxsf
 uncompress $j.xsf.gz # The program automatically compress, so unzip
  1. Old code fragment
  2. upu -q '{quiet; layers@create byatom 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 ;\
  3. layers@delete hard 0; export xsf}' $j > /dev/null
  4. mv $j $j.pos

done

  1. EPS Print Preparation

echo "Preparing TCL script for EPS export..." for i in `ls *.xsf` do # resize 640 480

cat >>epsprinting.tcl<<!

scripting::open --xsf $i scripting::displayWindow resize 1200 900 xc_newvalue .mesa 8 0 1.000000 1.000000 1.000000 xc_newvalue .mesa 8 1 0.500000 1.000000 1.000000 xc_newvalue .mesa 8 6 0.750000 0.750000 0.750000 xc_newvalue .mesa 8 22 1.000000 1.000000 1.000000 scripting::displayMode3D BallStick set myParam(COV_SCALE) 1.25 set myParam(FRAMECOL) {10 10 0.50} scripting::load_myParam scripting::display on atomic-labels scripting::display on crystal-cells scripting::buildCrystal 2 2 2 scripting::zoom 15 scripting::printToFile ${i%\.xsf}.eps

! done

  1. Feel free to modify resize, buildcrystal and zoom parametens
  2. set myParam(FRAMECOL) {0.00 0.00 0.50}
  3. you can add those parameters before line 38 (scripting::zoom) :
  4. scripting::rotate x 45
  5. scripting::rotate y 45
  6. scripting::rotate x 45
  7. xc_translparam set 13 6 2
  8. xc_translparam set 7 2 5
  9. etc, see http://www.xcrysden.org/doc/prog/plot_all_MO.sh.html
  1. EPS Printing

echo "The TCL script 'epsprinting.tcl' is now ready for use with XCrysDen... " echo "" echo "Please wait while XCrysDen generate your figures" sleep 1 xcrysden -s epsprinting.tcl

  1. Clean up and Exit
  2. mv *.pos pos/ # old fragment. The original one moves CONTCAR files

mv *.xsf xsf/ mv *.eps eps/ mv epsprinting.tcl xsf/

echo "Finished! Good luck