Changeset 974


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

aver synchro updated

Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/get_field.m

    r924 r974  
    158158end
    159159set(handles.SwitchVarIndexTime,'String',ListSwitchVarIndexTime)
     160set(handles.SwitchVarIndexTime,'UserData',ListSwitchVarIndexTime); % keep string in memory for check3D
    160161set(handles.get_field,'UserData',Field);% record the finput field structure
    161162SwitchVarIndexTime_Callback([], [], handles)
     
    10451046else% fields studied as 2D
    10461047    status='off';
    1047  
    1048 end
     1048end
     1049
    10491050set(handles.Coord_z,'Visible',status)
    10501051% set(handles.CheckDimensionZ,'Visible',status)
    10511052set(handles.Z_title,'Visible',status)
    10521053set(handles.vector_z,'Visible',status)
    1053 set(handles.W_title,'Visible',status)   
    1054 if strcmp(status,'on')
    1055    Field=get(handles.get_field,'UserData');
    1056     if Field.MaxDim>=3% for 3D fields, propose to use the third variable as time
     1054set(handles.W_title,'Visible',status)
     1055if strcmp(status,'on')% ask for 3D input   
     1056    Field=get(handles.get_field,'UserData');
     1057    if Field.MaxDim>3% for 4D fields, propose to use the fourth variable as time
     1058        %set(handles.Time,'Visible','on')
    10571059        menu=get(handles.SwitchVarIndexTime,'String');
    10581060        val=find(strcmp('variable',menu));
    10591061        if ~isempty(val)
    10601062            set(handles.SwitchVarIndexTime,'Value',val)
    1061             SwitchVarIndexTime_Callback(handles.SwitchVarIndexTime,[], handles)
    1062         end
    1063     end
    1064 end
     1063        end
     1064    else
     1065        set(handles.SwitchVarIndexTime,'Value',1)
     1066        set(handles.SwitchVarIndexTime,'String',{'file index'})
     1067    end
     1068else
     1069   set(handles.SwitchVarIndexTime,'String',get(handles.SwitchVarIndexTime,'UserData'))
     1070end
     1071SwitchVarIndexTime_Callback(handles.SwitchVarIndexTime,[], handles)
     1072
    10651073%------------------------------------------------------------------------
    10661074% --- Executes on button press in OK.
  • 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));
  • trunk/src/update_waitbar.m

    r924 r974  
    2828pos=get(hwaitbar,'Position');%read waitbar position in pixels
    2929set(hwaitbar,'Units','normalized')%set back to normalize(the waitbar scales with the GUI)
    30 CData=ones(floor(pos(4)),floor(pos(3)),3);
    31 CData(:,:,3)=0 ;% initial color yellow (rgb=[1 1 0])
     30% CData=ones(floor(pos(4)),floor(pos(3)),3);
     31% CData(:,:,3)=0 ;% initial color yellow (rgb=[1 1 0])
     32CData=zeros(floor(pos(4)),floor(pos(3)),3);
     33CData(:,:,3)=1 ;% initial color blue(rgb=[1 1 0])
     34
    3235CData(:,1:floor(advance_ratio*size(CData,2)),2)=0; % advancement part in red (suppress the second color component green)
    3336set(hwaitbar,'CData',CData)
Note: See TracChangeset for help on using the changeset viewer.