source: BAORadio/AmasNancay/trunk/etude_mergeAna.pic @ 589

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

improve analysis: sigma en ft du nbre de cycle (jec)

File size: 13.0 KB
Line 
1
2
3set source  $1
4set ncycles $2
5
6
7#set fcalib $3
8#set f1420low $4
9#set f1420high $5
10
11set fcalib 1410
12set f1420low 1420.2
13set f1420high 1420.6
14
15
16
17nbins1420 = floor((${f1420high}-${f1420low})/250*8192)
18
19echo $nbins1420
20
21
22
23clearscript diffOnOff
24clearscript evolAt1420Freq
25clearscript evolAt1420SideFreq
26clearscript IntAt1420
27clearscript sigmaRaw1420Side
28############################################################################
29defscript evolAtCalibFreq
30
31
32#Follow up of the intensity arround the Calib frequency in different calibration conditions
33# NO calibration
34# Calibration coeff. mean per Run
35# Calibration coeff. per cycles
36
37set fcalib $1
38
39
40newwin 1 2
41n/pl onoffevol.onoffRaw0%cycle ! ! "blue cpts notit nsta"
42settitle "Raw ON-OFF  ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles " ' ' $defatt
43n/pl onoffevol.onoffRaw1%cycle ! ! "red cpts notit nsta"
44setaxelabels "cycle" "I[${fcalib}MHz/6.25MHz] Raw (a.u)" $axedefatt
45
46newwin 1 2
47n/proj hRaw0 onoffevol.onoffRaw0 ! ! ! "blue cpts notit"
48settitle "Raw ON-OFF  ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles " ' ' $defatt
49n/proj hRaw1 onoffevol.onoffRaw1 ! ! ! "red cpts notit"
50settitle "I[${fcalib}MHz/6.25MHz] Raw (a.u)"
51
52
53       
54newwin 1 2
55n/pl onoffevol.onoffRun0%cycle ! ! "blue cpts notit nsta"
56settitle "ON-OFF Calib Run ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt
57n/pl onoffevol.onoffRun1%cycle ! ! "red cpts notit nsta"
58setaxelabels "cycle" "I[${fcalib}MHz/6.25MHz] Run (a.u)" $axedefatt
59
60
61newwin 1 2
62n/proj hRun0 onoffevol.onoffRun0 ! ! ! "blue cpts notit"
63settitle "ON-OFF Calib Run ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt
64n/proj hRun1 onoffevol.onoffRun1 ! ! ! "red cpts notit"
65settitle "I[${fcalib}MHz/6.25MHz] Run (a.u)"
66
67
68newwin 1 2
69n/pl onoffevol.onoffCycle0%cycle ! ! "blue cpts notit nsta"
70settitle "ON-OFF Calib Cycle ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt
71n/pl onoffevol.onoffCycle1%cycle ! ! "red cpts notit nsta"
72setaxelabels "cycle" "I[${fcalib}MHz/6.25MHz] Cycle (a.u)" $axedefatt
73
74newwin 1 2
75n/proj hCycle0 onoffevol.onoffCycle0 ! ! ! "blue cpts notit"
76settitle "ON-OFF Calib Cycle ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt
77n/proj hCycle1 onoffevol.onoffCycle1 ! ! ! "red cpts notit"
78settitle "I[${fcalib}MHz/6.25MHz] Cycle (a.u)"
79
80
81endscript
82###########################################
83defscript evolAt1420Freq
84
85
86#Follow up of the intensity arround the [1420,1421]MHz frequency in different calibration conditions
87# NO calibration
88# Calibration coeff. mean per Run
89# Calibration coeff. per cycles
90
91
92graphicatt "xylimits=0,500,-0.01,0.01"
93
94newwin 1 2
95n/pl onoffevol.onoffRaw01420%cycle ! ! "blue cpts notit nsta"
96settitle "Raw ON-OFF  ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles " ' ' $defatt
97n/pl onoffevol.onoffRaw11420%cycle ! ! "red cpts notit nsta"
98setaxelabels "cycle" "I[${f1420low},${f1420high}]MHz Raw (a.u)" $axedefatt
99
100
101newwin 1 2
102n/pl onoffevol.onoffRun01420%cycle ! ! "blue cpts notit nsta"
103settitle "ON-OFF Calib Run ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt
104n/pl onoffevol.onoffRun11420%cycle ! ! "red cpts notit nsta"
105setaxelabels "cycle" "I[${f1420low},${f1420high}]MHz Run (a.u)" $axedefatt
106
107
108newwin 1 2
109n/pl onoffevol.onoffCycle01420%cycle ! ! "blue cpts notit nsta"
110settitle "ON-OFF Calib Cycle ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt
111n/pl onoffevol.onoffCycle11420%cycle ! ! "red cpts notit nsta"
112setaxelabels "cycle" "I[${f1420low},${f1420high}]MHz Cycle (a.u)" $axedefatt
113
114
115newh1d hSigmaRaw0 -0.01 0.01 25
116newh1d hSigmaRaw1 -0.01 0.01 25
117newh1d hSigmaRun0 -0.01 0.01 25
118newh1d hSigmaRun1 -0.01 0.01 25
119newh1d hSigmaCycl0 -0.01 0.01 25
120newh1d hSigmaCycl1 -0.01 0.01 25
121
122graphicatt ""
123
124newwin 1 1
125n/proj hSigmaRaw0 onoffevol.onoffRaw01420 ! ! ! "blue cpts notit"
126n/proj hSigmaRaw1 onoffevol.onoffRaw11420 ! ! ! "same red cpts notit"
127settitle "Raw ON-OFF  ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles " ' ' $defatt
128setaxelabels "(a.u)" "I[${f1420low},${f1420high}]MHz Raw" $axedefatt
129
130newwin 1 1
131n/proj hSigmaRun0 onoffevol.onoffRun01420 ! ! ! "blue cpts notit"
132n/proj hSigmaRun1 onoffevol.onoffRun11420 ! ! ! "same red cpts notit"
133settitle "ON-OFF Calib Run ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt
134setaxelabels "(a.u)" "I[${f1420low},${f1420high}]MHz Run" $axedefatt
135
136
137newwin 1 1
138n/proj hSigmaCycl0 onoffevol.onoffCycle01420 ! ! ! "blue cpts notit"
139n/proj hSigmaCycl1 onoffevol.onoffCycle11420 ! ! ! "same red cpts notit"
140settitle "ON-OFF Calib Cycle ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt
141setaxelabels "(a.u)" "I[${f1420low},${f1420high}]MHz Cycle" $axedefatt
142
143
144endscript
145##################################################
146defscript sigmaRaw1420Side
147
148c++compile rebining
149c++link rebining.so dorebin
150
151
152
153
154#col 13 = onoffRaw01420side
155#col 14 = onoffRaw11420side
156
157ntcol2var onoffevol 13 linCh0All
158line2vec vecCh0All $linCh0All
159
160ntcol2var onoffevol 14 linCh1All
161line2vec vecCh1All $linCh1All
162
163
164set packVal "1 10 25 50 100"
165set sigmaCh0 ""
166set errsigCh0 ""
167set sigmaCh1 ""
168set errsigCh1 ""
169
170
171foreach ipack ( $packVal )
172
173#Packing per ipack
174  del invec
175  del outvec
176  cp vecCh0All invec
177  call dorebin $ipack
178  mean0 = ${outvec.sum}/${outvec.size}
179  sigma0 = sqrt(${outvec.sumsq}/${outvec.size}-${mean0}*${mean0})
180  errsig0 = ${sigma0}/sqrt(2*${outvec.size})   
181  set sigmaCh0 "${sigmaCh0} ${sigma0}" 
182  set errsigCh0 "${errsigCh0} ${errsig0}"       
183#
184  del invec
185  del outvec
186  cp vecCh1All invec
187  call dorebin $ipack
188  mean1 = ${outvec.sum}/${outvec.size}
189  sigma1 = sqrt(${outvec.sumsq}/${outvec.size}-${mean1}*${mean1})
190  errsig1 = ${sigma0}/sqrt(2*${outvec.size})   
191  set sigmaCh1 "${sigmaCh1} ${sigma1}" 
192  set errsigCh1 "${errsigCh1} ${errsig1}"
193end
194
195
196newnt nt0 x y ey
197newnt nt1 x y ey
198
199set x0 ( $packVal )
200set y0 ( $sigmaCh0 )
201set ey0 ( $errsigCh0 )
202
203set x1 ( $packVal )
204set y1 ( $sigmaCh1 )
205set ey1 ( $errsigCh1 )
206       
207for i 0:$#x0
208 line2nt nt0 $x0[i] $y0[i] $ey0[i]
209 line2nt nt1 $x1[i] $y1[i] $ey1[i]
210end
211
212
213newwin 1 1
214plot2de nt0 x y 0 ey 1 "blue marker=fcircle,9 notit nsta"     
215plot2de nt1 x y 0 ey 1 "same red  marker=fcircle,9 notit nsta"
216n = ${#x0}-1
217func $y0[0]/sqrt(x) $x0[0] $x0[n]  100 "same"
218settitle "Sigma [1418,1419]U[1422,1423]MHz ${source} Ch 0 (blue) Ch 1 (red)" ' ' $defatt
219setaxelabels "num of cycles" "Sigma (a.u)" $axedefatt
220
221
222
223endscript
224###########################################
225defscript evolAt1420SideFreq
226
227
228#Follow up of the intensity arround the [${f1420low},${f1420high}]MHz frequency in different calibration conditions
229# NO calibration
230# Calibration coeff. mean per Run
231# Calibration coeff. per cycles
232
233
234graphicatt "xylimits=0,500,-0.01,0.01"
235
236newwin 1 2
237n/pl onoffevol.onoffRaw01420side%cycle ! ! "blue cpts notit nsta"
238settitle "Raw ON-OFF  ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles " ' ' $defatt
239n/pl onoffevol.onoffRaw11420side%cycle ! ! "red cpts notit nsta"
240setaxelabels "cycle" "I[1418,1419]U[1422,1423]MHz Raw (a.u)" $axedefatt
241
242
243newwin 1 2
244n/pl onoffevol.onoffRun01420side%cycle ! ! "blue cpts notit nsta"
245settitle "ON-OFF Calib Run ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt
246n/pl onoffevol.onoffRun11420side%cycle ! ! "red cpts notit nsta"
247setaxelabels "cycle" "I[1418,1419]U[1422,1423]MHz Run (a.u)" $axedefatt
248
249
250newwin 1 2
251n/pl onoffevol.onoffCycle01420side%cycle ! ! "blue cpts notit nsta"
252settitle "ON-OFF Calib Cycle ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt
253n/pl onoffevol.onoffCycle11420side%cycle ! ! "red cpts notit nsta"
254setaxelabels "cycle" "I[1418,1419]U[1422,1423]MHz Cycle (a.u)" $axedefatt
255
256
257newh1d hSigmaSideRaw0 -0.01 0.01 25
258newh1d hSigmaSideRaw1 -0.01 0.01 25
259newh1d hSigmaSideRun0 -0.01 0.01 25
260newh1d hSigmaSideRun1 -0.01 0.01 25
261newh1d hSigmaSideCycl0 -0.01 0.01 25
262newh1d hSigmaSideCycl1 -0.01 0.01 25
263
264graphicatt ""
265
266newwin 1 1
267n/proj hSigmaSideRaw0 onoffevol.onoffRaw01420side ! ! ! "blue cpts notit"
268n/proj hSigmaSideRaw1 onoffevol.onoffRaw11420side ! ! ! "same red cpts notit"
269settitle "Raw ON-OFF  ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles " ' ' $defatt
270setaxelabels "(a.u)" "I[1418,1419]U[1422,1423]MHz Raw" $axedefatt
271
272newwin 1 1
273n/proj hSigmaSideRun0 onoffevol.onoffRun01420side ! ! ! "blue cpts notit"
274n/proj hSigmaSideRun1 onoffevol.onoffRun11420side ! ! ! "same red cpts notit"
275settitle "ON-OFF Calib Run ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt
276setaxelabels "(a.u)" "I[1418,1419]U[1422,1423]MHz Run" $axedefatt
277
278
279newwin 1 1
280n/proj hSigmaSideCycl0 onoffevol.onoffCycle01420side ! ! ! "blue cpts notit"
281n/proj hSigmaSideCycl1 onoffevol.onoffCycle11420side ! ! ! "same red cpts notit"
282settitle "ON-OFF Calib Cycle ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt
283setaxelabels "(a.u)" "I[1418,1419]U[1422,1423]MHz Cycle" $axedefatt
284
285
286endscript
287
288###########################################
289defscript IntAt1420
290
291
292#Follow up of the intensity arround the [${f1420low},${f1420high}]MHz
293#frequency in different calibration conditions with baseline removed
294# NO calibration
295# Calibration coeff. mean per Run
296# Calibration coeff. per cycles
297
298
299graphicatt "xylimits=0,500,-0.1,0.1"
300
301newwin 1 2
302n/pl onoffevol.${nbins1420}*(onoffRaw01420-onoffRaw01420side)%cycle ! ! "blue cpts notit nsta"
303settitle "Raw ON-OFF  ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles " ' ' $defatt
304n/pl onoffevol.${nbins1420}*(onoffRaw11420-onoffRaw11420side)%cycle ! ! "red cpts notit nsta"
305setaxelabels "cycle" "I 1420MHz Raw (a.u)" $axedefatt
306
307
308newwin 1 2
309n/pl onoffevol.${nbins1420}*(onoffRun01420-onoffRun01420side)%cycle ! ! "blue cpts notit nsta"
310settitle "ON-OFF Calib Run ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt
311n/pl onoffevol.${nbins1420}*(onoffRun11420-onoffRun11420side)%cycle ! ! "red cpts notit nsta"
312setaxelabels "cycle" "I 1420MHz Run (a.u)" $axedefatt
313
314
315newwin 1 2
316n/pl onoffevol.${nbins1420}*(onoffCycle01420-onoffCycle01420side)%cycle ! ! "blue cpts notit nsta"
317settitle "ON-OFF Calib Cycle ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt
318n/pl onoffevol.${nbins1420}*(onoffCycle11420-onoffCycle11420side)%cycle ! ! "red cpts notit nsta"
319setaxelabels "cycle" "I 1420MHz Cycle (a.u)" $axedefatt
320
321
322newh1d h1420IntRaw0 -0.1 0.1 25
323newh1d h1420IntRaw1 -0.1 0.1 25
324newh1d h1420IntRun0 -0.1 0.1 25
325newh1d h1420IntRun1 -0.1 0.1 25
326newh1d h1420IntCycl0 -0.1 0.1 25
327newh1d h1420IntCycl1 -0.1 0.1 25
328
329graphicatt ""
330
331newwin 1 1
332n/proj h1420IntRaw0 onoffevol.${nbins1420}*(onoffRaw01420-onoffRaw01420side) ! ! ! "blue cpts notit"
333n/proj h1420IntRaw1 onoffevol.${nbins1420}*(onoffRaw11420-onoffRaw11420side) ! ! ! "same red cpts notit"
334settitle "Raw ON-OFF  ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles " ' ' $defatt
335setaxelabels "(a.u)" "I 1420MHz Raw" $axedefatt
336
337newwin 1 1
338n/proj h1420IntRun0 onoffevol.${nbins1420}*(onoffRun01420-onoffRun01420side) ! ! ! "blue cpts notit"
339n/proj h1420IntRun1 onoffevol.${nbins1420}*(onoffRun11420-onoffRun11420side) ! ! ! "same red cpts notit"
340settitle "ON-OFF Calib Run ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt
341setaxelabels "(a.u)" "I 1420MHz Run" $axedefatt
342
343
344
345newwin 1 1
346n/proj h1420IntCycl0 onoffevol.${nbins1420}*(onoffCycle01420-onoffCycle01420side) ! ! ! "blue cpts notit"
347n/proj h1420IntCycl1 onoffevol.${nbins1420}*(onoffCycle11420-onoffCycle11420side) ! ! ! "same red cpts notit"
348settitle "ON-OFF Calib Cycle ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt
349setaxelabels "(a.u)" "I 1420MHz Cycle" $axedefatt
350
351
352
353endscript
354##################################################
355defscript diffOnOff
356
357#
358#Display the ON-OFF over the whole freq. range in diffrent Calib. conditions
359# NO calibration
360# Calibration coeff. mean per Run
361# Calibration coeff. per cycles
362#
363
364
365
366graphicatt "xylimits=1250,1500,-0.01,0.01"
367del snocal0 snocal1
368objaoper meanNoCalib row 0 snocal0
369objaoper meanNoCalib row 1 snocal1
370newwin 1 1
371plot2d snocal0 (n/8192)*250+1250 val n>0 "blue cpts notit nsta"
372plot2d snocal1 (n/8192)*250+1250 val n>0 "red same cpts notit nsta"
373settitle "Raw ON-OFF  ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt
374setaxelabels "Freq. (MHz)" "I (a.u)" $axedefatt
375
376del sruncal0 sruncal1
377objaoper meanPerRunCalib row 0 sruncal0
378objaoper meanPerRunCalib row 1 sruncal1
379newwin 1 1
380plot2d sruncal0 (n/8192)*250+1250 val n>0 "blue cpts notit nsta"
381plot2d sruncal1 (n/8192)*250+1250 val n>0 "red same cpts notit nsta"
382settitle "ON-OFF Calib Run  ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt
383setaxelabels "Freq. (MHz)" "I (a.u)" $axedefatt
384
385newwin 1 1
386del scyclecal0 scyclecal1
387objaoper meanPerCycleCalib row 0 scyclecal0
388objaoper meanPerCycleCalib row 1 scyclecal1
389plot2d scyclecal0 (n/8192)*250+1250 val n>0 "blue cpts notit nsta"
390plot2d scyclecal1 (n/8192)*250+1250 val n>0 "red same cpts notit nsta"
391settitle "ON-OFF Calib Cycle  ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt
392setaxelabels "Freq. (MHz)" "I (a.u)" $axedefatt
393
394
395endscript
396
397
398
399
400#Main
401#use minuscule for source label
402
403
404
405
406openppf onoffsurvey_${source}-${ncycles}Cycles.ppf
407print onoffevol
408
409set defatt "font=helvetica,bold,20 fixedfonsize"
410set axedefatt  "font=helvetica,bold,30 fixedfonsize grid"
411
412set defatt ""
413set axedefatt  "grid"
414
415graphicatt ""
416setaxesatt "$axedefatt"
417
418
419#diffOnOff
420#evolAt1420Freq
421#evolAt1420SideFreq
422#IntAt1420
Note: See TracBrowser for help on using the repository browser.