1 | #source en minuscule |
---|
2 | set source $1 |
---|
3 | set srcMaj $2 |
---|
4 | set date $3 |
---|
5 | set fcycle $4 |
---|
6 | set lcycle $5 |
---|
7 | set nframes $6 |
---|
8 | maxcycle = ${lcycle}+1 |
---|
9 | |
---|
10 | set path "/sps/baoradio/AmasNancay/JEC/${srcMaj}" |
---|
11 | |
---|
12 | clearscript image |
---|
13 | ####################### |
---|
14 | defscript image |
---|
15 | # |
---|
16 | set cycle $1 |
---|
17 | openppf ${path}/img_${date}_${source}_cycle${cycle}.ppf |
---|
18 | del ich0 |
---|
19 | objaoper img${cycle} slicexz 0 ich0 |
---|
20 | c++exec TMatrix<r_4>zCh0(ich0(Range(0),Range::all()),false); \ |
---|
21 | for (sa_size_t i=1;i<50;i++){zCh0+=ich0(Range(i),Range::all());} \ |
---|
22 | zCh0/=50.; \ |
---|
23 | for (sa_size_t i=0;i<ich0.NRows();i++){ich0(Range(i),Range::all())-=zCh0;} |
---|
24 | # |
---|
25 | rename ich0 ich${cycle}0 |
---|
26 | |
---|
27 | del ich1 |
---|
28 | objaoper img${cycle} slicexz 1 ich1 |
---|
29 | c++exec TMatrix<r_4>zCh1(ich1(Range(0),Range::all()),false); \ |
---|
30 | for (sa_size_t i=1;i<50;i++){zCh1+=ich1(Range(i),Range::all());} \ |
---|
31 | zCh1/=50.; \ |
---|
32 | for (sa_size_t i=0;i<ich1.NRows();i++){ich1(Range(i),Range::all())-=zCh1;} |
---|
33 | # |
---|
34 | rename ich1 ich${cycle}1 |
---|
35 | |
---|
36 | endscript |
---|
37 | ####################### |
---|
38 | |
---|
39 | for ic ${fcycle}:${maxcycle} |
---|
40 | echo "process $ic" |
---|
41 | image $ic |
---|
42 | end |
---|
43 | |
---|
44 | del ich0Tot |
---|
45 | del ich1Tot |
---|
46 | del ncycles |
---|
47 | c++exec TMatrix<r_4>ich0Tot(ich${fcycle}0(Range(0,${nframes}),Range::all()),false); \ |
---|
48 | TMatrix<r_4>ich1Tot(ich${fcycle}1(Range(0,${nframes}),Range::all()),false); \ |
---|
49 | TVector<r_4>ncycles(1); ncycles(0)=1; \ |
---|
50 | KeepObj(ich0Tot); KeepObj(ich1Tot); KeepObj(ncycles); |
---|
51 | |
---|
52 | fp1cycle = ${fcycle}+1 |
---|
53 | |
---|
54 | for ic ${fp1cycle}:${maxcycle} |
---|
55 | c++exec ich0Tot+=ich${ic}0(Range(0,${nframes}),Range::all()); \ |
---|
56 | ich1Tot+=ich${ic}1(Range(0,${nframes}),Range::all()); \ |
---|
57 | ncycles(0)+=1; |
---|
58 | end |
---|
59 | |
---|
60 | c++exec ich0Tot/=ncycles(0); ich1Tot/=ncycles(0); |
---|
61 | |
---|
62 | setaxesatt 'font=helvetica,bold,14 fixedfontsize' |
---|
63 | newwin |
---|
64 | disp ich0Tot 'lut=lin,-0.1,3.5 colbr128 showcmap=top' |
---|
65 | |
---|
66 | newwin |
---|
67 | disp ich1Tot 'lut=lin,-0.1,3.5 colbr128 showcmap=top' |
---|
68 | |
---|
69 | #intensite en ft du temps |
---|
70 | del rg0Tot |
---|
71 | del rg1Tot |
---|
72 | #1405,1415 MHz => range [5080,5405] |
---|
73 | c++exec TMatrix<r_4>tmp0(ich0Tot(Range::all(),Range(5080,5405)),false); \ |
---|
74 | TVector<r_4>rg0Tot(ich0Tot.NRows()); \ |
---|
75 | for(sa_size_t i=0;i<tmp0.NRows();++i){ \ |
---|
76 | double mean,sigma; \ |
---|
77 | MeanSigma(tmp0(Range(i),Range::all()),mean,sigma); \ |
---|
78 | rg0Tot(i) = mean; \ |
---|
79 | } \ |
---|
80 | KeepObj(rg0Tot); \ |
---|
81 | TMatrix<r_4>tmp1(ich1Tot(Range::all(),Range(5080,5405)),false); \ |
---|
82 | TVector<r_4>rg1Tot(ich1Tot.NRows()); \ |
---|
83 | for(sa_size_t i=0;i<tmp1.NRows();++i){ \ |
---|
84 | double mean,sigma; \ |
---|
85 | MeanSigma(tmp1(Range(i),Range::all()),mean,sigma); \ |
---|
86 | rg1Tot(i) = mean; \ |
---|
87 | } \ |
---|
88 | KeepObj(rg1Tot); |
---|
89 | |
---|
90 | newwin |
---|
91 | setaxesatt 'grid' |
---|
92 | graphicatt '' |
---|
93 | #90sec = milieu du cycle = maximum |
---|
94 | #donne 7.56kHz |
---|
95 | #273 canaux en 170sec => 8.22kHz |
---|
96 | plot2d rg0Tot (n*170)/273 val 1 'blue cpts notit nsta' |
---|
97 | plot2d rg1Tot (n*170)/273 val 1 'same red cpts notit nsta' |
---|
98 | settitle "${srcMaj} Drift Scan [1405,1415]MHz 2cycles Ch 0 (blue) Ch 1 (red)" |
---|
99 | setaxelabels 't(sec)' 'I (a.u)' |
---|
100 | |
---|
101 | #spectre de frequence canal en temps [120,146] FWHM. |
---|
102 | # |
---|
103 | del s0 |
---|
104 | del s1 |
---|
105 | c++exec TMatrix<r_4>tmp0(ich0Tot(Range(120,146),Range::all()),false); \ |
---|
106 | TVector<r_4>s0(ich0Tot.NCols()); \ |
---|
107 | for(sa_size_t i=0;i<tmp0.NCols();++i){ \ |
---|
108 | double mean,sigma; \ |
---|
109 | MeanSigma(tmp0(Range::all(),Range(i)),mean,sigma); \ |
---|
110 | s0(i) = mean; \ |
---|
111 | } \ |
---|
112 | KeepObj(s0); \ |
---|
113 | TMatrix<r_4>tmp1(ich1Tot(Range(120,146),Range::all()),false); \ |
---|
114 | TVector<r_4>s1(ich1Tot.NCols()); \ |
---|
115 | for(sa_size_t i=0;i<tmp1.NCols();++i){ \ |
---|
116 | double mean,sigma; \ |
---|
117 | MeanSigma(tmp1(Range::all(),Range(i)),mean,sigma); \ |
---|
118 | s1(i) = mean; \ |
---|
119 | } \ |
---|
120 | KeepObj(s1); |
---|
121 | newwin |
---|
122 | setaxesatt 'grid' |
---|
123 | graphicatt 'xylimits=1250,1500,0,2' |
---|
124 | plot2d s0 (n/8192)*250+1250 val n>0 'blue cpts notit nsta' |
---|
125 | plot2d s1 (n/8192)*250+1250 val 1 'same red cpts notit nsta' |
---|
126 | settitle "${srcMaj} Drift Scan 2cycles Ch 0 (blue) Ch 1 (red)" |
---|
127 | setaxelabels 'Freq. (MHz)' 'I (a.u)' |
---|
128 | |
---|