1 | #source should be in minuscule letters
|
---|
2 | set source $1
|
---|
3 | set ncycles $2
|
---|
4 |
|
---|
5 | #c++compile meanSigSum
|
---|
6 | #c++link meanSigSum.so meanSigSum
|
---|
7 |
|
---|
8 | set defatt "font=helvetica,bold,20 fixedfonsize"
|
---|
9 | set axedefatt "font=helvetica,bold,30 fixedfonsize grid"
|
---|
10 |
|
---|
11 | set defatt ""
|
---|
12 | set axedefatt "grid"
|
---|
13 |
|
---|
14 | graphicatt ""
|
---|
15 | setaxesatt "$axedefatt"
|
---|
16 |
|
---|
17 |
|
---|
18 | set f1420low 1420.2
|
---|
19 | set f1420high 1420.6
|
---|
20 | nbins1420 = floor((${f1420high}-${f1420low})/250*8192)
|
---|
21 |
|
---|
22 | set path "/sps/baoradio/AmasNancay/AST"
|
---|
23 | openppf ${path}/rawOnOffDiff_${source}-${ncycles}Cycles.ppf
|
---|
24 |
|
---|
25 |
|
---|
26 | clearscript evolAt1420Freq
|
---|
27 | clearscript evolAt1420SideFreq
|
---|
28 | clearscript evolAt1410a1415OffOn
|
---|
29 | clearscript sigmaRaw1420Side
|
---|
30 | clearscript sigmaRaw1410a1415
|
---|
31 | clearscript IntAt1420
|
---|
32 | clearscript diffOnOff
|
---|
33 | ###########################################
|
---|
34 | defscript evolAt1420Freq
|
---|
35 |
|
---|
36 |
|
---|
37 | #Follow up of the intensity arround the [1420,1421]MHz frequency in different calibration conditions
|
---|
38 | # NO calibration
|
---|
39 |
|
---|
40 | graphicatt "xylimits=0,500,-0.01,0.01"
|
---|
41 |
|
---|
42 | newwin 1 2
|
---|
43 | n/pl onoffevol.onoffRaw01420%cycle ! ! "blue cpts notit nsta"
|
---|
44 | settitle "Raw (ON-OFF)/OFF ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles " ' ' $defatt
|
---|
45 | n/pl onoffevol.onoffRaw11420%cycle ! ! "red cpts notit nsta"
|
---|
46 | setaxelabels "cycle" "I[${f1420low},${f1420high}]MHz Raw (a.u)" $axedefatt
|
---|
47 |
|
---|
48 |
|
---|
49 | newh1d hSigmaRaw0 -0.01 0.01 25
|
---|
50 | newh1d hSigmaRaw1 -0.01 0.01 25
|
---|
51 |
|
---|
52 | graphicatt ""
|
---|
53 |
|
---|
54 | newwin 1 1
|
---|
55 | n/proj hSigmaRaw0 onoffevol.onoffRaw01420 ! ! ! "blue cpts notit"
|
---|
56 | n/proj hSigmaRaw1 onoffevol.onoffRaw11420 ! ! ! "same red cpts notit"
|
---|
57 | settitle "Raw (ON-OFF)/OFF ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles " ' ' $defatt
|
---|
58 | setaxelabels "(a.u)" "I[${f1420low},${f1420high}]MHz Raw" $axedefatt
|
---|
59 |
|
---|
60 | endscript
|
---|
61 | ##################################################
|
---|
62 | defscript sigmaRaw1420Side
|
---|
63 |
|
---|
64 | c++compile rebining
|
---|
65 | c++link rebining.so dorebin
|
---|
66 |
|
---|
67 |
|
---|
68 | #col 3 = onoffRaw01420side Ch 0
|
---|
69 | #col 4 = onoffRaw11420side Ch 1
|
---|
70 |
|
---|
71 | ntcol2var onoffevol 3 linCh0All
|
---|
72 | line2vec vecCh0All $linCh0All
|
---|
73 |
|
---|
74 | ntcol2var onoffevol 4 linCh1All
|
---|
75 | line2vec vecCh1All $linCh1All
|
---|
76 |
|
---|
77 | #packing values only valid for 500 cycles...
|
---|
78 | set packVal "1 10 25 50 100"
|
---|
79 | set sigmaCh0 ""
|
---|
80 | set errsigCh0 ""
|
---|
81 | set sigmaCh1 ""
|
---|
82 | set errsigCh1 ""
|
---|
83 |
|
---|
84 |
|
---|
85 | foreach ipack ( $packVal )
|
---|
86 |
|
---|
87 | #Packing per ipack
|
---|
88 | del invec
|
---|
89 | del outvec
|
---|
90 | cp vecCh0All invec
|
---|
91 | call dorebin $ipack
|
---|
92 | mean0 = ${outvec.sum}/${outvec.size}
|
---|
93 | sigma0 = sqrt(${outvec.sumsq}/${outvec.size}-${mean0}*${mean0})
|
---|
94 | errsig0 = ${sigma0}/sqrt(2*${outvec.size})
|
---|
95 | set sigmaCh0 "${sigmaCh0} ${sigma0}"
|
---|
96 | set errsigCh0 "${errsigCh0} ${errsig0}"
|
---|
97 | #
|
---|
98 | del invec
|
---|
99 | del outvec
|
---|
100 | cp vecCh1All invec
|
---|
101 | call dorebin $ipack
|
---|
102 | mean1 = ${outvec.sum}/${outvec.size}
|
---|
103 | sigma1 = sqrt(${outvec.sumsq}/${outvec.size}-${mean1}*${mean1})
|
---|
104 | errsig1 = ${sigma1}/sqrt(2*${outvec.size})
|
---|
105 | set sigmaCh1 "${sigmaCh1} ${sigma1}"
|
---|
106 | set errsigCh1 "${errsigCh1} ${errsig1}"
|
---|
107 | end
|
---|
108 |
|
---|
109 |
|
---|
110 | newnt nt0 x y ey
|
---|
111 | newnt nt1 x y ey
|
---|
112 |
|
---|
113 | set x0 ( $packVal )
|
---|
114 | set y0 ( $sigmaCh0 )
|
---|
115 | set ey0 ( $errsigCh0 )
|
---|
116 |
|
---|
117 | set x1 ( $packVal )
|
---|
118 | set y1 ( $sigmaCh1 )
|
---|
119 | set ey1 ( $errsigCh1 )
|
---|
120 |
|
---|
121 | for i 0:$#x0
|
---|
122 | line2nt nt0 $x0[i] $y0[i] $ey0[i]
|
---|
123 | line2nt nt1 $x1[i] $y1[i] $ey1[i]
|
---|
124 | end
|
---|
125 |
|
---|
126 |
|
---|
127 | newwin 1 1
|
---|
128 | plot2de nt0 x y 0 ey 1 "blue marker=fcircle,9 notit nsta"
|
---|
129 | plot2de nt1 x y 0 ey 1 "same red marker=fcircle,9 notit nsta"
|
---|
130 | n = ${#x0}-1
|
---|
131 | func $y0[0]/sqrt(x) $x0[0] $x0[n] 100 "same"
|
---|
132 | settitle "Sigma [1418,1419]U[1422,1423]MHz ${source} Ch 0 (blue) Ch 1 (red)" ' ' $defatt
|
---|
133 | setaxelabels "num of cycles" "Sigma (a.u)" $axedefatt
|
---|
134 |
|
---|
135 | endscript
|
---|
136 | ##################################################
|
---|
137 | defscript sigmaRaw1410a1415
|
---|
138 |
|
---|
139 | c++compile rebining
|
---|
140 | c++link rebining.so dorebin
|
---|
141 |
|
---|
142 |
|
---|
143 | #col 5 = onoffRaw0f14101415 Ch 0
|
---|
144 | #col 6 = onoffRaw1f14101415 Ch 1
|
---|
145 |
|
---|
146 | ntcol2var onoffevol 5 linCh0All
|
---|
147 | line2vec vecCh0All $linCh0All
|
---|
148 |
|
---|
149 | ntcol2var onoffevol 6 linCh1All
|
---|
150 | line2vec vecCh1All $linCh1All
|
---|
151 |
|
---|
152 | #packing values only valid for 500 cycles...
|
---|
153 | set packVal "1 10 25 50 100"
|
---|
154 | set sigmaCh0 ""
|
---|
155 | set errsigCh0 ""
|
---|
156 | set sigmaCh1 ""
|
---|
157 | set errsigCh1 ""
|
---|
158 |
|
---|
159 |
|
---|
160 | foreach ipack ( $packVal )
|
---|
161 |
|
---|
162 | #Packing per ipack
|
---|
163 | del invec
|
---|
164 | del outvec
|
---|
165 | cp vecCh0All invec
|
---|
166 | call dorebin $ipack
|
---|
167 | mean0 = ${outvec.sum}/${outvec.size}
|
---|
168 | sigma0 = sqrt(${outvec.sumsq}/${outvec.size}-${mean0}*${mean0})
|
---|
169 | errsig0 = ${sigma0}/sqrt(2*${outvec.size})
|
---|
170 | set sigmaCh0 "${sigmaCh0} ${sigma0}"
|
---|
171 | set errsigCh0 "${errsigCh0} ${errsig0}"
|
---|
172 | #
|
---|
173 | del invec
|
---|
174 | del outvec
|
---|
175 | cp vecCh1All invec
|
---|
176 | call dorebin $ipack
|
---|
177 | mean1 = ${outvec.sum}/${outvec.size}
|
---|
178 | sigma1 = sqrt(${outvec.sumsq}/${outvec.size}-${mean1}*${mean1})
|
---|
179 | errsig1 = ${sigma1}/sqrt(2*${outvec.size})
|
---|
180 | set sigmaCh1 "${sigmaCh1} ${sigma1}"
|
---|
181 | set errsigCh1 "${errsigCh1} ${errsig1}"
|
---|
182 | end
|
---|
183 |
|
---|
184 |
|
---|
185 | newnt nt0 x y ey
|
---|
186 | newnt nt1 x y ey
|
---|
187 |
|
---|
188 | set x0 ( $packVal )
|
---|
189 | set y0 ( $sigmaCh0 )
|
---|
190 | set ey0 ( $errsigCh0 )
|
---|
191 |
|
---|
192 | set x1 ( $packVal )
|
---|
193 | set y1 ( $sigmaCh1 )
|
---|
194 | set ey1 ( $errsigCh1 )
|
---|
195 |
|
---|
196 | for i 0:$#x0
|
---|
197 | line2nt nt0 $x0[i] $y0[i] $ey0[i]
|
---|
198 | line2nt nt1 $x1[i] $y1[i] $ey1[i]
|
---|
199 | end
|
---|
200 |
|
---|
201 |
|
---|
202 | newwin 1 1
|
---|
203 | plot2de nt0 x y 0 ey 1 "blue marker=fcircle,9 notit nsta"
|
---|
204 | plot2de nt1 x y 0 ey 1 "same red marker=fcircle,9 notit nsta"
|
---|
205 | n = ${#x0}-1
|
---|
206 | func $y0[0]/sqrt(x) $x0[0] $x0[n] 100 "same"
|
---|
207 | settitle "Sigma [1410,1415]MHz ${source} Ch 0 (blue) Ch 1 (red)" ' ' $defatt
|
---|
208 | setaxelabels "num of cycles" "Sigma (a.u)" $axedefatt
|
---|
209 |
|
---|
210 | endscript
|
---|
211 | ###########################################
|
---|
212 | defscript evolAt1410a1415OffOn
|
---|
213 |
|
---|
214 | graphicatt "xylimits=0,${ncycles},0.99,1.02"
|
---|
215 |
|
---|
216 | newwin 1 1
|
---|
217 | n/pl onoffevol.offRaw0f14101415%cycle ! ! "blue cpts notit nsta"
|
---|
218 | n/pl onoffevol.offRaw1f14101415%cycle ! ! "same red cpts notit nsta"
|
---|
219 | n/pl onoffevol.onRaw0f14101415%cycle ! ! "same cyan cpts notit nsta"
|
---|
220 | n/pl onoffevol.onRaw1f14101415%cycle ! ! "same orange cpts notit nsta"
|
---|
221 | settitle "Raw (OFF,ON)/OFF ${source} Ch 0 (blue/cyan) Ch 1 (red/orange) ${ncycles}cycles " ' ' $defatt
|
---|
222 | setaxelabels "cycle" "I[1410,1415]MHz Raw (a.u)" $axedefatt
|
---|
223 |
|
---|
224 | graphicatt "xylimits=0,${ncycles},-0.005,0.005"
|
---|
225 | newwin 1 1
|
---|
226 | n/pl onoffevol.(onRaw0f14101415-offRaw0f14101415)%cycle ! ! "blue cpts notit nsta"
|
---|
227 | n/pl onoffevol.(onRaw1f14101415-offRaw1f14101415)%cycle ! ! "same red cpts notit nsta"
|
---|
228 | settitle "Raw (ON-OFF)/OFF ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles " ' ' $defatt
|
---|
229 | setaxelabels "cycle" "DI [1410,1415]MHz Raw (a.u)" $axedefatt
|
---|
230 |
|
---|
231 | endscript
|
---|
232 | ###########################################
|
---|
233 | defscript evolAt1420SideFreq
|
---|
234 |
|
---|
235 |
|
---|
236 | #Follow up of the intensity arround the [${f1420low},${f1420high}]MHz frequency in different calibration conditions
|
---|
237 | # NO calibration
|
---|
238 |
|
---|
239 |
|
---|
240 | graphicatt "xylimits=0,500,-0.01,0.01"
|
---|
241 |
|
---|
242 | newwin 1 2
|
---|
243 | n/pl onoffevol.onoffRaw01420side%cycle ! ! "blue cpts notit nsta"
|
---|
244 | settitle "Raw (ON-OFF)/OFF ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles " ' ' $defatt
|
---|
245 | n/pl onoffevol.onoffRaw11420side%cycle ! ! "red cpts notit nsta"
|
---|
246 | setaxelabels "cycle" "I[1418,1419]U[1422,1423]MHz Raw (a.u)" $axedefatt
|
---|
247 |
|
---|
248 |
|
---|
249 | newh1d hSigmaSideRaw0 -0.01 0.01 25
|
---|
250 | newh1d hSigmaSideRaw1 -0.01 0.01 25
|
---|
251 |
|
---|
252 | graphicatt ""
|
---|
253 |
|
---|
254 | newwin 1 1
|
---|
255 | n/proj hSigmaSideRaw0 onoffevol.onoffRaw01420side ! ! ! "blue cpts notit"
|
---|
256 | n/proj hSigmaSideRaw1 onoffevol.onoffRaw11420side ! ! ! "same red cpts notit"
|
---|
257 | settitle "Raw (ON-OFF)/OFF ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles " ' ' $defatt
|
---|
258 | setaxelabels "(a.u)" "I[1418,1419]U[1422,1423]MHz Raw" $axedefatt
|
---|
259 |
|
---|
260 | endscript
|
---|
261 | ###########################################
|
---|
262 | defscript IntAt1420
|
---|
263 |
|
---|
264 |
|
---|
265 | #Follow up of the intensity arround the [${f1420low},${f1420high}]MHz
|
---|
266 | #frequency in different calibration conditions with baseline removed
|
---|
267 | # NO calibration
|
---|
268 |
|
---|
269 | graphicatt "xylimits=0,500,-0.1,0.1"
|
---|
270 |
|
---|
271 | newwin 1 2
|
---|
272 | n/pl onoffevol.${nbins1420}*(onoffRaw01420-onoffRaw01420side)%cycle ! ! "blue cpts notit nsta"
|
---|
273 | settitle "Raw (ON-OFF)/OFF ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles " ' ' $defatt
|
---|
274 | n/pl onoffevol.${nbins1420}*(onoffRaw11420-onoffRaw11420side)%cycle ! ! "red cpts notit nsta"
|
---|
275 | setaxelabels "cycle" "I 1420MHz Raw (a.u)" $axedefatt
|
---|
276 |
|
---|
277 |
|
---|
278 |
|
---|
279 | newh1d h1420IntRaw0 -0.1 0.1 25
|
---|
280 | newh1d h1420IntRaw1 -0.1 0.1 25
|
---|
281 |
|
---|
282 | graphicatt ""
|
---|
283 |
|
---|
284 | newwin 1 1
|
---|
285 | n/proj h1420IntRaw0 onoffevol.${nbins1420}*(onoffRaw01420-onoffRaw01420side) ! ! ! "blue cpts notit"
|
---|
286 | n/proj h1420IntRaw1 onoffevol.${nbins1420}*(onoffRaw11420-onoffRaw11420side) ! ! ! "same red cpts notit"
|
---|
287 | settitle "Raw (ON-OFF)/OFF ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles " ' ' $defatt
|
---|
288 | setaxelabels "(a.u)" "I 1420MHz Raw" $axedefatt
|
---|
289 |
|
---|
290 | endscript
|
---|
291 | ##################################################
|
---|
292 | defscript diffOnOff
|
---|
293 |
|
---|
294 | graphicatt "xylimits=1250,1500,-0.01,0.01"
|
---|
295 |
|
---|
296 | del s0 s1
|
---|
297 | objaoper meanOvOffNoCalib row 0 s0
|
---|
298 | objaoper meanOvOffNoCalib row 1 s1
|
---|
299 |
|
---|
300 | newwin
|
---|
301 | plot2d s0 (n/8192)*250+1250 val n>0 "cpts blue notit nsta"
|
---|
302 | plot2d s1 (n/8192)*250+1250 val n>0 "same cpts red notit nsta"
|
---|
303 | settitle "plot Raw (ON-OFF)/OFF ${source} ${ncycles} cycles, Ch 0 (blue) Ch 1 (red)"
|
---|
304 | setaxelabels "Freq. (MHz)" "I (a.u)"
|
---|
305 |
|
---|
306 | del stot
|
---|
307 | c++exec TVector<r_4> stot=s0+s1; stot/=2.; KeepObj(stot);
|
---|
308 |
|
---|
309 | newwin
|
---|
310 | plot2d stot (n/8192)*250+1250 val n>0 "cpts blue notit nsta"
|
---|
311 | settitle "Mean Raw (ON-OFF)/OFF ${source} ${ncycles} cycles"
|
---|
312 | setaxelabels "Freq. (MHz)" "I (a.u)"
|
---|
313 | endscript
|
---|
314 | ##################################################
|
---|