forked from foxsi/calsoft
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfwhm.pro
executable file
·60 lines (54 loc) · 1.55 KB
/
fwhm.pro
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
PRO FWHM, HIST=HIST, FILE=FILE
if keyword_set(file) then hist=makehist(file)
asic=0
xx0=(rebin(hist, 1124, 1, 4, 2))(*, 0, asic, 0)
yy0=(rebin(hist, 1124, 1, 4, 2))(*, 0, asic, 1)
result=gaussfit(xx0,yy0,coeff0)
fwhm0=2.35*coeff0[2]
asic=1
xx1=(rebin(hist, 1124, 1, 4, 2))(*, 0, asic, 0)
yy1=(rebin(hist, 1124, 1, 4, 2))(*, 0, asic, 1)
result=gaussfit(xx1,yy1,coeff1)
fwhm1=2.35*coeff1[2]
asic=2
xx2=(rebin(hist, 1124, 1, 4, 2))(*, 0, asic, 0)
yy2=(rebin(hist, 1124, 1, 4, 2))(*, 0, asic, 1)
result=gaussfit(xx2,yy2,coeff2)
fwhm2=2.35*coeff2[2]
asic=3
xx3=(rebin(hist, 1124, 1, 4, 2))(*, 0, asic, 0)
yy3=(rebin(hist, 1124, 1, 4, 2))(*, 0, asic, 1)
result=gaussfit(xx3,yy3,coeff3)
fwhm3=2.35*coeff3[2]
print,''
print,'FWHM for ASICs 0,1,2,3:'
print,fwhm0,fwhm1,fwhm2,fwhm3
print,''
if keyword_set(file) then begin
hist=makehist(file,/cmn_median)
asic=0
xx0=(rebin(hist, 1124, 1, 4, 2))(*, 0, asic, 0)
yy0=(rebin(hist, 1124, 1, 4, 2))(*, 0, asic, 1)
result=gaussfit(xx0,yy0,coeff0)
fwhm0=2.35*coeff0[2]
asic=1
xx1=(rebin(hist, 1124, 1, 4, 2))(*, 0, asic, 0)
yy1=(rebin(hist, 1124, 1, 4, 2))(*, 0, asic, 1)
result=gaussfit(xx1,yy1,coeff1)
fwhm1=2.35*coeff1[2]
asic=2
xx2=(rebin(hist, 1124, 1, 4, 2))(*, 0, asic, 0)
yy2=(rebin(hist, 1124, 1, 4, 2))(*, 0, asic, 1)
result=gaussfit(xx2,yy2,coeff2)
fwhm2=2.35*coeff2[2]
asic=3
xx3=(rebin(hist, 1124, 1, 4, 2))(*, 0, asic, 0)
yy3=(rebin(hist, 1124, 1, 4, 2))(*, 0, asic, 1)
result=gaussfit(xx3,yy3,coeff3)
fwhm3=2.35*coeff3[2]
print,''
print,'FWHM for ASICs 0,1,2,3, common-mode subtracted:'
print,fwhm0,fwhm1,fwhm2,fwhm3
print,''
endif
END