echo ".... execute ON" exec analdata 20110416abell85 151300 On datacycle 1 echo ".... execute OFF" exec analdata 20110416abell85 151300 Off datacycle 1 echo ".... execute Merging" c++compile offset # #follow cycle to cycle variation of calibration coeff # vecfrascii calibOnCh0 20110416abell85-On-1346MHz-Ch0Cycles.txt vecfrascii calibOnCh1 20110416abell85-On-1346MHz-Ch1Cycles.txt vecfrascii calibOffCh0 20110416abell85-Off-1346MHz-Ch0Cycles.txt vecfrascii calibOffCh1 20110416abell85-Off-1346MHz-Ch1Cycles.txt del diff0 del diff1 set ncount 0 set first 1 for ic ${firstcycle}:${ncycles} echo "...... cycle $ic" ncount = $ncount + 1 k = ${ic} -1 del diffcycle${ic}v0 diffcycle${ic}v1 if ( $first == 1 ) then set first 0 c++exec \ TVector sigcalOnv0(sumc${ic}mOnv0,false); sigcalOnv0/=calibOnCh0[$k]; \ TVector sigcalOnv1(sumc${ic}mOnv1,false); sigcalOnv1/=calibOnCh1[$k]; \ TVector sigcalOffv0(sumc${ic}mOffv0,false); sigcalOffv0/=calibOffCh0[$k]; \ TVector sigcalOffv1(sumc${ic}mOffv1,false); sigcalOffv1/=calibOffCh1[$k]; \ TVector diffcycle${ic}v0 = sigcalOnv0-sigcalOffv0; \ TVector diffcycle${ic}v1 = sigcalOnv1-sigcalOffv1; \ TVector diff0(diffcycle${ic}v0,false); \ TVector diff1(diffcycle${ic}v1,false); \ KeepObj(diff0);KeepObj(diff1); \ KeepObj(diffcycle${ic}v0); KeepObj(diffcycle${ic}v1); else c++exec \ TVector sigcalOnv0(sumc${ic}mOnv0,false); sigcalOnv0/=calibOnCh0[$k]; \ TVector sigcalOnv1(sumc${ic}mOnv1,false); sigcalOnv1/=calibOnCh1[$k]; \ TVector sigcalOffv0(sumc${ic}mOffv0,false); sigcalOffv0/=calibOffCh0[$k]; \ TVector sigcalOffv1(sumc${ic}mOffv1,false); sigcalOffv1/=calibOffCh1[$k]; \ TVector diffcycle${ic}v0 = sigcalOnv0-sigcalOffv0; \ TVector diffcycle${ic}v1 = sigcalOnv1-sigcalOffv1; \ diff0+=diffcycle${ic}v0; \ diff1+=diffcycle${ic}v1; \ KeepObj(diffcycle${ic}v0); KeepObj(diffcycle${ic}v1); endif end newvec nmean 1 $ncount nodisp #coef RT @ 1346MHz Ouest - Est associees a Ch 0 et 1 set xcal ( 27.724 22.543 ) line2vec calib $xcal del difftot c++exec diff0/=nmean[0]; diff1/=nmean[0]; \ diff0*=calib[0];diff1*=calib[1]; \ TVector difftot(diff0,false);difftot+=diff1;difftot/=2.; \ KeepObj(difftot); # #Calibrate and Offset Correction # for ic ${firstcycle}:${ncycles} c++exec diffcycle${ic}v0*=calib[0];diffcycle${ic}v1*=calib[1]; end del modiff0 moddiff1 set first 1 for ic ${firstcycle}:${ncycles} echo "modif ...... cycle $ic" del inarr outarr modiffc${ic}v0 cp diffcycle${ic}v0 inarr c++link offset.so meanoffset call meanoffset 1285 1335 1355 1450 cp outarr modiffc${ic}v0 del inarr outarr modiffc${ic}v1 cp diffcycle${ic}v1 inarr c++link offset.so meanoffset call meanoffset 1285 1335 1355 1450 cp outarr modiffc${ic}v1 if ( $first == 1 ) then set first 0 c++exec \ TVector modiff0(modiffc${ic}v0,false); \ TVector modiff1(modiffc${ic}v1,false); \ KeepObj(modiff0);KeepObj(modiff1); else c++exec modiff0+=modiffc${ic}v0; modiff1+=modiffc${ic}v1; endif end newwin 1 1 setaxesatt $defatt graphicatt "$defatt xylimits=1250,1500,-1.,1." set first 1 for ic ${firstcycle}:${ncycles} echo "...... cycle $ic" k = ${ic}-floor(${ic}/${#cols})*${#cols} if ( $first == 1 ) then set first 0 plot2d diffcycle${ic}v0 (n/8192)*250+1250 val n>0 "$cols[k] cpts nsta notit" else plot2d diffcycle${ic}v0 (n/8192)*250+1250 val n>0 "same $cols[k] cpts nsta notit" endif end settitle "Diff. On-Off No Corr. $source Ch 0 cycles [$firstcycle,$lastcycle]" setaxelabels "Freq. (MHz)" "I (Jy)" newwin 1 1 setaxesatt $defatt graphicatt "$defatt xylimits=1250,1500,-1.,1." set first 1 for ic ${firstcycle}:${ncycles} echo "...... cycle $ic" k = ${ic}-floor(${ic}/${#cols})*${#cols} if ( $first == 1 ) then set first 0 plot2d diffcycle${ic}v1 (n/8192)*250+1250 val n>0 "$cols[k] cpts nsta notit" else plot2d diffcycle${ic}v1 (n/8192)*250+1250 val n>0 "same $cols[k] cpts nsta notit" endif end settitle "Diff. On-Off No Corr. $source Ch 1 cycles [$firstcycle,$lastcycle]" setaxelabels "Freq. (MHz)" "I (Jy)" newwin 1 1 setaxesatt $defatt graphicatt "$defatt xylimits=1250,1500,-50.,50." plot2d diff0 (n/8192)*250+1250 val*1000 n>0 "blue cpts nsta notit" plot2d diff1 (n/8192)*250+1250 val*1000 n>0 "red same cpts nsta notit" plot2d difftot (n/8192)*250+1250 val*1000 n>0 "black same cpts nsta notit" settitle "Mean diff calib No Corr. per cycle ON-OFF Int. $source cycles [$firstcycle,$lastcycle]" setaxelabels "Freq. (MHz)" "Int. (mJy)" newwin 1 1 graphicatt "$defatt" n/plot difftot.val*1000 n>1090&&n<4000 ! ! "black notit" n/plot diff0.val*1000 n>1090&&n<4000 ! ! "blue same notit" n/plot diff1.val*1000 n>1090&&n<4000 ! ! "red same notit" settitle "Diff ON-OFF No Corr. $source [$firstcycle,$lastcycle] 1280MHz - 1370MHz" setaxelabels "mJy" " " newwin 1 1 setaxesatt $defatt graphicatt "$defatt xylimits=1250,1500,-1.,1." set first 1 for ic ${firstcycle}:${ncycles} echo "...... cycle $ic" k = ${ic}-floor(${ic}/${#cols})*${#cols} if ( $first == 1 ) then set first 0 plot2d modiffc${ic}v0 (n/8192)*250+1250 val n>0 "$cols[k] cpts nsta notit" else plot2d modiffc${ic}v0 (n/8192)*250+1250 val n>0 "same $cols[k] cpts nsta notit" endif end settitle "Diff. On-Off With Corr. $source Ch 0 cycles [$firstcycle,$lastcycle]" setaxelabels "Freq. (MHz)" "I (Jy)" newwin 1 1 setaxesatt $defatt graphicatt "$defatt xylimits=1250,1500,-1.,1." set first 1 for ic ${firstcycle}:${ncycles} echo "...... cycle $ic" k = ${ic}-floor(${ic}/${#cols})*${#cols} if ( $first == 1 ) then set first 0 plot2d modiffc${ic}v1 (n/8192)*250+1250 val n>0 "$cols[k] cpts nsta notit" else plot2d modiffc${ic}v1 (n/8192)*250+1250 val n>0 "same $cols[k] cpts nsta notit" endif end settitle "Diff. On-Off With Corr. $source Ch 1 cycles [$firstcycle,$lastcycle]" setaxelabels "Freq. (MHz)" "I (Jy)" del modifftot c++exec modiff0/=nmean[0]; modiff1/=nmean[0]; \ TVector modifftot(modiff0,false);modifftot+=modiff1;modifftot/=2.; \ KeepObj(modifftot); newwin 1 1 setaxesatt $defatt" graphicatt "$defatt xylimits=1250,1500,-50.,50." plot2d modiff0 (n/8192)*250+1250 val*1000 n>0 "blue cpts nsta notit" plot2d modiff1 (n/8192)*250+1250 val*1000 n>0 "red same cpts nsta notit" plot2d modifftot (n/8192)*250+1250 val*1000 n>0 "black same cpts nsta notit" settitle "Mean diff ON-OFF With Corr. $source cycles [$firstcycle,$lastcycle]" setaxelabels "Freq. (MHz)" "Int. (mJy)" newwin 1 1 graphicatt "$defatt" n/plot modifftot.val*1000 n>1090&&n<4000 ! ! "black notit" n/plot modiff0.val*1000 n>1090&&n<4000 ! ! "blue same notit" n/plot modiff1.val*1000 n>1090&&n<4000 ! ! "red same notit" settitle "Diff ON-OFF With Corr. $source [$firstcycle,$lastcycle] 1280MHz - 1370MHz" setaxelabels "mJy" " " newwin 1 1 setaxesatt $defatt" graphicatt "$defatt xylimits=1250,1500,-50.,50." plot2d difftot (n/8192)*250+1250 val*1000 n>0 "blue cpts nsta notit" plot2d modifftot (n/8192)*250+1250 val*1000 n>0 "red same cpts nsta notit" settitle "Mean diff ON-OFF NO Corr (blue) With Corr (red) $source cycles [$firstcycle,$lastcycle]" setaxelabels "Freq. (MHz)" "Int. (mJy)"