-
Notifications
You must be signed in to change notification settings - Fork 0
/
makeRWTable.py
80 lines (63 loc) · 1.8 KB
/
makeRWTable.py
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#
# makeRWTable.py
#
# C. Rohde
#
import numpy as np
import glob,sys
import latqcdtools.base.logger as logger
from latqcdtools.base.readWrite import writeTable
betac=sys.argv[1]
outFiles = list(glob.iglob(f'*{betac}*'))
betals=[]
Pmls=[]
Pels=[]
Ntls=[]
Nsls=[]
Nconfls=[]
Xmls=[]
Xels=[]
Bmls=[]
Bels=[]
Nt=None
Ns=None
RePls=[]
ImPls=[]
Bls=[]
for filename in outFiles:
try:
logger.info('opening',filename)
inFile=open(filename,'r')
except:
logger.TBError('error opening file',filename)
#isolate polyakov loop absolute value
for line in inFile:
if not line.startswith('#'):
continue
col=line.split()
if col[-3]=='loop':
#absPls.append((eval(col[-1])[0]**2+eval(col[-1])[1]**2)**0.5)
RePls.append(eval(col[-1])[0])
ImPls.append(eval(col[-1])[1])
if col[-3]=='Plaquette':
Bls.append(float(eval(col[-1])))
if col[-3]=='beta':
beta=float(col[-1])
if len(col)>6:
if col[-6]=='Lattice':
Nt=col[-1]
Ntls.append(Nt)
Ns=col[-2]
Nsls.append(Ns)
if len(set(Ntls))!=1:
logger.info('ERROR','multiple Nt values found')
sys.exit(-1)
if len(set(Nsls))!=1:
logger.info('ERROR','multiple Ns values found')
sys.exit(-1)
RePls=np.array(RePls)
ImPls=np.array(ImPls)
Bls=np.array(Bls)
writeTable('Nt'+Nt+'_Ns'+Ns+'b'+str(beta).replace('.','')+'.txt',\
np.sqrt(RePls**2+ImPls**2),Bls,header=['|P|','[]'])
logger.info('wrote table:','Nt'+Nt+'_Ns'+Ns+'b'+str(beta).replace('.','')+'.txt')