source: BAORadio/AmasNancay/trunk/imgdrift.pic @ 638

Last change on this file since 638 was 638, checked in by campagne, 12 years ago

first introduction of DRIFT data (jec)

File size: 3.5 KB
Line 
1#source en minuscule
2set source $1
3set srcMaj $2
4set date   $3
5set fcycle $4
6set lcycle $5
7set nframes $6
8maxcycle = ${lcycle}+1
9
10set path "/sps/baoradio/AmasNancay/JEC/${srcMaj}"
11
12clearscript image
13#######################
14defscript image
15#
16set cycle  $1
17openppf ${path}/img_${date}_${source}_cycle${cycle}.ppf
18del ich0
19objaoper img${cycle} slicexz 0 ich0
20c++exec TMatrix<r_4>zCh0(ich0(Range(0),Range::all()),false); \
21for (sa_size_t i=1;i<50;i++){zCh0+=ich0(Range(i),Range::all());} \
22zCh0/=50.; \
23for (sa_size_t i=0;i<ich0.NRows();i++){ich0(Range(i),Range::all())-=zCh0;}
24#
25rename ich0 ich${cycle}0
26
27del ich1
28objaoper img${cycle} slicexz 1 ich1
29c++exec TMatrix<r_4>zCh1(ich1(Range(0),Range::all()),false); \
30for (sa_size_t i=1;i<50;i++){zCh1+=ich1(Range(i),Range::all());} \
31zCh1/=50.; \
32for (sa_size_t i=0;i<ich1.NRows();i++){ich1(Range(i),Range::all())-=zCh1;}
33#
34rename ich1 ich${cycle}1
35
36endscript
37#######################
38
39for ic ${fcycle}:${maxcycle}
40echo "process $ic"
41image $ic
42end
43
44del ich0Tot
45del ich1Tot
46del ncycles
47c++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
52fp1cycle = ${fcycle}+1
53
54for 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;
58end
59
60c++exec ich0Tot/=ncycles(0); ich1Tot/=ncycles(0);
61
62setaxesatt 'font=helvetica,bold,14 fixedfontsize'
63newwin
64disp ich0Tot 'lut=lin,-0.1,3.5 colbr128 showcmap=top'
65
66newwin
67disp ich1Tot 'lut=lin,-0.1,3.5 colbr128 showcmap=top'
68
69#intensite en ft du temps
70del rg0Tot
71del rg1Tot
72#1405,1415 MHz => range [5080,5405]
73c++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
90newwin
91setaxesatt 'grid'
92graphicatt ''
93#90sec = milieu du cycle = maximum
94#donne 7.56kHz
95#273 canaux en 170sec => 8.22kHz
96plot2d rg0Tot (n*170)/273 val 1 'blue cpts notit nsta'
97plot2d rg1Tot (n*170)/273 val 1 'same red cpts notit nsta'
98settitle "${srcMaj} Drift Scan [1405,1415]MHz 2cycles Ch 0 (blue) Ch 1 (red)"
99setaxelabels 't(sec)' 'I (a.u)'
100
101#spectre de frequence canal en temps [120,146] FWHM.
102#
103del s0
104del s1
105c++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);
121newwin
122setaxesatt 'grid'
123graphicatt 'xylimits=1250,1500,0,2'
124plot2d s0 (n/8192)*250+1250 val n>0 'blue cpts notit nsta'
125plot2d s1 (n/8192)*250+1250 val 1 'same red cpts notit nsta'
126settitle "${srcMaj} Drift Scan 2cycles Ch 0 (blue) Ch 1 (red)"
127setaxelabels 'Freq. (MHz)' 'I (a.u)'
128
Note: See TracBrowser for help on using the repository browser.