[550] | 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 |
---|
[552] | 8 | set action $4 |
---|
| 9 | |
---|
| 10 | set defatt "font=helvetica,bold,20" |
---|
| 11 | |
---|
| 12 | |
---|
| 13 | |
---|
| 14 | if ( ${action} == "mean" ) then |
---|
| 15 | |
---|
[550] | 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 |
---|
[552] | 23 | graphicatt "${defatt} xylimits=1250,1500,-0.01,0.01" |
---|
[550] | 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" |
---|
[552] | 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 |
---|
[550] | 29 | |
---|
| 30 | |
---|
[552] | 31 | |
---|
[550] | 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" |
---|
[552] | 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 |
---|
[550] | 41 | |
---|
[552] | 42 | |
---|
[550] | 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" |
---|
[552] | 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 |
---|
[550] | 52 | |
---|
[556] | 53 | ###### |
---|
[552] | 54 | else |
---|
[556] | 55 | ###### |
---|
[550] | 56 | |
---|
[552] | 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 |
---|
[553] | 94 | |
---|
| 95 | |
---|
| 96 | ##Normalized General Median |
---|
[556] | 97 | del ngms0 ngms1 |
---|
| 98 | objaoper medianNorm row 0 ngms0 |
---|
| 99 | objaoper medianNorm row 1 ngms1 |
---|
[553] | 100 | graphicatt "xylimits=1250,1500,-2,2" |
---|
| 101 | newwin 1 1 |
---|
[556] | 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" |
---|
[553] | 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 | |
---|
[556] | 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 |
---|
[552] | 113 | |
---|
| 114 | |
---|
| 115 | endif |
---|
| 116 | |
---|