source: BAORadio/AmasNancay/trunk/dabchrom_plot.pic

Last change on this file was 630, checked in by torrento, 12 years ago

Added calibration coefficient spectrum

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