defscript sumSpec set source "Abell${1}" set srclower "abell${1}" set date $2 # implicitement firstcycle =1 set lastcycle $3 lastP1cycle = ${lastcycle}+1 openppf ${toppath}/${source}/${date}${srclower}/diffOnOffRaw_${date}_${srclower}.ppf #specONOFFRaw Matrix 2 x 8192 : i=0... for ic 1:${lastP1cycle} del sOnOffv0 del sOnOffv1 objaoper specONOFFRaw${ic} row 0 sOnOffv0 objaoper specONOFFRaw${ic} row 1 sOnOffv1 c++exec specONOFFv0+=sOnOffv0; specONOFFv1+=sOnOffv1; end endscript ######################################################################## #MAIN ######################################################################## set cols ( blue red black green purple orange cyan violet yellow ) set toppath "." set source "Abell${1}" set srclower "abell${1}" #The output spectra #newvec specONOFFv0 8192 #newvec specONOFFv1 8192 c++exec TVector specONOFFv0(8192,2); TVector specONOFFv1(8192,2); \ KeepObj(specONOFFv0);KeepObj(specONOFFv1); #set the runs to merge set dateTag ( 20110507 20110602 20110729 20110806 ) set nCycles ( 24 14 27 26 ) line2vec tmpvec $nCycles #do It for i 0:${tmpvec.size} sumSpec 85 $dateTag[i] $nCycles[i] end c++exec specONOFFv0/=tmpvec.Sum(); specONOFFv1/=tmpvec.Sum(); ######### newwin 1 1 graphicatt "xylimits=1250,1500,-0.01,0.01" plot2d specONOFFv0 (n/8192)*250+1250 val n>0 "same blue cpts nsta notit" plot2d specONOFFv1 (n/8192)*250+1250 val n>0 "same red cpts nsta notit" settitle "ON-OFF ${source} Ch 0 (blue) Ch 1 (red) ${tmpvec.sum} cycles" setaxelabels "Freq. (MHz)" "I (a.u)" ######### #Perform the frequancy rebinning to compute MEAN & SIGMA ######### c++compile reducing c++link reducing.so doreduc cp specONOFFv0 specv0 cp specONOFFv1 specv1 call doreduc newwin 1 1 graphicatt "xylimits=1250,1500,-0.01,0.01" del redMeanv0 del redMeanv1 objaoper reducedMeanDiffOnOff row 0 redMeanv0 objaoper reducedMeanDiffOnOff row 1 redMeanv1 plot2d redMeanv0 (n/32)*250+1250 val n>0 "blue marker=fcircle,7 nsta notit" plot2d redMeanv1 (n/32)*250+1250 val n>0 "same red marker=fcircle,7 nsta notit" settitle "ON-OFF ${source} Ch 0 (blue) Ch 1 (red) ${tmpvec.sum} cycles" setaxelabels "Freq. (MHz)" "I (a.u)" newwin 1 1 graphicatt "xylimits=1250,1500,0,0.001" del redSigmav0 del redSigmav1 objaoper reducedSigmaDiffOnOff row 0 redSigmav0 objaoper reducedSigmaDiffOnOff row 1 redSigmav1 plot2d redSigmav0 (n/32)*250+1250 val n>0 "blue marker=fcircle,7 nsta notit" plot2d redSigmav1 (n/32)*250+1250 val n>0 "same red marker=fcircle,7 nsta notit" settitle "ON-OFF ${source} Ch 0 (blue) Ch 1 (red) ${tmpvec.sum} cycles" setaxelabels "Freq. (MHz)" "I (a.u)"