set source $1 set ncycles $2 #set fcalib $3 #set f1420low $4 #set f1420high $5 set fcalib 1410 set f1420low 1420.2 set f1420high 1420.6 nbins1420 = floor((${f1420high}-${f1420low})/250*8192) echo $nbins1420 clearscript diffOnOff clearscript evolAt1420Freq clearscript evolAt1420SideFreq clearscript IntAt1420 clearscript sigmaRaw1420Side clearscript sigmaRaw1400a1420 clearscript evolAt1400a1420OffOn ############################################################################ defscript evolAtCalibFreq #Follow up of the intensity arround the Calib frequency in different calibration conditions # NO calibration # Calibration coeff. mean per Run # Calibration coeff. per cycles set fcalib $1 newwin 1 2 n/pl onoffevol.onoffRaw0%cycle ! ! "blue cpts notit nsta" settitle "Raw ON-OFF ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles " ' ' $defatt n/pl onoffevol.onoffRaw1%cycle ! ! "red cpts notit nsta" setaxelabels "cycle" "I[${fcalib}MHz/6.25MHz] Raw (a.u)" $axedefatt newwin 1 2 n/proj hRaw0 onoffevol.onoffRaw0 ! ! ! "blue cpts notit" settitle "Raw ON-OFF ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles " ' ' $defatt n/proj hRaw1 onoffevol.onoffRaw1 ! ! ! "red cpts notit" settitle "I[${fcalib}MHz/6.25MHz] Raw (a.u)" newwin 1 2 n/pl onoffevol.onoffRun0%cycle ! ! "blue cpts notit nsta" settitle "ON-OFF Calib Run ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt n/pl onoffevol.onoffRun1%cycle ! ! "red cpts notit nsta" setaxelabels "cycle" "I[${fcalib}MHz/6.25MHz] Run (a.u)" $axedefatt newwin 1 2 n/proj hRun0 onoffevol.onoffRun0 ! ! ! "blue cpts notit" settitle "ON-OFF Calib Run ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt n/proj hRun1 onoffevol.onoffRun1 ! ! ! "red cpts notit" settitle "I[${fcalib}MHz/6.25MHz] Run (a.u)" newwin 1 2 n/pl onoffevol.onoffCycle0%cycle ! ! "blue cpts notit nsta" settitle "ON-OFF Calib Cycle ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt n/pl onoffevol.onoffCycle1%cycle ! ! "red cpts notit nsta" setaxelabels "cycle" "I[${fcalib}MHz/6.25MHz] Cycle (a.u)" $axedefatt newwin 1 2 n/proj hCycle0 onoffevol.onoffCycle0 ! ! ! "blue cpts notit" settitle "ON-OFF Calib Cycle ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt n/proj hCycle1 onoffevol.onoffCycle1 ! ! ! "red cpts notit" settitle "I[${fcalib}MHz/6.25MHz] Cycle (a.u)" endscript ########################################### defscript evolAt1420Freq #Follow up of the intensity arround the [1420,1421]MHz frequency in different calibration conditions # NO calibration # Calibration coeff. mean per Run # Calibration coeff. per cycles graphicatt "xylimits=0,500,-0.01,0.01" newwin 1 2 n/pl onoffevol.onoffRaw01420%cycle ! ! "blue cpts notit nsta" settitle "Raw ON-OFF ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles " ' ' $defatt n/pl onoffevol.onoffRaw11420%cycle ! ! "red cpts notit nsta" setaxelabels "cycle" "I[${f1420low},${f1420high}]MHz Raw (a.u)" $axedefatt newwin 1 2 n/pl onoffevol.onoffRun01420%cycle ! ! "blue cpts notit nsta" settitle "ON-OFF Calib Run ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt n/pl onoffevol.onoffRun11420%cycle ! ! "red cpts notit nsta" setaxelabels "cycle" "I[${f1420low},${f1420high}]MHz Run (a.u)" $axedefatt newwin 1 2 n/pl onoffevol.onoffCycle01420%cycle ! ! "blue cpts notit nsta" settitle "ON-OFF Calib Cycle ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt n/pl onoffevol.onoffCycle11420%cycle ! ! "red cpts notit nsta" setaxelabels "cycle" "I[${f1420low},${f1420high}]MHz Cycle (a.u)" $axedefatt newh1d hSigmaRaw0 -0.01 0.01 25 newh1d hSigmaRaw1 -0.01 0.01 25 newh1d hSigmaRun0 -0.01 0.01 25 newh1d hSigmaRun1 -0.01 0.01 25 newh1d hSigmaCycl0 -0.01 0.01 25 newh1d hSigmaCycl1 -0.01 0.01 25 graphicatt "" newwin 1 1 n/proj hSigmaRaw0 onoffevol.onoffRaw01420 ! ! ! "blue cpts notit" n/proj hSigmaRaw1 onoffevol.onoffRaw11420 ! ! ! "same red cpts notit" settitle "Raw ON-OFF ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles " ' ' $defatt setaxelabels "(a.u)" "I[${f1420low},${f1420high}]MHz Raw" $axedefatt newwin 1 1 n/proj hSigmaRun0 onoffevol.onoffRun01420 ! ! ! "blue cpts notit" n/proj hSigmaRun1 onoffevol.onoffRun11420 ! ! ! "same red cpts notit" settitle "ON-OFF Calib Run ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt setaxelabels "(a.u)" "I[${f1420low},${f1420high}]MHz Run" $axedefatt newwin 1 1 n/proj hSigmaCycl0 onoffevol.onoffCycle01420 ! ! ! "blue cpts notit" n/proj hSigmaCycl1 onoffevol.onoffCycle11420 ! ! ! "same red cpts notit" settitle "ON-OFF Calib Cycle ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt setaxelabels "(a.u)" "I[${f1420low},${f1420high}]MHz Cycle" $axedefatt endscript ################################################## defscript sigmaRaw1420Side c++compile rebining c++link rebining.so dorebin #col 13 = onoffRaw01420side Ch 0 #col 14 = onoffRaw11420side Ch 1 ntcol2var onoffevol 13 linCh0All line2vec vecCh0All $linCh0All ntcol2var onoffevol 14 linCh1All line2vec vecCh1All $linCh1All #packing values only valid for 500 cycles... set packVal "1 10 25 50 100" set sigmaCh0 "" set errsigCh0 "" set sigmaCh1 "" set errsigCh1 "" foreach ipack ( $packVal ) #Packing per ipack del invec del outvec cp vecCh0All invec call dorebin $ipack mean0 = ${outvec.sum}/${outvec.size} sigma0 = sqrt(${outvec.sumsq}/${outvec.size}-${mean0}*${mean0}) errsig0 = ${sigma0}/sqrt(2*${outvec.size}) set sigmaCh0 "${sigmaCh0} ${sigma0}" set errsigCh0 "${errsigCh0} ${errsig0}" # del invec del outvec cp vecCh1All invec call dorebin $ipack mean1 = ${outvec.sum}/${outvec.size} sigma1 = sqrt(${outvec.sumsq}/${outvec.size}-${mean1}*${mean1}) errsig1 = ${sigma1}/sqrt(2*${outvec.size}) set sigmaCh1 "${sigmaCh1} ${sigma1}" set errsigCh1 "${errsigCh1} ${errsig1}" end newnt nt0 x y ey newnt nt1 x y ey set x0 ( $packVal ) set y0 ( $sigmaCh0 ) set ey0 ( $errsigCh0 ) set x1 ( $packVal ) set y1 ( $sigmaCh1 ) set ey1 ( $errsigCh1 ) for i 0:$#x0 line2nt nt0 $x0[i] $y0[i] $ey0[i] line2nt nt1 $x1[i] $y1[i] $ey1[i] end newwin 1 1 plot2de nt0 x y 0 ey 1 "blue marker=fcircle,9 notit nsta" plot2de nt1 x y 0 ey 1 "same red marker=fcircle,9 notit nsta" n = ${#x0}-1 func $y0[0]/sqrt(x) $x0[0] $x0[n] 100 "same" settitle "Sigma [1418,1419]U[1422,1423]MHz ${source} Ch 0 (blue) Ch 1 (red)" ' ' $defatt setaxelabels "num of cycles" "Sigma (a.u)" $axedefatt endscript ################################################## defscript sigmaRaw1400a1420 c++compile rebining c++link rebining.so dorebin #col 19 = onoffRaw0f14001420 Ch 0 #col 20 = onoffRaw1f14001420 Ch 1 ntcol2var onoffevol 19 linCh0All line2vec vecCh0All $linCh0All ntcol2var onoffevol 20 linCh1All line2vec vecCh1All $linCh1All #packing values only valid for 500 cycles... set packVal "1 10 25 50 100" set sigmaCh0 "" set errsigCh0 "" set sigmaCh1 "" set errsigCh1 "" foreach ipack ( $packVal ) #Packing per ipack del invec del outvec cp vecCh0All invec call dorebin $ipack mean0 = ${outvec.sum}/${outvec.size} sigma0 = sqrt(${outvec.sumsq}/${outvec.size}-${mean0}*${mean0}) errsig0 = ${sigma0}/sqrt(2*${outvec.size}) set sigmaCh0 "${sigmaCh0} ${sigma0}" set errsigCh0 "${errsigCh0} ${errsig0}" # del invec del outvec cp vecCh1All invec call dorebin $ipack mean1 = ${outvec.sum}/${outvec.size} sigma1 = sqrt(${outvec.sumsq}/${outvec.size}-${mean1}*${mean1}) errsig1 = ${sigma1}/sqrt(2*${outvec.size}) set sigmaCh1 "${sigmaCh1} ${sigma1}" set errsigCh1 "${errsigCh1} ${errsig1}" end newnt nt0 x y ey newnt nt1 x y ey set x0 ( $packVal ) set y0 ( $sigmaCh0 ) set ey0 ( $errsigCh0 ) set x1 ( $packVal ) set y1 ( $sigmaCh1 ) set ey1 ( $errsigCh1 ) for i 0:$#x0 line2nt nt0 $x0[i] $y0[i] $ey0[i] line2nt nt1 $x1[i] $y1[i] $ey1[i] end newwin 1 1 plot2de nt0 x y 0 ey 1 "blue marker=fcircle,9 notit nsta" plot2de nt1 x y 0 ey 1 "same red marker=fcircle,9 notit nsta" n = ${#x0}-1 func $y0[0]/sqrt(x) $x0[0] $x0[n] 100 "same" settitle "Sigma [1400,1420]MHz ${source} Ch 0 (blue) Ch 1 (red)" ' ' $defatt setaxelabels "num of cycles" "Sigma (a.u)" $axedefatt endscript ########################################### defscript evolAt1400a1420OffOn graphicatt "xylimits=0,500,0.99,1.02" newwin 1 1 n/pl onoffevol.offRaw0f14001420%cycle ! ! "blue cpts notit nsta" n/pl onoffevol.offRaw1f14001420%cycle ! ! "same red cpts notit nsta" n/pl onoffevol.onRaw0f14001420%cycle ! ! "same cyan cpts notit nsta" n/pl onoffevol.onRaw1f14001420%cycle ! ! "same orange cpts notit nsta" settitle "Raw (OFF,ON)/OFF ${source} Ch 0 (blue/cyan) Ch 1 (red/orange) ${ncycles}cycles " ' ' $defatt setaxelabels "cycle" "I[1400,1420]MHz Raw (a.u)" $axedefatt endscript ########################################### defscript evolAt1420SideFreq #Follow up of the intensity arround the [${f1420low},${f1420high}]MHz frequency in different calibration conditions # NO calibration # Calibration coeff. mean per Run # Calibration coeff. per cycles graphicatt "xylimits=0,500,-0.01,0.01" newwin 1 2 n/pl onoffevol.onoffRaw01420side%cycle ! ! "blue cpts notit nsta" settitle "Raw ON-OFF ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles " ' ' $defatt n/pl onoffevol.onoffRaw11420side%cycle ! ! "red cpts notit nsta" setaxelabels "cycle" "I[1418,1419]U[1422,1423]MHz Raw (a.u)" $axedefatt newwin 1 2 n/pl onoffevol.onoffRun01420side%cycle ! ! "blue cpts notit nsta" settitle "ON-OFF Calib Run ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt n/pl onoffevol.onoffRun11420side%cycle ! ! "red cpts notit nsta" setaxelabels "cycle" "I[1418,1419]U[1422,1423]MHz Run (a.u)" $axedefatt newwin 1 2 n/pl onoffevol.onoffCycle01420side%cycle ! ! "blue cpts notit nsta" settitle "ON-OFF Calib Cycle ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt n/pl onoffevol.onoffCycle11420side%cycle ! ! "red cpts notit nsta" setaxelabels "cycle" "I[1418,1419]U[1422,1423]MHz Cycle (a.u)" $axedefatt newh1d hSigmaSideRaw0 -0.01 0.01 25 newh1d hSigmaSideRaw1 -0.01 0.01 25 newh1d hSigmaSideRun0 -0.01 0.01 25 newh1d hSigmaSideRun1 -0.01 0.01 25 newh1d hSigmaSideCycl0 -0.01 0.01 25 newh1d hSigmaSideCycl1 -0.01 0.01 25 graphicatt "" newwin 1 1 n/proj hSigmaSideRaw0 onoffevol.onoffRaw01420side ! ! ! "blue cpts notit" n/proj hSigmaSideRaw1 onoffevol.onoffRaw11420side ! ! ! "same red cpts notit" settitle "Raw ON-OFF ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles " ' ' $defatt setaxelabels "(a.u)" "I[1418,1419]U[1422,1423]MHz Raw" $axedefatt newwin 1 1 n/proj hSigmaSideRun0 onoffevol.onoffRun01420side ! ! ! "blue cpts notit" n/proj hSigmaSideRun1 onoffevol.onoffRun11420side ! ! ! "same red cpts notit" settitle "ON-OFF Calib Run ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt setaxelabels "(a.u)" "I[1418,1419]U[1422,1423]MHz Run" $axedefatt newwin 1 1 n/proj hSigmaSideCycl0 onoffevol.onoffCycle01420side ! ! ! "blue cpts notit" n/proj hSigmaSideCycl1 onoffevol.onoffCycle11420side ! ! ! "same red cpts notit" settitle "ON-OFF Calib Cycle ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt setaxelabels "(a.u)" "I[1418,1419]U[1422,1423]MHz Cycle" $axedefatt endscript ########################################### defscript IntAt1420 #Follow up of the intensity arround the [${f1420low},${f1420high}]MHz #frequency in different calibration conditions with baseline removed # NO calibration # Calibration coeff. mean per Run # Calibration coeff. per cycles graphicatt "xylimits=0,500,-0.1,0.1" newwin 1 2 n/pl onoffevol.${nbins1420}*(onoffRaw01420-onoffRaw01420side)%cycle ! ! "blue cpts notit nsta" settitle "Raw ON-OFF ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles " ' ' $defatt n/pl onoffevol.${nbins1420}*(onoffRaw11420-onoffRaw11420side)%cycle ! ! "red cpts notit nsta" setaxelabels "cycle" "I 1420MHz Raw (a.u)" $axedefatt newwin 1 2 n/pl onoffevol.${nbins1420}*(onoffRun01420-onoffRun01420side)%cycle ! ! "blue cpts notit nsta" settitle "ON-OFF Calib Run ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt n/pl onoffevol.${nbins1420}*(onoffRun11420-onoffRun11420side)%cycle ! ! "red cpts notit nsta" setaxelabels "cycle" "I 1420MHz Run (a.u)" $axedefatt newwin 1 2 n/pl onoffevol.${nbins1420}*(onoffCycle01420-onoffCycle01420side)%cycle ! ! "blue cpts notit nsta" settitle "ON-OFF Calib Cycle ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt n/pl onoffevol.${nbins1420}*(onoffCycle11420-onoffCycle11420side)%cycle ! ! "red cpts notit nsta" setaxelabels "cycle" "I 1420MHz Cycle (a.u)" $axedefatt newh1d h1420IntRaw0 -0.1 0.1 25 newh1d h1420IntRaw1 -0.1 0.1 25 newh1d h1420IntRun0 -0.1 0.1 25 newh1d h1420IntRun1 -0.1 0.1 25 newh1d h1420IntCycl0 -0.1 0.1 25 newh1d h1420IntCycl1 -0.1 0.1 25 graphicatt "" newwin 1 1 n/proj h1420IntRaw0 onoffevol.${nbins1420}*(onoffRaw01420-onoffRaw01420side) ! ! ! "blue cpts notit" n/proj h1420IntRaw1 onoffevol.${nbins1420}*(onoffRaw11420-onoffRaw11420side) ! ! ! "same red cpts notit" settitle "Raw ON-OFF ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles " ' ' $defatt setaxelabels "(a.u)" "I 1420MHz Raw" $axedefatt newwin 1 1 n/proj h1420IntRun0 onoffevol.${nbins1420}*(onoffRun01420-onoffRun01420side) ! ! ! "blue cpts notit" n/proj h1420IntRun1 onoffevol.${nbins1420}*(onoffRun11420-onoffRun11420side) ! ! ! "same red cpts notit" settitle "ON-OFF Calib Run ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt setaxelabels "(a.u)" "I 1420MHz Run" $axedefatt newwin 1 1 n/proj h1420IntCycl0 onoffevol.${nbins1420}*(onoffCycle01420-onoffCycle01420side) ! ! ! "blue cpts notit" n/proj h1420IntCycl1 onoffevol.${nbins1420}*(onoffCycle11420-onoffCycle11420side) ! ! ! "same red cpts notit" settitle "ON-OFF Calib Cycle ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt setaxelabels "(a.u)" "I 1420MHz Cycle" $axedefatt endscript ################################################## defscript diffOnOff # #Display the ON-OFF over the whole freq. range in diffrent Calib. conditions # NO calibration # Calibration coeff. mean per Run # Calibration coeff. per cycles # graphicatt "" del sonovoff0 sonovoff1 objaoper meanOnovOffNoCalib row 0 sonovoff0 objaoper meanOnovOffNoCalib row 1 sonovoff1 del soffovoff0 soffovoff1 objaoper meanOffovOffNoCalib row 0 soffovoff0 objaoper meanOffovOffNoCalib row 1 soffovoff1 newwin 1 2 plot2d sonovoff0 (n/8192)*250+1250 val n>0 "blue cpts notit nsta" plot2d sonovoff1 (n/8192)*250+1250 val n>0 "same red cpts notit nsta" settitle "Raw ON/OFF ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt setaxelabels "Freq. (MHz)" "I (a.u)" $axedefatt plot2d soffovoff0 (n/8192)*250+1250 val n>0 "blue cpts notit nsta" plot2d soffovoff1 (n/8192)*250+1250 val n>0 "same red cpts notit nsta" settitle "Raw OFF/OFF ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt setaxelabels "Freq. (MHz)" "I (a.u)" $axedefatt graphicatt "xylimits=1250,1500,-0.01,0.01" del sonoffovoff0 sonoffovoff1 objaoper meanOvOffNoCalib row 0 sonoffovoff0 objaoper meanOvOffNoCalib row 1 sonoffovoff1 newwin 1 1 plot2d sonoffovoff0 (n/8192)*250+1250 val n>0 "blue cpts notit nsta" plot2d sonoffovoff1 (n/8192)*250+1250 val n>0 "red same cpts notit nsta" settitle "Raw (ON-OFF)/OFF ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt setaxelabels "Freq. (MHz)" "I (a.u)" $axedefatt graphicatt "xylimits=1250,1500,-0.01,0.01" del snocal0 snocal1 objaoper meanNoCalib row 0 snocal0 objaoper meanNoCalib row 1 snocal1 newwin 1 1 plot2d snocal0 (n/8192)*250+1250 val n>0 "blue cpts notit nsta" plot2d snocal1 (n/8192)*250+1250 val n>0 "red same cpts notit nsta" settitle "Raw ON-OFF ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt setaxelabels "Freq. (MHz)" "I (a.u)" $axedefatt del sruncal0 sruncal1 objaoper meanPerRunCalib row 0 sruncal0 objaoper meanPerRunCalib row 1 sruncal1 newwin 1 1 plot2d sruncal0 (n/8192)*250+1250 val n>0 "blue cpts notit nsta" plot2d sruncal1 (n/8192)*250+1250 val n>0 "red same cpts notit nsta" settitle "ON-OFF Calib Run ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt setaxelabels "Freq. (MHz)" "I (a.u)" $axedefatt newwin 1 1 del scyclecal0 scyclecal1 objaoper meanPerCycleCalib row 0 scyclecal0 objaoper meanPerCycleCalib row 1 scyclecal1 plot2d scyclecal0 (n/8192)*250+1250 val n>0 "blue cpts notit nsta" plot2d scyclecal1 (n/8192)*250+1250 val n>0 "red same cpts notit nsta" settitle "ON-OFF Calib Cycle ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt setaxelabels "Freq. (MHz)" "I (a.u)" $axedefatt endscript #Main #use minuscule for source label openppf onoffsurvey_${source}-${ncycles}Cycles.ppf print onoffevol set defatt "font=helvetica,bold,20 fixedfonsize" set axedefatt "font=helvetica,bold,30 fixedfonsize grid" set defatt "" set axedefatt "grid" graphicatt "" setaxesatt "$axedefatt" #diffOnOff #evolAt1420Freq #evolAt1420SideFreq #IntAt1420