source: BAORadio/AmasNancay/trunk/plotRawDiffOnOff.pic@ 608

Last change on this file since 608 was 608, checked in by campagne, 14 years ago

setup pure RAW data analysis, and uniformaize the use of (ON-OFF)/OFF (jec)

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