-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathday18feb15.py
More file actions
executable file
·114 lines (99 loc) · 4.89 KB
/
day18feb15.py
File metadata and controls
executable file
·114 lines (99 loc) · 4.89 KB
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
from dlstools import dataloader
from dlstools.quickfit import *
from dlstools.dirty_fit import fit #need to fix - gca no longer in top namespace
close('all')
path='/dls/i16/data/2015/cm12169-1/'
d=dataloader.dlsloader(path+'%i.dat')
p=dataloader.tiffloader(d, lambda obj: path+obj.pilatus100k_path_template)
'''
#overnight horizontal drift scans
scans=arange(499391,500205)
centres=[]; widths=[]; timesec=[]
for scan in scans:
d(scan)
figure(42);hold(0); plot(d.sx[1:], diff(d.diode)); axis('tight');
fit(gauss_c);
centres+=[gauss_c.p[1]]
widths+=[gauss_c.p[2]]
timesec+=[d.TimeSec]
centres=array(centres)
hdrift=(centres-centres[0])*1000.0
widths=array(widths)*1000.0
timesec=array(timesec);
hours=(timesec-timesec[0])/3600.0
figure(10);
subplot(2,2,1); plot(hours, hdrift); xlabel('Hours'); ylabel('Horiz. pos. (um)'); hold(0); grid('on'); axis('tight')
subplot(2,2,2); plot(hours, widths); xlabel('Hours'); ylabel('FWHM (um)'); hold(0); grid('on'); axis('tight')
#horizontal focus vs vertical position on mirror
scans=arange(500219,500255)
centres=[]; widths=[]; timesec=[]; vmtrans=[];
for scan in scans:
d(scan)
figure(42);hold(0); plot(d.sx[1:], diff(d.diode)); axis('tight');
fit(gauss_c);
centres+=[gauss_c.p[1]]
widths+=[gauss_c.p[2]]
timesec+=[d.TimeSec]
vmtrans+=[d.kbm1_y]
centres=array(centres)
hdrift=(centres-centres[0])*1000.0
widths=array(widths)*1000.0
timesec=array(timesec);
hours=(timesec-timesec[0])/3600.0
vmtrans=array(vmtrans)
figure(10);
subplot(2,2,3); plot(vmtrans, hdrift); xlabel('vmtrans'); ylabel('Horiz. pos. (um)'); hold(0); grid('on'); axis('tight')
subplot(2,2,4); plot(vmtrans, widths); xlabel('vmtrans'); ylabel('FWHM (um)'); hold(0); grid('on'); axis('tight')
#horizontal position vs vtrans
scans=arange(500279,500296)
centres=[]; widths=[]; timesec=[]; ssx=[]
for scan in scans:
d(scan)
figure(42);hold(0); plot(d.sx[1:], diff(d.diode));
plot(d.sx[23:45], diff(d.diode[22:45])); ######### zoomed in for better fit
fit(gauss_c);
centres+=[gauss_c.p[1]]
widths+=[gauss_c.p[2]]
timesec+=[d.TimeSec]
ssx+=[d.s5xtrans]
centres=array(centres)
hdrift=(centres-centres[0])*1000.0
widths=array(widths)*1000.0
timesec=array(timesec);
hours=(timesec-timesec[0])/3600.0
ssx=array(ssx)
figure(10);
subplot(2,2,1); plot(ssx, hdrift); xlabel('horiz beam pos (mm)'); ylabel('Horiz. pos. (um)'); hold(0); grid('on'); axis('tight')
subplot(2,2,2); plot(ssx, widths); xlabel('horiz beam pos (mm)'); ylabel('FWHM (um)'); hold(0); grid('on'); axis('tight')
d(500331); #long overnight drift scan
figure(10);
hours=(d.TimeSec-d.TimeSec[0])/3600.0
vdrift=(d.peakx_mm-d.peakx_mm[0])*1000
hdrift=(d.peaky_mm-d.peaky_mm[0])*1000
subplot(2,2,1); plot(hours, hdrift); xlabel('Hours'); ylabel('Horiz. pos. (um)'); hold(0); grid('on'); axis('tight'); ylim([-5,10]); title('#'+str(d.datanumber))
subplot(2,2,2); plot(hours, vdrift); xlabel('Hours'); ylabel('Vert. pos. (um)'); hold(0); grid('on'); axis('tight'); ylim([-15,0]);
subplot(2,2,3); plot(hours, d.fwhmy_mm*1000); xlabel('Hours'); ylabel('Horiz. fwhm. (um)'); hold(0); grid('on'); axis('tight'); ylim([0,50])
subplot(2,2,4); plot(hours, d.fwhmx_mm*1000); xlabel('Hours'); ylabel('Vert. fwhm. (um)'); hold(0); grid('on'); axis('tight'); ylim([0,50])
savefig('/home/i16user/tmp/tmp.pdf')
d(500333); #high-speed short scan
figure(10);
hours=(d.TimeSec-d.TimeSec[0])/3600.0
vdrift=(d.peakx_mm-d.peakx_mm[0])*1000
hdrift=(d.peaky_mm-d.peaky_mm[0])*1000
subplot(2,2,1); plot(hours, hdrift); xlabel('Hours'); ylabel('Horiz. pos. (um)'); hold(0); grid('on'); axis('tight'); ylim([-0.5,1]); title('#'+str(d.datanumber))
subplot(2,2,2); plot(hours, vdrift); xlabel('Hours'); ylabel('Vert. pos. (um)'); hold(0); grid('on'); axis('tight'); ylim([-.5,1])
subplot(2,2,3); plot(hours, d.fwhmy_mm*1000); xlabel('Hours'); ylabel('Horiz. fwhm. (um)'); hold(0); grid('on'); axis('tight'); ylim([20,25])
subplot(2,2,4); plot(hours, d.fwhmx_mm*1000); xlabel('Hours'); ylabel('Vert. fwhm. (um)'); hold(0); grid('on'); axis('tight'); ylim([20,25])
savefig('/home/i16user/tmp/tmp.pdf')
d(500335); #high-speed short scan; move hmtrans in/out by 1 mm
figure(10);
hours=(d.TimeSec-d.TimeSec[0])/3600.0
vdrift=(d.peakx_mm-d.peakx_mm[0])*1000
hdrift=(d.peaky_mm-d.peaky_mm[0])*1000
subplot(2,2,1); plot(hours, hdrift); xlabel('Hours'); ylabel('Horiz. pos. (um)'); hold(0); grid('on'); axis('tight'); ylim([-0.5,1]); title('#'+str(d.datanumber))
subplot(2,2,2); plot(hours, vdrift); xlabel('Hours'); ylabel('Vert. pos. (um)'); hold(0); grid('on'); axis('tight'); ylim([-.5,1])
subplot(2,2,3); plot(hours, d.fwhmy_mm*1000); xlabel('Hours'); ylabel('Horiz. fwhm. (um)'); hold(0); grid('on'); axis('tight'); ylim([20,25])
subplot(2,2,4); plot(hours, d.fwhmx_mm*1000); xlabel('Hours'); ylabel('Vert. fwhm. (um)'); hold(0); grid('on'); axis('tight'); ylim([20,25])
savefig('/home/i16user/tmp/tmp.pdf')
'''
#savefig('/home/i16user/tmp/tmp.pdf')