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

Last change on this file since 610 was 610, checked in by campagne, 13 years ago

cleaning

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