| 1 | #$1: source
 | 
|---|
| 2 | #$2: nber of cycles
 | 
|---|
| 3 | #$3: number of freq. combined for reducing mean/sigma
 | 
|---|
| 4 | 
 | 
|---|
| 5 | set source $1
 | 
|---|
| 6 | set ncycles $2
 | 
|---|
| 7 | set nFreqBin $3
 | 
|---|
| 8 | set action $4
 | 
|---|
| 9 | 
 | 
|---|
| 10 | set defatt "font=helvetica,bold,20 fixedfontsize"
 | 
|---|
| 11 | 
 | 
|---|
| 12 | 
 | 
|---|
| 13 | 
 | 
|---|
| 14 | if ( ${action} == "mean" ) then
 | 
|---|
| 15 | 
 | 
|---|
| 16 | openppf meanDiffOnOffRaw_${source}-${ncycles}Cycles.ppf
 | 
|---|
| 17 | 
 | 
|---|
| 18 | 
 | 
|---|
| 19 | ##General Mean
 | 
|---|
| 20 | del s0 s1
 | 
|---|
| 21 | objaoper mean row 0 s0
 | 
|---|
| 22 | objaoper mean row 1 s1
 | 
|---|
| 23 | graphicatt "${defatt} xylimits=1250,1500,-0.01,0.01"
 | 
|---|
| 24 | newwin 1 1
 | 
|---|
| 25 | plot2d s0 (n/8192)*250+1250 val n>0 "cpts blue nsta notit"
 | 
|---|
| 26 | plot2d s1 (n/8192)*250+1250 val n>0 "same cpts red nsta notit"
 | 
|---|
| 27 | settitle "$source (${ncycles} cycles) Ch 0 (blue) Ch 1 (red)" ' ' $defatt
 | 
|---|
| 28 | setaxelabels "Freq. (MHz)" "<(ON-OFF)[r,c]/Gain[r]>_{r,c}" $defatt
 | 
|---|
| 29 | 
 | 
|---|
| 30 | 
 | 
|---|
| 31 | 
 | 
|---|
| 32 | ##Reduced Mean
 | 
|---|
| 33 | newwin 1 1
 | 
|---|
| 34 | del rs0 rs1
 | 
|---|
| 35 | objaoper meanred row 0 rs0
 | 
|---|
| 36 | objaoper meanred row 1 rs1
 | 
|---|
| 37 | plot2d rs0 (n/${nFreqBin})*250+1250 val n>0 "marker=fcircle,5 blue nsta notit"
 | 
|---|
| 38 | plot2d rs1 (n/${nFreqBin})*250+1250 val n>0 "same marker=fcircle,5 red nsta notit"
 | 
|---|
| 39 | settitle "$source (${ncycles} cycles) Ch 0 (blue) Ch 1 (red)" ' ' $defatt
 | 
|---|
| 40 | setaxelabels "Freq. (MHz)" "<(ON-OFF)[r,c]/Gain[r]>_{r,c} Rebin(${nFreqBin})" $defatt
 | 
|---|
| 41 | 
 | 
|---|
| 42 | 
 | 
|---|
| 43 | ##Reduced Mean
 | 
|---|
| 44 | newwin 1 1
 | 
|---|
| 45 | del rss0 rss1
 | 
|---|
| 46 | objaoper sigmared row 0 rss0
 | 
|---|
| 47 | objaoper sigmared row 1 rss1
 | 
|---|
| 48 | plot2d rss0 (n/${nFreqBin})*250+1250 val n>0 "marker=fcircle,5 blue nsta notit"
 | 
|---|
| 49 | plot2d rss1 (n/${nFreqBin})*250+1250 val n>0 "same marker=fcircle,5 red nsta notit"
 | 
|---|
| 50 | settitle "$source (${ncycles} cycles) Ch 0 (blue) Ch 1 (red)" ' ' $defatt 
 | 
|---|
| 51 | setaxelabels "Freq. (MHz)" "Sigma[(ON-OFF)[r,c]/Gain[r]] Rebin(${nFreqBin})" $defatt
 | 
|---|
| 52 | 
 | 
|---|
| 53 | ######
 | 
|---|
| 54 | else
 | 
|---|
| 55 | ######
 | 
|---|
| 56 | 
 | 
|---|
| 57 | openppf medianDiffOnOffRaw_${source}-${ncycles}Cycles.ppf
 | 
|---|
| 58 | 
 | 
|---|
| 59 | 
 | 
|---|
| 60 | ##General Median
 | 
|---|
| 61 | del s0 s1
 | 
|---|
| 62 | objaoper median row 0 s0
 | 
|---|
| 63 | objaoper median row 1 s1
 | 
|---|
| 64 | graphicatt "xylimits=1250,1500,-0.01,0.01"
 | 
|---|
| 65 | newwin 1 1
 | 
