source: util/src/CreateAllVspeShapes.py.in@ 59b70a

Last change on this file since 59b70a was e1a46d, checked in by Frederik Heber <heber@…>, 16 years ago

All of my python script put into ESPACK and adapted with @PYTHON@ and so on.

  • Property mode set to 100755
File size: 1.1 KB
Line 
1#!@PYTHON@
2#
3# parses elements.db and valence.db and runs CreateVspeShapes.py
4
5import os, sys, math
6werr = sys.stderr.write
7
8if len(sys.argv)<2:
9 werr("Usage is " + sys.argv[0] + " <DIR to .db's>\n")
10 sys.exit(1)
11
12dbdir=sys.argv[1]
13
14# parse databases
15elements=open(dbdir+"/elements.db", "r")
16valence=open(dbdir+"/valence.db", "r")
17
18# create empty array
19ElementsLookup=[]
20for nr in range(128):
21 ElementsLookup.append( [0,0] )
22
23nr=0
24for line in elements:
25 if "#" in line:
26 continue
27 else:
28 values = line.split()
29 #print "Setting entry "+str(nr)+",0 to "+values[1]+"."
30 ElementsLookup[nr][0] = values[1]
31 nr=nr+1
32
33for line in valence:
34 if "#" in line:
35 continue
36 else:
37 values = line.split()
38 ElementsLookup[int(values[0])-1][1] = float(values[1])
39
40elements.close()
41valence.close()
42
43# loop through all and call ShapeCreator
44#for j in range(len(ElementsLookup)):
45for j in range(0,80):
46 print str(ElementsLookup[j][0])+"\t"+str(ElementsLookup[j][1])
47 os.system("python CreateVspeShapes.py "+str(ElementsLookup[j][0])+" "+str(int((ElementsLookup[j][1]))))
48
Note: See TracBrowser for help on using the repository browser.