[536] | 1 | defscript sumSpec |
---|
| 2 | |
---|
| 3 | set source "Abell${1}" |
---|
| 4 | set srclower "abell${1}" |
---|
| 5 | set date $2 |
---|
| 6 | # implicitement firstcycle =1 |
---|
| 7 | set lastcycle $3 |
---|
| 8 | lastP1cycle = ${lastcycle}+1 |
---|
| 9 | |
---|
| 10 | openppf ${toppath}/${source}/${date}${srclower}/diffOnOffRaw_${date}_${srclower}.ppf |
---|
| 11 | |
---|
| 12 | #specONOFFRaw<i> Matrix 2 x 8192 : i=0... |
---|
| 13 | |
---|
| 14 | for 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; |
---|
| 20 | end |
---|
| 21 | |
---|
| 22 | |
---|
| 23 | endscript |
---|
| 24 | |
---|
| 25 | |
---|
| 26 | ######################################################################## |
---|
| 27 | #MAIN |
---|
| 28 | ######################################################################## |
---|
| 29 | set cols ( blue red black green purple orange cyan violet yellow ) |
---|
| 30 | |
---|
[554] | 31 | set toppath "." |
---|
[536] | 32 | set source "Abell${1}" |
---|
| 33 | set srclower "abell${1}" |
---|
| 34 | |
---|
| 35 | #The output spectra |
---|
| 36 | #newvec specONOFFv0 8192 |
---|
| 37 | #newvec specONOFFv1 8192 |
---|
| 38 | |
---|
| 39 | c++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 | |
---|
| 44 | set dateTag ( 20110507 20110602 20110729 20110806 ) |
---|
| 45 | set nCycles ( 24 14 27 26 ) |
---|
| 46 | line2vec tmpvec $nCycles |
---|
| 47 | |
---|
| 48 | #do It |
---|
| 49 | for i 0:${tmpvec.size} |
---|
| 50 | sumSpec 85 $dateTag[i] $nCycles[i] |
---|
| 51 | end |
---|
| 52 | c++exec specONOFFv0/=tmpvec.Sum(); specONOFFv1/=tmpvec.Sum(); |
---|
| 53 | |
---|
| 54 | |
---|
| 55 | ######### |
---|
| 56 | newwin 1 1 |
---|
| 57 | graphicatt "xylimits=1250,1500,-0.01,0.01" |
---|
| 58 | plot2d specONOFFv0 (n/8192)*250+1250 val n>0 "same blue cpts nsta notit" |
---|
| 59 | plot2d specONOFFv1 (n/8192)*250+1250 val n>0 "same red cpts nsta notit" |
---|
| 60 | settitle "ON-OFF ${source} Ch 0 (blue) Ch 1 (red) ${tmpvec.sum} cycles" |
---|
| 61 | setaxelabels "Freq. (MHz)" "I (a.u)" |
---|
| 62 | |
---|
| 63 | ######### |
---|
| 64 | #Perform the frequancy rebinning to compute MEAN & SIGMA |
---|
| 65 | ######### |
---|
| 66 | c++compile reducing |
---|
| 67 | c++link reducing.so doreduc |
---|
| 68 | |
---|
[556] | 69 | cp specONOFFv0 specv0 |
---|
| 70 | cp specONOFFv1 specv1 |
---|
[536] | 71 | call doreduc |
---|
| 72 | |
---|
| 73 | newwin 1 1 |
---|
| 74 | graphicatt "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" |
---|
| 81 | settitle "ON-OFF ${source} Ch 0 (blue) Ch 1 (red) ${tmpvec.sum} cycles" |
---|
| 82 | setaxelabels "Freq. (MHz)" "I (a.u)" |
---|
| 83 | |
---|
| 84 | newwin 1 1 |
---|
| 85 | graphicatt "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" |
---|
| 92 | settitle "ON-OFF ${source} Ch 0 (blue) Ch 1 (red) ${tmpvec.sum} cycles" |
---|
| 93 | setaxelabels "Freq. (MHz)" "I (a.u)" |
---|