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

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

continue improve analysis (jec)

File size: 15.2 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
22clearscript diffOnOff
23clearscript evolAt1420Freq
24clearscript evolAt1420SideFreq
25clearscript IntAt1420
26clearscript sigmaRaw1420Side
27clearscript sigmaRaw1400a1420
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#col 13 = onoffRaw01420side   Ch 0
153#col 14 = onoffRaw11420side   Ch 1
154
155ntcol2var onoffevol 13 linCh0All
156line2vec vecCh0All $linCh0All
157
158ntcol2var onoffevol 14 linCh1All
159line2vec vecCh1All $linCh1All
160
161#packing values only valid for 500 cycles...
162set packVal "1 10 25 50 100"
163set sigmaCh0 ""
164set errsigCh0 ""
165set sigmaCh1 ""
166set errsigCh1 ""
167
168
169foreach ipack ( $packVal )
170
171#Packing per ipack
172  del invec
173  del outvec
174  cp vecCh0All invec
175  call dorebin $ipack
176  mean0 = ${outvec.sum}/${outvec.size}
177  sigma0 = sqrt(${outvec.sumsq}/${outvec.size}-${mean0}*${mean0})
178  errsig0 = ${sigma0}/sqrt(2*${outvec.size})   
179  set sigmaCh0 "${sigmaCh0} ${sigma0}" 
180  set errsigCh0 "${errsigCh0} ${errsig0}"       
181#
182  del invec
183  del outvec
184  cp vecCh1All invec
185  call dorebin $ipack
186  mean1 = ${outvec.sum}/${outvec.size}
187  sigma1 = sqrt(${outvec.sumsq}/${outvec.size}-${mean1}*${mean1})
188  errsig1 = ${sigma1}/sqrt(2*${outvec.size})   
189  set sigmaCh1 "${sigmaCh1} ${sigma1}" 
190  set errsigCh1 "${errsigCh1} ${errsig1}"
191end
192
193
194newnt nt0 x y ey
195newnt nt1 x y ey
196
197set x0 ( $packVal )
198set y0 ( $sigmaCh0 )
199set ey0 ( $errsigCh0 )
200
201set x1 ( $packVal )
202set y1 ( $sigmaCh1 )
203set ey1 ( $errsigCh1 )
204       
205for i 0:$#x0
206 line2nt nt0 $x0[i] $y0[i] $ey0[i]
207 line2nt nt1 $x1[i] $y1[i] $ey1[i]
208end
209
210
211newwin 1 1
212plot2de nt0 x y 0 ey 1 "blue marker=fcircle,9 notit nsta"     
213plot2de nt1 x y 0 ey 1 "same red  marker=fcircle,9 notit nsta"
214n = ${#x0}-1
215func $y0[0]/sqrt(x) $x0[0] $x0[n]  100 "same"
216settitle "Sigma [1418,1419]U[1422,1423]MHz ${source} Ch 0 (blue) Ch 1 (red)" ' ' $defatt
217setaxelabels "num of cycles" "Sigma (a.u)" $axedefatt
218
219
220
221endscript
222##################################################
223defscript sigmaRaw1400a1420
224
225c++compile rebining
226c++link rebining.so dorebin
227
228
229#col 19 = onoffRaw0f14001420   Ch 0
230#col 20 = onoffRaw1f14001420  Ch 1
231
232ntcol2var onoffevol 19 linCh0All
233line2vec vecCh0All $linCh0All
234
235ntcol2var onoffevol 20 linCh1All
236line2vec vecCh1All $linCh1All
237
238#packing values only valid for 500 cycles...
239set packVal "1 10 25 50 100"
240set sigmaCh0 ""
241set errsigCh0 ""
242set sigmaCh1 ""
243set errsigCh1 ""
244
245
246foreach ipack ( $packVal )
247
248#Packing per ipack
249  del invec
250  del outvec
251  cp vecCh0All invec
252  call dorebin $ipack
253  mean0 = ${outvec.sum}/${outvec.size}
254  sigma0 = sqrt(${outvec.sumsq}/${outvec.size}-${mean0}*${mean0})
255  errsig0 = ${sigma0}/sqrt(2*${outvec.size})   
256  set sigmaCh0 "${sigmaCh0} ${sigma0}" 
257  set errsigCh0 "${errsigCh0} ${errsig0}"       
258#
259  del invec
260  del outvec
261  cp vecCh1All invec
262  call dorebin $ipack
263  mean1 = ${outvec.sum}/${outvec.size}
264  sigma1 = sqrt(${outvec.sumsq}/${outvec.size}-${mean1}*${mean1})
265  errsig1 = ${sigma1}/sqrt(2*${outvec.size})   
266  set sigmaCh1 "${sigmaCh1} ${sigma1}" 
267  set errsigCh1 "${errsigCh1} ${errsig1}"
268end
269
270
271newnt nt0 x y ey
272newnt nt1 x y ey
273
274set x0 ( $packVal )
275set y0 ( $sigmaCh0 )
276set ey0 ( $errsigCh0 )
277
278set x1 ( $packVal )
279set y1 ( $sigmaCh1 )
280set ey1 ( $errsigCh1 )
281       
282for i 0:$#x0
283 line2nt nt0 $x0[i] $y0[i] $ey0[i]
284 line2nt nt1 $x1[i] $y1[i] $ey1[i]
285end
286
287
288newwin 1 1
289plot2de nt0 x y 0 ey 1 "blue marker=fcircle,9 notit nsta"     
290plot2de nt1 x y 0 ey 1 "same red  marker=fcircle,9 notit nsta"
291n = ${#x0}-1
292func $y0[0]/sqrt(x) $x0[0] $x0[n]  100 "same"
293settitle "Sigma [1400,1420]MHz ${source} Ch 0 (blue) Ch 1 (red)" ' ' $defatt
294setaxelabels "num of cycles" "Sigma (a.u)" $axedefatt
295
296
297
298endscript
299###########################################
300
301defscript evolAt1420SideFreq
302
303
304#Follow up of the intensity arround the [${f1420low},${f1420high}]MHz frequency in different calibration conditions
305# NO calibration
306# Calibration coeff. mean per Run
307# Calibration coeff. per cycles
308
309
310graphicatt "xylimits=0,500,-0.01,0.01"
311
312newwin 1 2
313n/pl onoffevol.onoffRaw01420side%cycle ! ! "blue cpts notit nsta"
314settitle "Raw ON-OFF  ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles " ' ' $defatt
315n/pl onoffevol.onoffRaw11420side%cycle ! ! "red cpts notit nsta"
316setaxelabels "cycle" "I[1418,1419]U[1422,1423]MHz Raw (a.u)" $axedefatt
317
318
319newwin 1 2
320n/pl onoffevol.onoffRun01420side%cycle ! ! "blue cpts notit nsta"
321settitle "ON-OFF Calib Run ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt
322n/pl onoffevol.onoffRun11420side%cycle ! ! "red cpts notit nsta"
323setaxelabels "cycle" "I[1418,1419]U[1422,1423]MHz Run (a.u)" $axedefatt
324
325
326newwin 1 2
327n/pl onoffevol.onoffCycle01420side%cycle ! ! "blue cpts notit nsta"
328settitle "ON-OFF Calib Cycle ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt
329n/pl onoffevol.onoffCycle11420side%cycle ! ! "red cpts notit nsta"
330setaxelabels "cycle" "I[1418,1419]U[1422,1423]MHz Cycle (a.u)" $axedefatt
331
332
333newh1d hSigmaSideRaw0 -0.01 0.01 25
334newh1d hSigmaSideRaw1 -0.01 0.01 25
335newh1d hSigmaSideRun0 -0.01 0.01 25
336newh1d hSigmaSideRun1 -0.01 0.01 25
337newh1d hSigmaSideCycl0 -0.01 0.01 25
338newh1d hSigmaSideCycl1 -0.01 0.01 25
339
340graphicatt ""
341
342newwin 1 1
343n/proj hSigmaSideRaw0 onoffevol.onoffRaw01420side ! ! ! "blue cpts notit"
344n/proj hSigmaSideRaw1 onoffevol.onoffRaw11420side ! ! ! "same red cpts notit"
345settitle "Raw ON-OFF  ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles " ' ' $defatt
346setaxelabels "(a.u)" "I[1418,1419]U[1422,1423]MHz Raw" $axedefatt
347
348newwin 1 1
349n/proj hSigmaSideRun0 onoffevol.onoffRun01420side ! ! ! "blue cpts notit"
350n/proj hSigmaSideRun1 onoffevol.onoffRun11420side ! ! ! "same red cpts notit"
351settitle "ON-OFF Calib Run ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt
352setaxelabels "(a.u)" "I[1418,1419]U[1422,1423]MHz Run" $axedefatt
353
354
355newwin 1 1
356n/proj hSigmaSideCycl0 onoffevol.onoffCycle01420side ! ! ! "blue cpts notit"
357n/proj hSigmaSideCycl1 onoffevol.onoffCycle11420side ! ! ! "same red cpts notit"
358settitle "ON-OFF Calib Cycle ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt
359setaxelabels "(a.u)" "I[1418,1419]U[1422,1423]MHz Cycle" $axedefatt
360
361
362endscript
363
364###########################################
365defscript IntAt1420
366
367
368#Follow up of the intensity arround the [${f1420low},${f1420high}]MHz
369#frequency in different calibration conditions with baseline removed
370# NO calibration
371# Calibration coeff. mean per Run
372# Calibration coeff. per cycles
373
374
375graphicatt "xylimits=0,500,-0.1,0.1"
376
377newwin 1 2
378n/pl onoffevol.${nbins1420}*(onoffRaw01420-onoffRaw01420side)%cycle ! ! "blue cpts notit nsta"
379settitle "Raw ON-OFF  ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles " ' ' $defatt
380n/pl onoffevol.${nbins1420}*(onoffRaw11420-onoffRaw11420side)%cycle ! ! "red cpts notit nsta"
381setaxelabels "cycle" "I 1420MHz Raw (a.u)" $axedefatt
382
383
384newwin 1 2
385n/pl onoffevol.${nbins1420}*(onoffRun01420-onoffRun01420side)%cycle ! ! "blue cpts notit nsta"
386settitle "ON-OFF Calib Run ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt
387n/pl onoffevol.${nbins1420}*(onoffRun11420-onoffRun11420side)%cycle ! ! "red cpts notit nsta"
388setaxelabels "cycle" "I 1420MHz Run (a.u)" $axedefatt
389
390
391newwin 1 2
392n/pl onoffevol.${nbins1420}*(onoffCycle01420-onoffCycle01420side)%cycle ! ! "blue cpts notit nsta"
393settitle "ON-OFF Calib Cycle ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt
394n/pl onoffevol.${nbins1420}*(onoffCycle11420-onoffCycle11420side)%cycle ! ! "red cpts notit nsta"
395setaxelabels "cycle" "I 1420MHz Cycle (a.u)" $axedefatt
396
397
398newh1d h1420IntRaw0 -0.1 0.1 25
399newh1d h1420IntRaw1 -0.1 0.1 25
400newh1d h1420IntRun0 -0.1 0.1 25
401newh1d h1420IntRun1 -0.1 0.1 25
402newh1d h1420IntCycl0 -0.1 0.1 25
403newh1d h1420IntCycl1 -0.1 0.1 25
404
405graphicatt ""
406
407newwin 1 1
408n/proj h1420IntRaw0 onoffevol.${nbins1420}*(onoffRaw01420-onoffRaw01420side) ! ! ! "blue cpts notit"
409n/proj h1420IntRaw1 onoffevol.${nbins1420}*(onoffRaw11420-onoffRaw11420side) ! ! ! "same red cpts notit"
410settitle "Raw ON-OFF  ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles " ' ' $defatt
411setaxelabels "(a.u)" "I 1420MHz Raw" $axedefatt
412
413newwin 1 1
414n/proj h1420IntRun0 onoffevol.${nbins1420}*(onoffRun01420-onoffRun01420side) ! ! ! "blue cpts notit"
415n/proj h1420IntRun1 onoffevol.${nbins1420}*(onoffRun11420-onoffRun11420side) ! ! ! "same red cpts notit"
416settitle "ON-OFF Calib Run ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt
417setaxelabels "(a.u)" "I 1420MHz Run" $axedefatt
418
419
420
421newwin 1 1
422n/proj h1420IntCycl0 onoffevol.${nbins1420}*(onoffCycle01420-onoffCycle01420side) ! ! ! "blue cpts notit"
423n/proj h1420IntCycl1 onoffevol.${nbins1420}*(onoffCycle11420-onoffCycle11420side) ! ! ! "same red cpts notit"
424settitle "ON-OFF Calib Cycle ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt
425setaxelabels "(a.u)" "I 1420MHz Cycle" $axedefatt
426
427
428
429endscript
430##################################################
431defscript diffOnOff
432
433#
434#Display the ON-OFF over the whole freq. range in diffrent Calib. conditions
435# NO calibration
436# Calibration coeff. mean per Run
437# Calibration coeff. per cycles
438#
439
440graphicatt "xylimits=1250,1500,-0.01,0.01"
441del sonoffovoff0 sonoffovoff1
442objaoper meanOvOffNoCalib row 0 sonoffovoff0
443objaoper meanOvOffNoCalib row 1 sonoffovoff1
444newwin 1 1
445plot2d sonoffovoff0 (n/8192)*250+1250 val n>0 "blue cpts notit nsta"
446plot2d sonoffovoff1 (n/8192)*250+1250 val n>0 "red same cpts notit nsta"
447settitle "Raw (ON-OFF)/OFF  ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt
448setaxelabels "Freq. (MHz)" "I (a.u)" $axedefatt
449
450
451
452graphicatt "xylimits=1250,1500,-0.01,0.01"
453del snocal0 snocal1
454objaoper meanNoCalib row 0 snocal0
455objaoper meanNoCalib row 1 snocal1
456newwin 1 1
457plot2d snocal0 (n/8192)*250+1250 val n>0 "blue cpts notit nsta"
458plot2d snocal1 (n/8192)*250+1250 val n>0 "red same cpts notit nsta"
459settitle "Raw ON-OFF  ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt
460setaxelabels "Freq. (MHz)" "I (a.u)" $axedefatt
461
462del sruncal0 sruncal1
463objaoper meanPerRunCalib row 0 sruncal0
464objaoper meanPerRunCalib row 1 sruncal1
465newwin 1 1
466plot2d sruncal0 (n/8192)*250+1250 val n>0 "blue cpts notit nsta"
467plot2d sruncal1 (n/8192)*250+1250 val n>0 "red same cpts notit nsta"
468settitle "ON-OFF Calib Run  ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt
469setaxelabels "Freq. (MHz)" "I (a.u)" $axedefatt
470
471newwin 1 1
472del scyclecal0 scyclecal1
473objaoper meanPerCycleCalib row 0 scyclecal0
474objaoper meanPerCycleCalib row 1 scyclecal1
475plot2d scyclecal0 (n/8192)*250+1250 val n>0 "blue cpts notit nsta"
476plot2d scyclecal1 (n/8192)*250+1250 val n>0 "red same cpts notit nsta"
477settitle "ON-OFF Calib Cycle  ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt
478setaxelabels "Freq. (MHz)" "I (a.u)" $axedefatt
479
480
481endscript
482
483
484
485
486#Main
487#use minuscule for source label
488
489
490
491
492openppf onoffsurvey_${source}-${ncycles}Cycles.ppf
493print onoffevol
494
495set defatt "font=helvetica,bold,20 fixedfonsize"
496set axedefatt  "font=helvetica,bold,30 fixedfonsize grid"
497
498set defatt ""
499set axedefatt  "grid"
500
501graphicatt ""
502setaxesatt "$axedefatt"
503
504
505#diffOnOff
506#evolAt1420Freq
507#evolAt1420SideFreq
508#IntAt1420
Note: See TracBrowser for help on using the repository browser.