forked from cyankaet/orderml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgraph_test.py
50 lines (40 loc) · 1.53 KB
/
graph_test.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
import sys
import numpy as np
import matplotlib.pyplot as plt
from orderenv import OrderMethods
sys.path.append("/home/kmm11/orderml/Active Learning Fit Check")
import model_setup
logstore = '/wrk/kmm11/orderout/thirdpapertest/'
imgstore = '/wrk/kmm11/orderout/thirdpapertestgraphs/'
data = np.loadtxt(logstore + "successdata.npy")
plt.scatter(data[0], data[5]+1, s=3) # fix +1 if needed
plt.xlabel("Tn Value")
plt.ylabel("steps to succeed")
plt.savefig(imgstore + "steptns.png")
plt.close()
temps = np.loadtxt(logstore + "temps.npy")
T = np.arange(3,340,2)
I = OrderMethods.orderparameter(T, data[0], data[1], data[2], data[3])
# I = OrderMethods.orderparameter(T, Bk = 0.193547, Jt = 0.403109, Nf = 148.449, Tn = 128.817)
plt.plot(T, I)
Itemps = OrderMethods.orderparameter(temps, data[0], data[1], data[2], data[3])
print(temps)
temps[-1]=temps[-2]+35 # 35 hardcoded from output of test.py run because of a weird bug
# plt.scatter(temps, Itemps)
for temp in temps:
plt.axvline(temp, color='red', linestyle="--")
dirname="/wrk/kmm11/orderdata/nexus-selected"
dirname_reduced="/wrk/kmm11/orderdata/autoreduce-selected"
start_num=531827
end_num=531845
tth_arr, I_arr, Ierr_arr, T_arr = model_setup.read_data(dirname, dirname_reduced, start_num, end_num)
# print(I_arr)
# print(T_arr)
# realIs = []
# for i in range(len(temps)):
# realIs.append(np.sum(I_arr[int(temps[i])]))
# plt.scatter(temps, realIs, 'ro')
plt.title("Measured Temperatures for ORNL Data")
plt.xlabel("Temperature")
plt.ylabel("Intensity")
plt.savefig(imgstore + "actions.png")