Changeset 640 for BAORadio


Ignore:
Timestamp:
Jan 18, 2012, 3:14:26 PM (13 years ago)
Author:
campagne
Message:

add timeevol2 for Tsys survey

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BAORadio/AmasNancay/trunk/imgdrift.pic

    r639 r640  
    1212#first script executed
    1313clearscript image
     14clearscript doImage
    1415
    1516#mergeimg should be executed before timeevol, fwhnInt
     
    2324defscript image
    2425#
     26#compute (ON-OFF)/OFFn with OFF computed from the first 30s of each image
    2527set cycle  $1
    2628openppf ${path}/img_${date}_${source}_cycle${cycle}.ppf
    2729del ich0
     30del zCh0
    2831objaoper img${cycle} slicexz 0 ich0
    2932c++exec TMatrix<r_4>zCh0(ich0(Range(0),Range::all()),false); \
    3033for (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;}
     34zCh0/=50.; KeepObj(zCh0);\
     35for (sa_size_t i=0;i<ich0.NRows();i++){ich0(Range(i),Range::all())-=zCh0;ich0(Range(i),Range::all()).Div(zCh0);}
    3336#
    3437rename ich0 ich${cycle}0
     38rename zCh0 tsys${cycle}0
    3539
    3640del ich1
     41del zCh1
    3742objaoper img${cycle} slicexz 1 ich1
    3843c++exec TMatrix<r_4>zCh1(ich1(Range(0),Range::all()),false); \
    3944for (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;}
     45zCh1/=50.; KeepObj(zCh1);\
     46for (sa_size_t i=0;i<ich1.NRows();i++){ich1(Range(i),Range::all())-=zCh1;ich1(Range(i),Range::all()).Div(zCh1);}
    4247#
    4348rename ich1 ich${cycle}1
    44 
    45 endscript
    46 #######################
     49rename zCh1 tsys${cycle}1
     50
     51endscript
     52#######################
     53###################
     54defscript doImage
     55
     56for ic ${fcycle}:${maxcycle}
     57echo "process ${ic}"
     58image $ic
     59end
     60endscript
    4761
    4862
     
    161175end
    162176
    163 echo "Coucou......"
    164 
    165177#intensite en ft du temps avec image cumulee
    166178del i0evol
     
    192204plot2d i1evol n  val 1 'same red cpts notit nsta'
    193205settitle "${srcMaj} Drift Scan [1405,1415]MHz all cycles Ch 0 (blue) Ch 1 (red)"
    194 setaxelabels 't(a.u)' 'I (a.u)'
     206setaxelabels 't(a.u)' '(I-OFF)/OFF (a.u)'
     207
     208
     209#Tsys en ft du temps
     210c++exec sa_size_t nrows=(${lcycle}-${fcycle}+1); \
     211        sa_size_t ncols=ich${fcycle}0.NCols(); \
     212        TMatrix<r_4>Tsys0evol(nrows,ncols); TMatrix<r_4>Tsys1evol(nrows,ncols); \
     213        KeepObj(Tsys0evol); KeepObj(Tsys1evol);
     214
     215for ic ${fcycle}:${maxcycle}
     216  c++exec sa_size_t curRow=(${ic}-${fcycle}); \
     217          cout << "ic, curRow, next : "<<${ic}<<" "<<curRow<<endl; \
     218          Tsys0evol(Range(curRow),Range::all())=tsys${ic}0(Range(0),Range::all()); \
     219          Tsys1evol(Range(curRow),Range::all())=tsys${ic}1(Range(0),Range::all());
     220end
     221
     222del T0evol
     223del T1evol
     224#1405,1415 MHz => range [5080,5405]
     225c++exec TMatrix<r_4>tmp0(Tsys0evol(Range::all(),Range(5080,5405)),false); \
     226        TVector<r_4>T0evol(Tsys0evol.NRows()); \
     227        for(sa_size_t i=0;i<tmp0.NRows();++i){ \
     228          double mean,sigma; \
     229          MeanSigma(tmp0(Range(i),Range::all()),mean,sigma); \
     230          T0evol(i) = mean; \
     231        } \
     232        KeepObj(T0evol); \
     233        TMatrix<r_4>tmp1(Tsys1evol(Range::all(),Range(5080,5405)),false); \
     234        TVector<r_4>T1evol(Tsys1evol.NRows()); \
     235        for(sa_size_t i=0;i<tmp1.NRows();++i){ \
     236          double mean,sigma; \
     237          MeanSigma(tmp1(Range(i),Range::all()),mean,sigma); \
     238          T1evol(i) = mean; \
     239        } \
     240        KeepObj(T1evol);
     241
     242newwin
     243setaxesatt 'grid'
     244graphicatt ''
     245plot2d T0evol n+${fcycle}  val 1 'blue cpts notit nsta'
     246plot2d T1evol n+${fcycle}  val 1 'same red cpts notit nsta'
     247settitle "${srcMaj} Drift Scan [1405,1415]MHz all cycles Ch 0 (blue) Ch 1 (red)"
     248setaxelabels 'cycle num.' 'OFF/Gain (a.u)'
     249
    195250       
    196251endscript
    197 ###################
    198 #for ic ${fcycle}:${maxcycle}
    199 #echo "process $ic"
    200 #image $ic
    201 #end
    202 
     252
Note: See TracChangeset for help on using the changeset viewer.