-
Notifications
You must be signed in to change notification settings - Fork 1
/
plot_measured_voltages.py
55 lines (46 loc) · 1.77 KB
/
plot_measured_voltages.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
import sys
import numpy as np
import argparse
import subprocess
import re
import os
import yaml
import pickle
import matplotlib.pyplot as plt
#####################################
# Main
if __name__=='__main__':
parser = argparse.ArgumentParser()
parser.add_argument("filenames", help="pickle files storing rnet voltages", type=str, nargs='*')
args = parser.parse_args()
for filename in args.filenames:
#N = (7+1)*M_list[i] # N+1 x N+1 lattice
with open(filename, mode="rb") as f:
d = pickle.load(f)
print(len(d))
for i in range(len(d)):
fig = plt.figure(figsize=(5,5))
ax = fig.add_subplot(111)
cntr = ax.contour(d['%d'%i], colors='blue')
ax.clabel(cntr)
ax.set_aspect('equal')
plt.show()
# #d={'case1':case1 - baseline,'case2':case2 - baseline,'case3':case3 - baseline,'case4':case4 - baseline}
# d={}
# for i in range(len(M_list)):
# N = (7+1)*M_list[i] # N+1 x N+1 lattice
# with open('%d_%2.1fk_results.pickle' % (M_list[i], R_list[i]), mode="rb") as f:
# d = pickle.load(f)
# print('Loaded pickled data in %d_%2.1fk_results.pickle' % (M_list[i], R_list[i]))
# points = [np.array([0,0]), np.array([0.5,0.5]), np.array([0.25,0.25]), np.array([0.5,0.25])]
# for j in range(4):
# fig = plt.figure(figsize=(5,5))
# ax = fig.add_subplot(111)
# cntr = ax.contour(d['case%d'%(j+1)], colors='blue')
# ax.clabel(cntr)
# ax.set_aspect('equal')
# points[j]
# int_x = int(points[j][0]*(N+1))
# int_y = int(points[j][1]*(N+1))
# ax.scatter(int_y, int_x, color='orange', s=750)
# plt.show()