|---|
| 66 | plot2d s0 (n/8192)*250+1250 val n>0 "cpts blue nsta notit"
 | 
|---|
| 67 | plot2d s1 (n/8192)*250+1250 val n>0 "same cpts red nsta notit"
 | 
|---|
| 68 | settitle "$source (${ncycles} cycles) Ch 0 (blue) Ch 1 (red)" ' ' $defatt
 | 
|---|
| 69 | setaxelabels "Freq. (MHz)" "Median[(ON-OFF)[r,c]/Gain[r]]"  $defatt
 | 
|---|
| 70 | 
 | 
|---|
| 71 | 
 | 
|---|
| 72 | ##Reduced Mean of the median
 | 
|---|
| 73 | newwin 1 1
 | 
|---|
| 74 | del rs0 rs1
 | 
|---|
| 75 | objaoper meanmedred row 0 rs0
 | 
|---|
| 76 | objaoper meanmedred row 1 rs1
 | 
|---|
| 77 | graphicatt "xylimits=1250,1500,-0.01,0.01"
 | 
|---|
| 78 | plot2d rs0 (n/${nFreqBin})*250+1250 val n>0 "marker=fcircle,5 blue nsta notit"
 | 
|---|
| 79 | plot2d rs1 (n/${nFreqBin})*250+1250 val n>0 "same marker=fcircle,5 red nsta notit"
 | 
|---|
| 80 | settitle "$source (${ncycles} cycles) Ch 0 (blue) Ch 1 (red)" ' ' $defatt
 | 
|---|
| 81 | setaxelabels "Freq. (MHz)" "Mean Median[(ON-OFF)[r,c]/Gain[r]] Rebin(${nFreqBin})" $defatt
 | 
|---|
| 82 | 
 | 
|---|
| 83 | 
 | 
|---|
| 84 | ##Reduced Sigma of the median
 | 
|---|
| 85 | newwin 1 1
 | 
|---|
| 86 | del rss0 rss1
 | 
|---|
| 87 | objaoper sigmamedred row 0 rss0
 | 
|---|
| 88 | objaoper sigmamedred row 1 rss1
 | 
|---|
| 89 | graphicatt "xylimits=1250,1500,0,0.01"
 | 
|---|
| 90 | plot2d rss0 (n/${nFreqBin})*250+1250 val n>0 "marker=fcircle,5 blue nsta notit"
 | 
|---|
| 91 | plot2d rss1 (n/${nFreqBin})*250+1250 val n>0 "same marker=fcircle,5 red nsta notit"
 | 
|---|
| 92 | settitle "$source (${ncycles} cycles) Ch 0 (blue) Ch 1 (red)" ' ' $defatt
 | 
|---|
| 93 | setaxelabels "Freq. (MHz)" "Sigma Median[(ON-OFF)[r,c]/Gain[r]] Rebin(${nFreqBin})" $defatt
 | 
|---|
| 94 | 
 | 
|---|
| 95 | 
 | 
|---|
| 96 | ##Normalized General Median
 | 
|---|
| 97 | del ngms0 ngms1
 | 
|---|
| 98 | objaoper medianNorm row 0 ngms0
 | 
|---|
| 99 | objaoper medianNorm row 1 ngms1
 | 
|---|
| 100 | graphicatt "xylimits=1250,1500,-2,2"
 | 
|---|
| 101 | newwin 1 1
 | 
|---|
| 102 | plot2d ngms0 (n/8192)*250+1250 val n>0 "cpts blue nsta notit"
 | 
|---|
| 103 | plot2d ngms1 (n/8192)*250+1250 val n>0 "same cpts red nsta notit"
 | 
|---|
| 104 | settitle "$source (${ncycles} cycles) Ch 0 (blue) Ch 1 (red)" ' ' $defatt
 | 
|---|
| 105 | setaxelabels "Freq. (MHz)" "Norm Median[(ON-OFF)[r,c]/Gain[r]]"  $defatt
 | 
|---|
| 106 | 
 | 
|---|
| 107 | del prod
 | 
|---|
| 108 | c++exec TVector<r_4>prod(ngms0.NElts(),BaseArray::RowVector); prod=ngms0&&ngms1;KeepObj(prod);
 | 
|---|
| 109 | newwin 1 1
 | 
|---|
| 110 | plot2d prod (n/8192)*250+1250 val n>0 "cpts blue nsta notit"
 | 
|---|
| 111 | settitle "$source (${ncycles} cycles)" ' ' $defatt
 | 
|---|
| 112 | setaxelabels "Freq. (MHz)" "Product Norm Median[(ON-OFF)[r,c]/Gain[r]]"  $defatt
 | 
|---|
| 113 |  
 | 
|---|
| 114 | 
 | 
|---|
| 115 | endif
 | 
|---|
| 116 | 
 | 
|---|