Changeset 974 for trunk/src/series


Ignore:
Timestamp:
Nov 18, 2016, 7:14:06 PM (8 years ago)
Author:
sommeria
Message:

aver synchro updated

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/series/aver_synchro.m

    r924 r974  
    200200sigma_sub=pi/Param.ActionInput.WavePeriod;%subharmonic
    201201sinsub_V=0;
     202NbField=0;
    202203vec_C=0;
    203204 
    204205%%%%%%%%%%%%%%%% loop on field indices %%%%%%%%%%%%%%%%
    205206for index=1:nbfield
     207    index
    206208    update_waitbar(WaitbarHandle,index/nbfield)
    207209    if ~isempty(RUNHandle)&& ~strcmp(get(RUNHandle,'BusyAction'),'queue')
     
    220222    end
    221223    %update average
     224    FF=isnan(Data.U)|isnan(Data.V);% chceck NaN values
     225    Data.U(FF)=0;% set to zero the NaN values
     226    Data.V(FF)=0;
     227    NbField=NbField+~FF;%count the NaN values
    222228    MeanU=MeanU+Data.U;
    223229    MeanV=MeanV+Data.V;
     
    248254%%%%%%%%%%%%%%%%%%%%%%%%
    249255Data.ListVarName={'coord_x','coord_y','MeanU','MeanV','cos1_U','cos1_V','a1_U','a1_V','a2_U','a2_V','a3_U','a3_V','asub_U','asub_V',...
    250     'phase1_U','phase1_V','phase2_U','phase2_V','phase3_U','phase3_V'};
     256    'phase1_U','phase1_V','phase2_U','phase2_V','phase3_U','phase3_V','phasesub_U','phasesub_V'};
    251257%Data.ListVarName=[{'coord_y','coord_x'} Data.ListVarName];
    252258%Data.VarDimName={'coord_y', 'coord_x'};
     
    255261 %   Data.VarDimName{ilist}='nb_vectors';
    256262end
    257 Data.MeanU=MeanU/nbfield;
    258 Data.MeanV=MeanV/nbfield;
    259 Data.cos1_U=cos1_U/nbfield;
    260 Data.cos1_V=cos1_V/nbfield;
    261 sin1_U=sin1_U/nbfield;
    262 sin1_V=sin1_V/nbfield;
    263 cos2_U=cos2_U/nbfield;
    264 cos2_V=cos2_V/nbfield;
    265 sin2_U=sin2_U/nbfield;
    266 sin2_V=sin2_V/nbfield;
    267 cos3_U=cos3_U/nbfield;
    268 cos3_V=cos3_V/nbfield;
    269 sin3_U=sin3_U/nbfield;
    270 sin3_V=sin3_V/nbfield;
    271 cossub_U=cossub_U/nbfield;
    272 cossub_V=cossub_V/nbfield;
    273 sinsub_U=sinsub_U/nbfield;
    274 sinsub_V=sinsub_V/nbfield;
    275 Data.a1_U=sqrt(2)*sqrt(Data.cos1_U.*Data.cos1_U+sin1_U.*sin1_U);
    276 Data.a1_V=-sqrt(2)*sqrt(Data.cos1_V.*Data.cos1_V+sin1_V.*sin1_V);
     263Data.MeanU=MeanU./NbField;
     264Data.MeanV=MeanV./NbField;
     265cos1_U=cos1_U./NbField;
     266cos1_V=cos1_V./NbField;
     267sin1_U=sin1_U./NbField;
     268sin1_V=sin1_V./NbField;
     269cos2_U=cos2_U./NbField;
     270cos2_V=cos2_V./NbField;
     271sin2_U=sin2_U./NbField;
     272sin2_V=sin2_V./NbField;
     273cos3_U=cos3_U./NbField;
     274cos3_V=cos3_V./NbField;
     275sin3_U=sin3_U./NbField;
     276sin3_V=sin3_V./NbField;
     277cossub_U=cossub_U./NbField;
     278cossub_V=cossub_V./NbField;
     279sinsub_U=sinsub_U./NbField;
     280sinsub_V=sinsub_V./NbField;
     281Data.cos1_U=cos1_U;
     282Data.cos1_V=cos1_V;
     283Data.a1_U=sqrt(2)*sqrt(cos1_U.*cos1_U+sin1_U.*sin1_U);
     284Data.a1_V=-sqrt(2)*sqrt(cos1_V.*cos1_V+sin1_V.*sin1_V);
    277285Data.a2_U=sqrt(2)*sqrt(cos2_U.*cos2_U+sin2_U.*sin2_U);
    278286Data.a2_V=-sqrt(2)*sqrt(cos2_V.*cos2_V+sin2_V.*sin2_V);
     
    281289Data.asub_U=sqrt(2)*sqrt(cossub_U.*cossub_U+sinsub_U.*sinsub_U);
    282290Data.asub_V=-sqrt(2)*sqrt(cossub_V.*cossub_V+sinsub_V.*sinsub_V);
    283 clear i
     291% clear i
    284292Data.phase1_U=(angle(cos1_U+i*sin1_U));
     293
    285294Data.phase1_V=angle(cos1_V+i*sin1_V);
    286295Data.phase2_U=(angle(cos2_U+i*sin2_U));
Note: See TracChangeset for help on using the changeset viewer.