-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathday18_02_2018.py
160 lines (155 loc) · 4.55 KB
/
day18_02_2018.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
from dlstools import dataloader
from dlstools.quickfit import *
#from dlstools.dirty_fit import fit
path='/dls/b16/data/2018/mt16638-1/'
d=dataloader.dlsloader(path+'%i.dat')
close('all')
#scans=range(271665,271684+1,4) # before ajusting tomoPith
#scans=range(271710,271730+1,4) # after ajusting tomoPith
#scans=range(271730,271797+1,4) # after ajusting tomoPith
#scans=range(271799,271818+1,4) # after ajusting tomoPith
#scans=range(271819,271838+1,4) # after ajusting tomoPith
#scans=range(271839,271858+1,4) # after ajusting tomoPith
#scans=range(271959,271999+1,4) # after ajusting tomoPith
#scans=range(272307,272999+1,4) # after ajusting tomoPith
def PlotLoop(scans,fig):
while Iamscan==1:
figure(fig)
clf()
subplot(2,3,1)
for scan in scans:
try:
d(scan)
plot(d.mlmXtal1Y,d.ai1,label='s1vo: '+str(d.s1_s1vo)+'_#'+str(scan));
xlabel('mlmXtal1Y');ylabel('ai1');
#print(scan)
except:
pass
legend()
subplot(2,3,2)
for scan in scans:
try:
d(scan+1)
plot(d.mlmXtal2Bragg,d.ai1,label='s1vo: '+str(d.s1_s1vo)+'_#'+str(scan+1))
except:
pass
xlabel('mlmXtal2Bragg');ylabel('ai1');
legend()
subplot(2,3,3)
for scan in scans:
try:
d(scan+2)
plot(d.mlmXtal1Y,d.sum,label='_#'+str(scan+2))
except:
pass
xlabel('mlmXtal1Y');ylabel('Sum')
legend()
subplot(2,3,4)
for scan in scans:
try:
d(scan+3)
plot(d.tomoTheta,d.fliproi_sum/d.ai1,label='_#'+str(scan+3))
except:
pass
xlabel('TomoTheta');ylabel('ROI/ai1')
legend()
subplot(2,3,5)
for scan in scans:
try:
d(scan+4)
plot(d.x,d.fracdiff,label='s1vo:'+str(d.s1_s1vo)+'_#'+str(scan+4))
except:
pass
xlabel('X');ylabel('Diff');
legend()
subplot(2,3,6)
s1xvo=[];fracdiff=[]; err=[]
for scan in scans:
try:
d(scan+4)
s1xvo=[];fracdiff=[]; err=[]
s1xvo+=[mean(d.s1vo)]
fracdiff+=[mean(d.fracdiff)]
err+=[std(d.fracdiff)]
errorbar(s1xvo, fracdiff,err,label='#'+str(scan+4));
xlabel('Slit1 Height');ylabel('norm_diff');
except:
pass
legend()
grid(1)
pause(10)
return()
def PlotStatic(scans,fig):
figure(fig)
#clf()
subplot(2,3,1)
for scan in scans:
try:
d(scan)
plot(d.mlmXtal1Y,d.ai1,label='s1vo: '+str(d.s1_s1vo)+'_#'+str(scan));
xlabel('mlmXtal1Y');ylabel('ai1');
#print(scan)
except:
pass
legend()
subplot(2,3,2)
for scan in scans:
try:
d(scan+1)
plot(d.mlmXtal2Bragg,d.ai1,label='s1vo: '+str(d.s1_s1vo)+'_#'+str(scan+1))
except:
pass
xlabel('mlmXtal2Bragg');ylabel('ai1');
legend()
subplot(2,3,3)
for scan in scans:
try:
d(scan+2)
plot(d.mlmXtal1Y,d.sum,label='_#'+str(scan+2))
except:
pass
xlabel('mlmXtal1Y');ylabel('Sum')
legend()
subplot(2,3,4)
for scan in scans:
try:
d(scan+3)
plot(d.tomoTheta,d.fliproi_sum/d.ai1,label='_#'+str(scan+3))
except:
pass
xlabel('TomoTheta');ylabel('ROI/ai1')
legend()
subplot(2,3,5)
for scan in scans:
try:
d(scan+4)
plot(d.x,d.fracdiff,label='s1vo:'+str(d.s1_s1vo)+'_#'+str(scan+4))
except:
pass
xlabel('X');ylabel('Diff');
legend()
subplot(2,3,6)
s1xvo=[];fracdiff=[]; err=[]
for scan in scans:
try:
d(scan+4)
s1xvo=[];fracdiff=[]; err=[]
s1xvo+=[mean(d.s1vo)]
fracdiff+=[mean(d.fracdiff)]
err+=[std(d.fracdiff)]
errorbar(s1xvo, fracdiff,err,label='#'+str(scan+4));
xlabel('Slit1 Height');ylabel('norm_diff');
except:
pass
legend()
grid(1)
return()
scans=range(272478,272507+1,5);
PlotStatic(scans,1)
draw()
scans=range(272551,272556+1,5);
PlotStatic(scans,1)
draw()
scans=range(272564,272573+1,5);
PlotStatic(scans,1)
show()