| [638] | 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 |
|
|---|
| [639] | 12 | #first script executed
|
|---|
| [638] | 13 | clearscript image
|
|---|
| [639] | 14 |
|
|---|
| 15 | #mergeimg should be executed before timeevol, fwhnInt
|
|---|
| 16 | clearscript mergeimg
|
|---|
| 17 | clearscript timeevol
|
|---|
| 18 | clearscript fwhmInt
|
|---|
| 19 |
|
|---|
| 20 | #script independant from mergeimg
|
|---|
| 21 | clearscript timeevol2
|
|---|
| [638] | 22 | #######################
|
|---|
| 23 | defscript image
|
|---|
| 24 | #
|
|---|
| 25 | set cycle $1
|
|---|
| 26 | openppf ${path}/img_${date}_${source}_cycle${cycle}.ppf
|
|---|
| 27 | del ich0
|
|---|
| 28 | objaoper img${cycle} slicexz 0 ich0
|
|---|
| 29 | c++exec TMatrix<r_4>zCh0(ich0(Range(0),Range::all()),false); \
|
|---|
| 30 | for (sa_size_t i=1;i<50;i++){zCh0+=ich0(Range(i),Range::all());} \
|
|---|
| 31 | zCh0/=50.; \
|
|---|
| 32 | for (sa_size_t i=0;i<ich0.NRows();i++){ich0(Range(i),Range::all())-=zCh0;}
|
|---|
| 33 | #
|
|---|
| 34 | rename ich0 ich${cycle}0
|
|---|
| 35 |
|
|---|
| 36 | del ich1
|
|---|
| 37 | objaoper img${cycle} slicexz 1 ich1
|
|---|
| 38 | c++exec TMatrix<r_4>zCh1(ich1(Range(0),Range::all()),false); \
|
|---|
| 39 | for (sa_size_t i=1;i<50;i++){zCh1+=ich1(Range(i),Range::all());} \
|
|---|
| 40 | zCh1/=50.; \
|
|---|
| 41 | for (sa_size_t i=0;i<ich1.NRows();i++){ich1(Range(i),Range::all())-=zCh1;}
|
|---|
| 42 | #
|
|---|
| 43 | rename ich1 ich${cycle}1
|
|---|
| 44 |
|
|---|
| 45 | endscript
|
|---|
| 46 | #######################
|
|---|
| 47 |
|
|---|
| 48 |
|
|---|
| [639] | 49 | #######################
|
|---|
| 50 | defscript mergeimg
|
|---|
| 51 | #
|
|---|
| [638] | 52 | del ich0Tot
|
|---|
| 53 | del ich1Tot
|
|---|
| 54 | del ncycles
|
|---|
| 55 | c++exec TMatrix<r_4>ich0Tot(ich${fcycle}0(Range(0,${nframes}),Range::all()),false); \
|
|---|
| 56 | TMatrix<r_4>ich1Tot(ich${fcycle}1(Range(0,${nframes}),Range::all()),false); \
|
|---|
| 57 | TVector<r_4>ncycles(1); ncycles(0)=1; \
|
|---|
| 58 | KeepObj(ich0Tot); KeepObj(ich1Tot); KeepObj(ncycles);
|
|---|
| 59 |
|
|---|
| 60 | fp1cycle = ${fcycle}+1
|
|---|
| 61 |
|
|---|
| 62 | for ic ${fp1cycle}:${maxcycle}
|
|---|
| 63 | c++exec ich0Tot+=ich${ic}0(Range(0,${nframes}),Range::all()); \
|
|---|
| 64 | ich1Tot+=ich${ic}1(Range(0,${nframes}),Range::all()); \
|
|---|
| 65 | ncycles(0)+=1;
|
|---|
| 66 | end
|
|---|
| 67 |
|
|---|
| 68 | c++exec ich0Tot/=ncycles(0); ich1Tot/=ncycles(0);
|
|---|
| 69 |
|
|---|
| 70 | setaxesatt 'font=helvetica,bold,14 fixedfontsize'
|
|---|
| 71 | newwin
|
|---|
| 72 | disp ich0Tot 'lut=lin,-0.1,3.5 colbr128 showcmap=top'
|
|---|
| 73 |
|
|---|
| 74 | newwin
|
|---|
| 75 | disp ich1Tot 'lut=lin,-0.1,3.5 colbr128 showcmap=top'
|
|---|
| [639] | 76 | endscript
|
|---|
| 77 | #######################
|
|---|
| 78 | defscript timeevol
|
|---|
| 79 | #
|
|---|
| 80 | #intensite en ft du temps avec image cumulee
|
|---|
| [638] | 81 | del rg0Tot
|
|---|
| 82 | del rg1Tot
|
|---|
| 83 | #1405,1415 MHz => range [5080,5405]
|
|---|
| 84 | c++exec TMatrix<r_4>tmp0(ich0Tot(Range::all(),Range(5080,5405)),false); \
|
|---|
| 85 | TVector<r_4>rg0Tot(ich0Tot.NRows()); \
|
|---|
| 86 | for(sa_size_t i=0;i<tmp0.NRows();++i){ \
|
|---|
| 87 | double mean,sigma; \
|
|---|
| 88 | MeanSigma(tmp0(Range(i),Range::all()),mean,sigma); \
|
|---|
| 89 | rg0Tot(i) = mean; \
|
|---|
| 90 | } \
|
|---|
| 91 | KeepObj(rg0Tot); \
|
|---|
| 92 | TMatrix<r_4>tmp1(ich1Tot(Range::all(),Range(5080,5405)),false); \
|
|---|
| 93 | TVector<r_4>rg1Tot(ich1Tot.NRows()); \
|
|---|
| 94 | for(sa_size_t i=0;i<tmp1.NRows();++i){ \
|
|---|
| 95 | double mean,sigma; \
|
|---|
| 96 | MeanSigma(tmp1(Range(i),Range::all()),mean,sigma); \
|
|---|
| 97 | rg1Tot(i) = mean; \
|
|---|
| 98 | } \
|
|---|
| 99 | KeepObj(rg1Tot);
|
|---|
| 100 |
|
|---|
| 101 | newwin
|
|---|
| 102 | setaxesatt 'grid'
|
|---|
| 103 | graphicatt ''
|
|---|
| 104 | #90sec = milieu du cycle = maximum
|
|---|
| 105 | #donne 7.56kHz
|
|---|
| 106 | #273 canaux en 170sec => 8.22kHz
|
|---|
| 107 | plot2d rg0Tot (n*170)/273 val 1 'blue cpts notit nsta'
|
|---|
| 108 | plot2d rg1Tot (n*170)/273 val 1 'same red cpts notit nsta'
|
|---|
| [639] | 109 | settitle "${srcMaj} Drift Scan [1405,1415]MHz all cycles Ch 0 (blue) Ch 1 (red)"
|
|---|
| [638] | 110 | setaxelabels 't(sec)' 'I (a.u)'
|
|---|
| [639] | 111 | endscript
|
|---|
| [638] | 112 |
|
|---|
| [639] | 113 | #######################
|
|---|
| 114 | defscript fwhmInt
|
|---|
| 115 | #
|
|---|
| [638] | 116 | #spectre de frequence canal en temps [120,146] FWHM.
|
|---|
| 117 | #
|
|---|
| 118 | del s0
|
|---|
| 119 | del s1
|
|---|
| 120 | c++exec TMatrix<r_4>tmp0(ich0Tot(Range(120,146),Range::all()),false); \
|
|---|
| 121 | TVector<r_4>s0(ich0Tot.NCols()); \
|
|---|
| 122 | for(sa_size_t i=0;i<tmp0.NCols();++i){ \
|
|---|
| 123 | double mean,sigma; \
|
|---|
| 124 | MeanSigma(tmp0(Range::all(),Range(i)),mean,sigma); \
|
|---|
| 125 | s0(i) = mean; \
|
|---|
| 126 | } \
|
|---|
| 127 | KeepObj(s0); \
|
|---|
| 128 | TMatrix<r_4>tmp1(ich1Tot(Range(120,146),Range::all()),false); \
|
|---|
| 129 | TVector<r_4>s1(ich1Tot.NCols()); \
|
|---|
| 130 | for(sa_size_t i=0;i<tmp1.NCols();++i){ \
|
|---|
| 131 | double mean,sigma; \
|
|---|
| 132 | MeanSigma(tmp1(Range::all(),Range(i)),mean,sigma); \
|
|---|
| 133 | s1(i) = mean; \
|
|---|
| 134 | } \
|
|---|
| 135 | KeepObj(s1);
|
|---|
| 136 | newwin
|
|---|
| 137 | setaxesatt 'grid'
|
|---|
| 138 | graphicatt 'xylimits=1250,1500,0,2'
|
|---|
| 139 | plot2d s0 (n/8192)*250+1250 val n>0 'blue cpts notit nsta'
|
|---|
| 140 | plot2d s1 (n/8192)*250+1250 val 1 'same red cpts notit nsta'
|
|---|
| [639] | 141 | settitle "${srcMaj} Drift Scan all cycles Ch 0 (blue) Ch 1 (red)"
|
|---|
| [638] | 142 | setaxelabels 'Freq. (MHz)' 'I (a.u)'
|
|---|
| [639] | 143 | endscript
|
|---|
| 144 | #######################
|
|---|
| 145 | #######################
|
|---|
| 146 | defscript timeevol2
|
|---|
| [638] | 147 |
|
|---|
| [639] | 148 | #append all images
|
|---|
| 149 | del ch0evol
|
|---|
| 150 | del ch1evol
|
|---|
| 151 | c++exec sa_size_t nrows=(${nframes}+1)*(${lcycle}-${fcycle}+1); \
|
|---|
| 152 | sa_size_t ncols=ich${fcycle}0.NCols(); \
|
|---|
| 153 | TMatrix<r_4>ch0evol(nrows,ncols); TMatrix<r_4>ch1evol(nrows,ncols); \
|
|---|
| 154 | KeepObj(ch0evol); KeepObj(ch1evol);
|
|---|
| 155 |
|
|---|
| 156 | for ic ${fcycle}:${maxcycle}
|
|---|
| 157 | c++exec sa_size_t curRow=(${ic}-${fcycle})*(${nframes}+1); sa_size_t nextm1CurRow=curRow+(${nframes}+1)-1; \
|
|---|
| 158 | cout << "ic, curRow, next : "<<${ic}<<" "<<curRow<<" "<<nextm1CurRow<<endl; \
|
|---|
| 159 | ch0evol(Range(curRow,nextm1CurRow),Range::all())=ich${ic}0(Range(0,${nframes}),Range::all()); \
|
|---|
| 160 | ch1evol(Range(curRow,nextm1CurRow),Range::all())=ich${ic}1(Range(0,${nframes}),Range::all());
|
|---|
| 161 | end
|
|---|
| 162 |
|
|---|
| 163 | echo "Coucou......"
|
|---|
| 164 |
|
|---|
| 165 | #intensite en ft du temps avec image cumulee
|
|---|
| 166 | del i0evol
|
|---|
| 167 | del i1evol
|
|---|
| 168 | #1405,1415 MHz => range [5080,5405]
|
|---|
| 169 | c++exec TMatrix<r_4>tmp0(ch0evol(Range::all(),Range(5080,5405)),false); \
|
|---|
| 170 | TVector<r_4>i0evol(ch0evol.NRows()); \
|
|---|
| 171 | for(sa_size_t i=0;i<tmp0.NRows();++i){ \
|
|---|
| 172 | double mean,sigma; \
|
|---|
| 173 | MeanSigma(tmp0(Range(i),Range::all()),mean,sigma); \
|
|---|
| 174 | i0evol(i) = mean; \
|
|---|
| 175 | } \
|
|---|
| 176 | KeepObj(i0evol); \
|
|---|
| 177 | TMatrix<r_4>tmp1(ch1evol(Range::all(),Range(5080,5405)),false); \
|
|---|
| 178 | TVector<r_4>i1evol(ch1evol.NRows()); \
|
|---|
| 179 | for(sa_size_t i=0;i<tmp1.NRows();++i){ \
|
|---|
| 180 | double mean,sigma; \
|
|---|
| 181 | MeanSigma(tmp1(Range(i),Range::all()),mean,sigma); \
|
|---|
| 182 | i1evol(i) = mean; \
|
|---|
| 183 | } \
|
|---|
| 184 | KeepObj(i1evol);
|
|---|
| 185 |
|
|---|
| 186 |
|
|---|
| 187 |
|
|---|
| 188 | newwin
|
|---|
| 189 | setaxesatt 'grid'
|
|---|
| 190 | graphicatt ''
|
|---|
| 191 | plot2d i0evol n val 1 'blue cpts notit nsta'
|
|---|
| 192 | plot2d i1evol n val 1 'same red cpts notit nsta'
|
|---|
| 193 | settitle "${srcMaj} Drift Scan [1405,1415]MHz all cycles Ch 0 (blue) Ch 1 (red)"
|
|---|
| 194 | setaxelabels 't(a.u)' 'I (a.u)'
|
|---|
| 195 |
|
|---|
| 196 | endscript
|
|---|
| 197 | ###################
|
|---|
| 198 | #for ic ${fcycle}:${maxcycle}
|
|---|
| 199 | #echo "process $ic"
|
|---|
| 200 | #image $ic
|
|---|
| 201 | #end
|
|---|
| 202 |
|
|---|