forked from foxsi/calsoft
-
Notifications
You must be signed in to change notification settings - Fork 0
/
peaks_fe_ni_cu_am_gauss_detpos5.pro
207 lines (158 loc) · 7.66 KB
/
peaks_fe_ni_cu_am_gauss_detpos5.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
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
; IDL procedure by Athiray
; Copyright (c) 2017, FOXSI Mission University of Minnesota. All rights reserved.
; Unauthorized reproduction is allowed.
; Start : 07 Jul 2017 15:09
; Last Mod : 07 Mar 2018 16:25
;------------------- Details of the program --------------------------;
; IDL procedure by Athiray
; Copyright (c) 2017, FOXSI Mission University of Minnesota. All rights reserved.
; Unauthorized reproduction is allowed.
; Start : 18 Apr 2017 21:52
; Last Mod : 07 Jul 2017 14:55
;------------------- Details of the program --------------------------;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
PRO PEAKS_FE_NI_CU_AM_gauss_detpos5, HISTFE=HISTFE, HISTAMNI=HISTAMNI,HISTAMCU=HISTAMCU, HISTAME=HISTAME
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
npeak=8
peaks=fltarr(npeak+3, 64, 4, 2)
error=fltarr(npeak+3, 64, 4, 2)
; n-side
for asic=0, 1 do begin
!p.multi=[0,3,2]
set_plot,'ps'
if asic eq 0 then fn='fits_asic0.eps' else fn= 'fits_asic1.eps'
device,filename=fn;,/color,/encapsulated
for ch=0, 63 do begin
xxfe=histfe(*, ch, asic,0)
yyfe=histfe(*, ch, asic,1)
xxamni=histamni(*, ch, asic,0)
yyamni=histamni(*, ch, asic,1)
xxamcu=histamcu(*, ch, asic,0)
yyamcu=histamcu(*, ch, asic,1)
xxam=histame(*, ch, asic,0)
yyam=histame(*, ch, asic,1)
peaks(*, ch, asic,1)=[0.0,0.0,5.895,7.47,8.04,13.93,17.611,59.54,0.0,0.0,0.0]
peaks(0, ch, asic, 1)=peaks(1, ch, asic, 1)*2-peaks(2, ch, asic, 1)
;peaks(npeak-2, ch, asic, 1)=peaks(npeak-3, ch, asic, 1)*2-peaks(npeak-4, ch, asic, 1)
;peaks(npeak-1, ch, asic, 1)=peaks(npeak-2, ch, asic, 1)*2-peaks(npeak-3, ch, asic, 1)
peaks(npeak , ch, asic, 1)=peaks(npeak-1, ch, asic, 1)*2-peaks(npeak-2, ch, asic, 1)
peaks(npeak+1, ch, asic, 1)=peaks(npeak , ch, asic, 1)*2-peaks(npeak-1, ch, asic, 1)
peaks(npeak+2, ch, asic, 1)=peaks(npeak+1, ch, asic, 1)*2-peaks(npeak , ch, asic, 1)
peaks(1, ch, asic, 0)=find_peak(xxamni,yyamni,-20, 20,4, 1)
;peaks(2, ch, asic, 0)=find_peak(xxfe,yyfe, 40, 80,1, 8)
gauss_peak=find_gauss(xxfe,yyfe, 35,80,1, 2)
peaks(2, ch, asic, 0)=gauss_peak[0]
error(2, ch, asic, 0)= gauss_peak[1]
;peaks(3, ch, asic, 0)=find_peak(xxamni,yyamni,50,75,2, 8)
peaks(4, ch, asic, 0)=find_peak(xxamcu,yyamcu,60,80,2, 8)
peaks(3, ch, asic, 0)=find_peak(xxamni,yyamni, 50,peaks(4,ch,asic,0)-5,2,8)
print,peaks(3,ch,asic,0),peaks(4,ch,asic,0)
;peaks(5, ch, asic, 0)=find_peak(xxam,yyam,100,130,2, 8)
gauss_peak=find_gauss(xxam,yyam, 95,130,1,2)
peaks(5, ch, asic, 0)=gauss_peak[0]
error(5, ch, asic, 0)= gauss_peak[1]
;peaks(6, ch, asic, 0)=find_peak(xxam,yyam,130,155,2,16)
gauss_peak=find_gauss(xxam,yyam, 125,165,1,2)
peaks(6, ch, asic, 0)=gauss_peak[0]
error(6, ch, asic, 0)= gauss_peak[1]
;peaks(7, ch, asic, 0)=find_peak(xxam,yyam,350,400,2,16)
gauss_peak=find_gauss(xxam,yyam, 350,410,1,2)
peaks(7, ch, asic, 0)=gauss_peak[0]
error(7, ch, asic, 0)= gauss_peak[1]
gauss_peak=find_gauss(xxam,yyam, 350,410,1,2)
peaks(7, ch, asic, 0)=gauss_peak[0]
error(7, ch, asic, 0)= gauss_peak[1]
gauss_peak=find_gauss(xxam,yyam, 350,410,1,2)
peaks(7, ch, asic, 0)=gauss_peak[0]
error(7, ch, asic, 0)= gauss_peak[1]
peaks(0, ch, asic, 0)=peaks(1, ch, asic, 0)*2-peaks(2, ch, asic, 0)
;peaks(npeak-2, ch, asic, 0)=peaks(npeak-3, ch, asic, 0)*2-peaks(npeak-4, ch, asic, 0)
;peaks(npeak-1, ch, asic, 0)=peaks(npeak-2, ch, asic, 0)*2-peaks(npeak-3, ch, asic, 0)
peaks(npeak , ch, asic, 0)=peaks(npeak-1, ch, asic, 0)*2-peaks(npeak-2, ch, asic, 0)
peaks(npeak+1, ch, asic, 0)=peaks(npeak , ch, asic, 0)*2-peaks(npeak-1, ch, asic, 0)
peaks(npeak+2, ch, asic, 0)=peaks(npeak+1, ch, asic, 0)*2-peaks(npeak , ch, asic, 0)
endfor
endfor
device,/close
set_plot,'x'
; p-side
for asic=2, 3 do begin
!p.multi=[0,3,3]
set_plot,'ps'
if asic eq 2 then fn='fits_asic2.eps' else fn= 'fits_asic3.eps'
device,filename=fn;,/color,/encapsulated
for ch=0, 63 do begin
xxfe=histfe(*, ch, asic,0)
yyfe=histfe(*, ch, asic,1)
xxamni=histamni(*, ch, asic,0)
yyamni=histamni(*, ch, asic,1)
xxamcu=histamcu(*, ch, asic,0)
yyamcu=histamcu(*, ch, asic,1)
xxam=histame(*, ch, asic,0)
yyam=histame(*, ch, asic,1)
;peaks(*, ch, asic, 1)=[0.0,0.0,5.895,13.93,17.611,20.9,30.85,34.96,59.54,0.0]
;peaks(*, ch, asic, 1)=[0.0,0.0,5.895,7.48,8.26,8.04,8.91,13.93,17.611,20.9,59.54,0.0]
;peaks(*, ch, asic,1)=[0.0,0.0,5.895,7.48,8.04,13.93,17.611,20.9,26.34,59.54,0.0]
peaks(*,ch,asic,1)=[0.0,0.0,5.895,7.47,8.04,13.93,17.611,20.9,26.3,59.54,0.0]
peaks(0, ch, asic, 1)=peaks(1, ch, asic, 1)*2-peaks(2, ch, asic, 1)
peaks(npeak+2, ch, asic, 1)=peaks(npeak+1, ch, asic, 1)*2-peaks(npeak, ch, asic, 1)
peaks(1, ch, asic, 0)=find_peak(xxam,yyam,-20, 20,4, 1)
;peaks(2, ch, asic, 0)=find_peak(xxfe,yyfe, 40,80,3, 2)
gauss_peak=find_gauss(xxfe,yyfe, 30,80,1, 1)
peaks(2, ch, asic, 0)=gauss_peak[0]
error(2, ch, asic, 0)= gauss_peak[1]
;peaks(3, ch, asic, 0)=find_peak(xxamni,yyamni, 50,85,3, 6)
gauss_peak=find_gauss(xxamni,yyamni, 50,80,2,2)
peaks(3, ch, asic, 0)=gauss_peak[0]
error(3, ch, asic, 0)= gauss_peak[1]
;peaks(4, ch, asic, 0)=find_peak(xxamcu,yyamcu, 60,100,3, 5)
gauss_peak=find_gauss(xxamcu,yyamcu, 60,100,1,1)
peaks(4, ch, asic, 0)=gauss_peak[0]
error(4, ch, asic, 0)= gauss_peak[1]
;peaks(6, ch, asic, 0)=find_peak(xxam,yyam,170,200,3, 4)
;peaks(6, ch, asic, 0)=find_peak(xxam,yyam,165,190,3, 2)
;commented to change range of peak selection for det. pos.6
;gauss_peak=find_gauss(xxam,yyam, 165,190,1,1)
gauss_peak=find_gauss(xxam,yyam, 165,205,1,1)
peaks(6, ch, asic, 0)=gauss_peak[0]
error(6, ch, asic, 0)= gauss_peak[1]
;peaks(5, ch, asic, 0)=find_peak(xxam,yyam,120,peaks(6,ch,asic,0)-35,3, 4)
gauss_peak=find_gauss(xxam,yyam, 120,peaks(6,ch,asic,0)-35,1,1)
peaks(5, ch, asic, 0)=gauss_peak[0]
error(5, ch, asic, 0)= gauss_peak[1]
;peaks(5, ch, asic, 0)=find_peak(xxamcu,yyamcu,100,peaks(6, ch, asic, 0)-30,3, 2)
;peaks(7, ch, asic, 0)=find_peak(xxamcu,yyamcu,peaks(6, ch, asic, 0)+30,300,3, 4)
;peaks(7, ch, asic, 0)=find_peak(xxam,yyam,200,245,3,5)
;commented to change range of peak selection for det. pos.6
;gauss_peak=find_gauss(xxam,yyam, 200,245,1,1)
gauss_peak=find_gauss(xxam,yyam, 200,255,1,1)
peaks(7, ch, asic, 0)=gauss_peak[0]
error(7, ch, asic, 0)= gauss_peak[1]
;peaks(8, ch, asic, 0)=find_peak(xxam,yyam,260,290,3,2)
gauss_peak=find_gauss(xxam,yyam, 260,300,2,2)
peaks(8, ch, asic, 0)=gauss_peak[0]
error(8, ch, asic, 0)= gauss_peak[1]
;peaks(9, ch, asic, 0)=find_peak(xxam,yyam,680,750,2,8)
gauss_peak=find_gauss(xxam,yyam, 680,750,2,4)
peaks(9, ch, asic, 0)=gauss_peak[0]
error(9, ch, asic, 0)= gauss_peak[1]
gauss_peak=find_gauss(xxam,yyam, 680,750,2,4)
peaks(9, ch, asic, 0)=gauss_peak[0]
error(9, ch, asic, 0)= gauss_peak[1]
peaks(0, ch, asic, 0)=peaks(1, ch, asic, 0)*2-peaks(2, ch, asic, 0)
peaks(npeak+2, ch, asic, 0)=peaks(npeak+1, ch, asic, 0)*2-peaks(npeak, ch, asic, 0)
print,asic,ch
endfor
endfor
device,/close
set_plot,'x'
;stop
;stop
;save,peaks,file='peaks_fe_ni_cu_am.sav'
save,peaks,file='peaks_fe_ni_cu_upsideam_gauss.sav'
stop
END