Commit b7027daf by Francois Gygi

add xyz2qbox.py script

git-svn-id: http://qboxcode.org/svn/qb/trunk@1883 cba15fb0-1239-40c8-b417-11db7ca47a34
parent 4e6fee3f
#!/usr/bin/env python
# generate a Qbox input file from an xyz file
# use: xyz2qbox.py xyzfile
import sys
f = open(sys.argv[1])
line = f.readline()
buf = line.split()
nat = int(buf[0])
line = f.readline()
print "#",line,
for i in range(nat):
line = f.readline()
buf = line.split()
name=buf[0]
x = float(buf[1])/0.529177
y = float(buf[2])/0.529177
z = float(buf[3])/0.529177
print "atom ",name+str(i+1)," ",name+"_species",'%9.4f'%x,'%9.4f'%y,'%9.4f'%z
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment