| [611] | 1 | set user     "AST" | 
|---|
|  | 2 | set source   "Abell1205" | 
|---|
|  | 3 | set srclower "abell1205" | 
|---|
|  | 4 | set date     "20110415" | 
|---|
|  | 5 | set cycle    "8" | 
|---|
|  | 6 | set mode     "Off" | 
|---|
|  | 7 | set toppath  "/sps/baoradio/AmasNancay/${user}" | 
|---|
|  | 8 | set path     "${toppath}/${source}/dab" | 
|---|
|  | 9 | set ppf      "0" | 
|---|
|  | 10 |  | 
|---|
|  | 11 | # Read DAB calibration in Jansky (Voie E / PKS1127-14) | 
|---|
|  | 12 | #----------------------------------------------------- | 
|---|
|  | 13 | n/read nt_dabjy ${toppath}/DAB_Jy.dat " " dabfreq,0 dabjy,1 | 
|---|
|  | 14 | newwin 1 1 | 
|---|
|  | 15 | n/pl nt_dabjy.dabjy%dabfreq 1 ! "marker=star,4 magenta notit" | 
|---|
|  | 16 | settitle "DAB Voie E / PKS1127-14. Juin 2011" | 
|---|
|  | 17 |  | 
|---|
|  | 18 |  | 
|---|
|  | 19 | # Read DAB calibration in A.U. (from BAORadio data) | 
|---|
|  | 20 | #-------------------------------------------------- | 
|---|
|  | 21 | openppf ${path}/dabchrom_${date}_${srclower}_${mode}.ppf | 
|---|
|  | 22 | ls | 
|---|
|  | 23 |  | 
|---|
|  | 24 | ## Baseline | 
|---|
|  | 25 | del b0 b1 b0f b1f | 
|---|
|  | 26 | objaoper /home/base row 0 b0 | 
|---|
|  | 27 | objaoper /home/base row 1 b1 | 
|---|
|  | 28 | objaoper /home/basefilt row 0 b0f | 
|---|
|  | 29 | objaoper /home/basefilt row 1 b1f | 
|---|
|  | 30 |  | 
|---|
|  | 31 | ## First DAB | 
|---|
|  | 32 | del dab01 dab11 dab01f dab11f dab01n dab11n | 
|---|
|  | 33 | objaoper /home/firstdab row 0 dab01 | 
|---|
|  | 34 | objaoper /home/firstdab row 1 dab11 | 
|---|
|  | 35 | objaoper /home/firstdabfilt row 0 dab01f | 
|---|
|  | 36 | objaoper /home/firstdabfilt row 1 dab11f | 
|---|
|  | 37 | objaoper /home/firstdelta row 0 dab01d | 
|---|
|  | 38 | objaoper /home/firstdelta row 1 dab11d | 
|---|
|  | 39 |  | 
|---|
|  | 40 | ## Second DAB | 
|---|
|  | 41 | del dab02 dab12 dab02f dab12f dab02n dab12n | 
|---|
|  | 42 | objaoper /home/seconddab row 0 dab02 | 
|---|
|  | 43 | objaoper /home/seconddab row 1 dab12 | 
|---|
|  | 44 | objaoper /home/seconddabfilt row 0 dab02f | 
|---|
|  | 45 | objaoper /home/seconddabfilt row 1 dab12f | 
|---|
|  | 46 | objaoper /home/seconddelta row 0 dab02d | 
|---|
|  | 47 | objaoper /home/seconddelta row 1 dab12d | 
|---|
|  | 48 |  | 
|---|
|  | 49 | ## Mean(delta(first,second DAB)) per channel | 
|---|
| [630] | 50 | c++exec TVector<r_4> meandab0d(dab01d,false); KeepObj(meandab0d); \ | 
|---|
|  | 51 | TVector<r_4> meandab1d(dab11d,false); KeepObj(meandab1d); \ | 
|---|
|  | 52 | meandab0d+=dab02d; meandab0d/=2.; \ | 
|---|
|  | 53 | meandab1d+=dab12d; meandab1d/=2.; | 
|---|
| [611] | 54 |  | 
|---|
| [630] | 55 | ## Rebin BAO and calibrated data in 0.5Hz/bin to perform division | 
|---|
|  | 56 | exptovec vf nt_dabjy dabfreq | 
|---|
|  | 57 | exptovec vjy nt_dabjy dabjy | 
|---|
|  | 58 | c++exec TVector<r_4> dumm0(vf), dumm1(vjy);\ | 
|---|
|  | 59 | TVector<r_4> vcalfreq=dumm0.SubVector(Range(320,854)).TransposeSelf();\ | 
|---|
|  | 60 | KeepObj(vcalfreq);\ | 
|---|
|  | 61 | TVector<r_4> vcaljy=dumm1.SubVector(Range(320,854)).TransposeSelf();\ | 
|---|
|  | 62 | KeepObj(vcaljy); | 
|---|
|  | 63 |  | 
|---|
|  | 64 | del invec0 invec1 invec2 invec3 val0 val1 | 
|---|
|  | 65 | cp meandab0d invec0 | 
|---|
|  | 66 | cp meandab1d invec1 | 
|---|
|  | 67 | cp vcaljy invec2 | 
|---|
|  | 68 | cp vcalfreq invec3 | 
|---|
|  | 69 | ls | 
|---|
|  | 70 |  | 
|---|
|  | 71 | c++compile interpol | 
|---|
|  | 72 | c++link interpol.so dointerpol | 
|---|
|  | 73 | call dointerpol | 
|---|
|  | 74 |  | 
|---|
|  | 75 | c++exec TVector<r_8> calcoeff0f1400a1420=calcoeff0.SubVector(Range(300,340)); \ | 
|---|
|  | 76 | KeepObj(calcoeff0f1400a1420);\ | 
|---|
|  | 77 | TVector<r_8> calcoeff1f1400a1420=calcoeff1.SubVector(Range(300,340)); \ | 
|---|
|  | 78 | KeepObj(calcoeff1f1400a1420); | 
|---|
|  | 79 | projh1d h0 calcoeff0f1400a1420 val | 
|---|
|  | 80 | projh1d h1 calcoeff1f1400a1420 val | 
|---|
|  | 81 |  | 
|---|
| [611] | 82 | ## Save Mean(delta(first,second DAB)) per channel into a ppf file | 
|---|
|  | 83 | #if ( ppf == "1" ) then | 
|---|
|  | 84 | #  del daboff | 
|---|
|  | 85 | #  c++exec TMatrix<r_4> daboff(2,dab01.NElts()); KeepObj(daboff); \ | 
|---|
|  | 86 | #          daboff.Row(0)=meandab0d; daboff.Row(1)=meandab1d; | 
|---|
|  | 87 | #  saveppf daboff "${toppath}/${source}/daboff_${date}_${srclower}_calibcycle8.fits" | 
|---|
|  | 88 | #endif | 
|---|
|  | 89 |  | 
|---|
|  | 90 | # Plot results | 
|---|
|  | 91 | #-------------- | 
|---|
|  | 92 | graphicatt "xylimits=1250,1500,0,3" | 
|---|
|  | 93 |  | 
|---|
|  | 94 | ## Baseline | 
|---|
|  | 95 | newwin 1 1 | 
|---|
|  | 96 | plot2d b0 (n/8192)*250+1250 val n>0 "blue cpts nstat notit" | 
|---|
|  | 97 | plot2d b1 (n/8192)*250+1250 val n>0 "same red cpts nstat notit" | 
|---|
|  | 98 | settitle "Baseline raw $source $date $mode Ch0 blue Ch1 red" | 
|---|
|  | 99 |  | 
|---|
|  | 100 | newwin 1 1 | 
|---|
|  | 101 | plot2d b0f (n/8192)*250+1250 val n>0 "blue cpts nstat notit" | 
|---|
|  | 102 | plot2d b1f (n/8192)*250+1250 val n>0 "same red cpts nstat notit" | 
|---|
|  | 103 | settitle "Baseline filt $source $date $mode Ch0 blue Ch1 red" | 
|---|
|  | 104 |  | 
|---|
|  | 105 | ## First DAB | 
|---|
|  | 106 | #newwin 1 1 | 
|---|
|  | 107 | #plot2d dab01 (n/8192)*250+1250 val n>0 "blue cpts nstat notit" | 
|---|
|  | 108 | #plot2d dab11 (n/8192)*250+1250 val n>0 "same red cpts nstat notit" | 
|---|
|  | 109 | #settitle "First DAB raw $source $date $mode Ch0 blue Ch1 red" | 
|---|
|  | 110 |  | 
|---|
|  | 111 | newwin 1 1 | 
|---|
|  | 112 | plot2d dab01f (n/8192)*250+1250 val n>0 "blue cpts nstat notit" | 
|---|
|  | 113 | plot2d dab11f (n/8192)*250+1250 val n>0 "same red cpts nstat notit" | 
|---|
|  | 114 | settitle "First DAB filt $source $date $mode Ch0 blue Ch1 red" | 
|---|
|  | 115 |  | 
|---|
|  | 116 | ## Second DAB | 
|---|
|  | 117 | #newwin 1 1 | 
|---|
|  | 118 | #plot2d dab02 (n/8192)*250+1250 val n>0 "blue cpts nstat notit" | 
|---|
|  | 119 | #plot2d dab12 (n/8192)*250+1250 val n>0 "same red cpts nstat notit" | 
|---|
|  | 120 | #settitle "Second DAB raw $source $date $mode Ch0 blue Ch1 red" | 
|---|
|  | 121 |  | 
|---|
|  | 122 | newwin 1 1 | 
|---|
|  | 123 | plot2d dab02f (n/8192)*250+1250 val n>0 "blue cpts nstat notit" | 
|---|
|  | 124 | plot2d dab12f (n/8192)*250+1250 val n>0 "same red cpts nstat notit" | 
|---|
|  | 125 | settitle "Second DAB filt $source $date $mode Ch0 blue Ch1 red" | 
|---|
|  | 126 |  | 
|---|
|  | 127 | ## Delta=DAB-baseline + Calibrated DAB in Jansky | 
|---|
|  | 128 | graphicatt "xylimits=1100,1600,0,30" | 
|---|
|  | 129 | newwin 1 1 | 
|---|
|  | 130 | n/pl nt_dabjy.dabjy%dabfreq 1 ! "marker=star,4 turquoise notit nstat" | 
|---|
|  | 131 | plot2d dab01d (n/8192)*250+1250 val*18 n>0 "same blue cpts nstat notit" | 
|---|
|  | 132 | plot2d dab11d (n/8192)*250+1250 val*22 n>0 "same red cpts nstat notit" | 
|---|
|  | 133 | settitle "First DAB delta $source $date $mode" | 
|---|
|  | 134 | setaxelabels "Freq (MHz)" "Intensity" "bigboldfont" | 
|---|
|  | 135 | addline 1420 4 1430 4 "turquoise line=solid,3" | 
|---|
|  | 136 | addline 1420 3 1430 3 "blue line=solid,3" | 
|---|
|  | 137 | addline 1420 2 1430 2 "red line=solid,3" | 
|---|
|  | 138 | addtext 1440 4 "DAB Voie E (Jy)" "bigfont" | 
|---|
|  | 139 | addtext 1440 3 "Ch0*18 (A.U.)" "bigfont" | 
|---|
|  | 140 | addtext 1440 2 "Ch1*22 (A.U.)" "bigfont" | 
|---|
|  | 141 |  | 
|---|
|  | 142 | newwin 1 1 | 
|---|
|  | 143 | n/pl nt_dabjy.dabjy%dabfreq 1 ! "marker=star,4 turquoise notit nstat" | 
|---|
|  | 144 | plot2d dab02d (n/8192)*250+1250 val*18 n>0 "same blue cpts nstat notit" | 
|---|
|  | 145 | plot2d dab12d (n/8192)*250+1250 val*22 n>0 "same red cpts nstat notit" | 
|---|
|  | 146 | settitle "Second DAB delta $source $date $mode" | 
|---|
|  | 147 | setaxelabels "Freq (MHz)" "Intensity" "bigboldfont" | 
|---|
|  | 148 | addline 1420 4 1430 4 "turquoise line=solid,3" | 
|---|
|  | 149 | addline 1420 3 1430 3 "blue line=solid,3" | 
|---|
|  | 150 | addline 1420 2 1430 2 "red line=solid,3" | 
|---|
|  | 151 | addtext 1440 4 "DAB Voie E (Jy)" "bigfont" | 
|---|
|  | 152 | addtext 1440 3 "Ch0*18 (A.U.)" "bigfont" | 
|---|
|  | 153 | addtext 1440 2 "Ch1*22 (A.U.)" "bigfont" | 
|---|
|  | 154 |  | 
|---|
|  | 155 | ## Delta=Mean(DAB-baseline) + Calibrated DAB in Jansky | 
|---|
|  | 156 | graphicatt "xylimits=1100,1600,0,30" | 
|---|
|  | 157 | newwin 1 1 | 
|---|
|  | 158 | n/pl nt_dabjy.dabjy%dabfreq 1 ! "marker=star,4 turquoise notit nstat" | 
|---|
|  | 159 | plot2d meandab0d (n/8192)*250+1250 val*18 n>0 "same blue cpts nstat notit" | 
|---|
|  | 160 | plot2d meandab1d (n/8192)*250+1250 val*23 n>0 "same red cpts nstat notit" | 
|---|
|  | 161 | settitle "Mean DAB delta $source $date $mode" | 
|---|
|  | 162 | setaxelabels "Freq (MHz)" "Intensity" "bigboldfont" | 
|---|
|  | 163 | addline 1420 4 1430 4 "turquoise line=solid,3" | 
|---|
|  | 164 | addline 1420 3 1430 3 "blue line=solid,3" | 
|---|
|  | 165 | addline 1420 2 1430 2 "red line=solid,3" | 
|---|
|  | 166 | addtext 1440 4 "DAB Voie E (Jy)" "bigfont" | 
|---|
|  | 167 | addtext 1440 3 "Ch0*18 (A.U.)" "bigfont" | 
|---|
|  | 168 | addtext 1440 2 "Ch1*23 (A.U.)" "bigfont" | 
|---|
| [630] | 169 |  | 
|---|
|  | 170 | graphicatt "" | 
|---|
|  | 171 | newwin 1 1 | 
|---|
|  | 172 | plot2d meandab0d (n/8192)*250+1250 val n>0 "blue cpts nstat notit" | 
|---|
|  | 173 | plot2d meandab1d (n/8192)*250+1250 val n>0 "same red cpts nstat notit" | 
|---|
|  | 174 | settitle "Raw MeanDAB Ch0(blue) Ch1(red)" | 
|---|
|  | 175 |  | 
|---|
|  | 176 | ## Rebinned DAB spectra | 
|---|
|  | 177 | graphicatt "" | 
|---|
|  | 178 | newwin 1 1 | 
|---|
|  | 179 | plot2d val0 (n/500)*250+1250 val 1 "cpts blue notit nstat" | 
|---|
|  | 180 | plot2d val1 (n/500)*250+1250 val 1 "cpts same red notit nstat" | 
|---|
|  | 181 | settitle "BAO DAB spectra Ch0 (blue) Ch1(red)" | 
|---|
|  | 182 | setaxelabels "Freq. (MHz)" "I (a.u.)" "bigboldfont" | 
|---|
|  | 183 |  | 
|---|
|  | 184 | newwin 1 1 | 
|---|
|  | 185 | plot2d val2 (n/500)*250+1250 val 1 "cpts blue notit nstat" | 
|---|
|  | 186 | settitle "Calibrated DAB spectra" | 
|---|
|  | 187 | setaxelabels "Freq. (MHz)" "I (Jy)" "bigboldfont" | 
|---|
|  | 188 |  | 
|---|
|  | 189 | ## Calibration coefficients Jy/a.u. in the whole bandwidth | 
|---|
|  | 190 | newwin 1 1 | 
|---|
|  | 191 | plot2d calcoeff1 (n/500)*250+1250 val 1 "cpts red notit nstat" | 
|---|
|  | 192 | plot2d calcoeff0 (n/500)*250+1250 val 1 "cpts same blue notit nstat" | 
|---|
|  | 193 | settitle "Calibration coefficients spectrum Ch0(blue) Ch1(red)" | 
|---|
|  | 194 | setaxelabels "Freq. (MHz)" "Coeff Jy/a.u."  "bigboldfont" | 
|---|
|  | 195 |  | 
|---|
|  | 196 | ## Calibration coefficients Jy/a.u. in [1400,1420]MHz | 
|---|
|  | 197 | newwin 1 1 | 
|---|
|  | 198 | disp h0 "notit" | 
|---|
|  | 199 | settitle "CalCoeff (Jy/a.u.) Ch0" | 
|---|
|  | 200 | newwin 1 1 | 
|---|
|  | 201 | disp h1 "notit" | 
|---|
|  | 202 | settitle "CalCoeff (Jy/a.u.) Ch1" | 
|---|