source: BAORadio/AmasNancay/trunk/mergeRawOnOff.pic @ 556

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

generalise the process to download the files for final analysis (jec)

File size: 3.1 KB
Line 
1defscript sumSpec
2
3set source "Abell${1}"
4set srclower "abell${1}"
5set date $2
6# implicitement firstcycle =1
7set lastcycle $3
8lastP1cycle = ${lastcycle}+1
9
10openppf ${toppath}/${source}/${date}${srclower}/diffOnOffRaw_${date}_${srclower}.ppf
11
12#specONOFFRaw<i>       Matrix 2 x 8192 : i=0...
13
14for ic 1:${lastP1cycle}
15    del sOnOffv0
16    del sOnOffv1
17    objaoper specONOFFRaw${ic} row 0 sOnOffv0   
18    objaoper specONOFFRaw${ic} row 1 sOnOffv1   
19    c++exec specONOFFv0+=sOnOffv0; specONOFFv1+=sOnOffv1;
20end
21
22
23endscript
24
25
26########################################################################
27#MAIN
28########################################################################
29set cols ( blue red black green purple orange cyan violet yellow )
30
31set toppath "."
32set source "Abell${1}"
33set srclower "abell${1}"
34
35#The output spectra
36#newvec specONOFFv0 8192
37#newvec specONOFFv1 8192
38
39c++exec TVector<r_4> specONOFFv0(8192,2); TVector<r_4> specONOFFv1(8192,2); \
40        KeepObj(specONOFFv0);KeepObj(specONOFFv1);
41
42#set the runs to merge
43
44set dateTag ( 20110507 20110602 20110729 20110806 )
45set nCycles ( 24 14 27 26 )
46line2vec tmpvec $nCycles
47
48#do It
49for i 0:${tmpvec.size}
50  sumSpec 85 $dateTag[i] $nCycles[i]
51end
52c++exec specONOFFv0/=tmpvec.Sum(); specONOFFv1/=tmpvec.Sum();
53
54
55#########
56newwin 1 1
57graphicatt "xylimits=1250,1500,-0.01,0.01"
58plot2d   specONOFFv0    (n/8192)*250+1250 val n>0 "same blue cpts nsta notit"
59plot2d   specONOFFv1    (n/8192)*250+1250 val n>0 "same red cpts nsta notit"
60settitle "ON-OFF  ${source} Ch 0 (blue) Ch 1 (red) ${tmpvec.sum} cycles"
61setaxelabels "Freq. (MHz)" "I (a.u)"
62
63#########
64#Perform the frequancy rebinning to compute MEAN & SIGMA
65#########
66c++compile reducing       
67c++link reducing.so doreduc
68
69cp specONOFFv0 specv0
70cp specONOFFv1 specv1
71call doreduc
72
73newwin 1 1
74graphicatt "xylimits=1250,1500,-0.01,0.01"
75 del redMeanv0                                                                     
76 del redMeanv1                                                                     
77 objaoper reducedMeanDiffOnOff row 0 redMeanv0                                     
78 objaoper reducedMeanDiffOnOff row 1 redMeanv1                                     
79 plot2d redMeanv0 (n/32)*250+1250 val n>0 "blue marker=fcircle,7 nsta notit"       
80 plot2d redMeanv1 (n/32)*250+1250 val n>0 "same red marker=fcircle,7 nsta notit"
81settitle "ON-OFF  ${source} Ch 0 (blue) Ch 1 (red) ${tmpvec.sum} cycles"
82setaxelabels "Freq. (MHz)" "I (a.u)"
83
84newwin 1 1
85graphicatt "xylimits=1250,1500,0,0.001"
86 del redSigmav0                                                                     
87 del redSigmav1                                                                     
88 objaoper reducedSigmaDiffOnOff row 0 redSigmav0                                     
89 objaoper reducedSigmaDiffOnOff row 1 redSigmav1                                     
90 plot2d redSigmav0 (n/32)*250+1250 val n>0 "blue marker=fcircle,7 nsta notit"       
91 plot2d redSigmav1 (n/32)*250+1250 val n>0 "same red marker=fcircle,7 nsta notit"
92settitle "ON-OFF  ${source} Ch 0 (blue) Ch 1 (red) ${tmpvec.sum} cycles"
93setaxelabels "Freq. (MHz)" "I (a.u)"
Note: See TracBrowser for help on using the repository browser.