Changeset 974
- Timestamp:
- Nov 18, 2016, 7:14:06 PM (8 years ago)
- Location:
- trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/get_field.m
r924 r974 158 158 end 159 159 set(handles.SwitchVarIndexTime,'String',ListSwitchVarIndexTime) 160 set(handles.SwitchVarIndexTime,'UserData',ListSwitchVarIndexTime); % keep string in memory for check3D 160 161 set(handles.get_field,'UserData',Field);% record the finput field structure 161 162 SwitchVarIndexTime_Callback([], [], handles) … … 1045 1046 else% fields studied as 2D 1046 1047 status='off'; 1047 1048 end 1048 end 1049 1049 1050 set(handles.Coord_z,'Visible',status) 1050 1051 % set(handles.CheckDimensionZ,'Visible',status) 1051 1052 set(handles.Z_title,'Visible',status) 1052 1053 set(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 1054 set(handles.W_title,'Visible',status) 1055 if 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') 1057 1059 menu=get(handles.SwitchVarIndexTime,'String'); 1058 1060 val=find(strcmp('variable',menu)); 1059 1061 if ~isempty(val) 1060 1062 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 1068 else 1069 set(handles.SwitchVarIndexTime,'String',get(handles.SwitchVarIndexTime,'UserData')) 1070 end 1071 SwitchVarIndexTime_Callback(handles.SwitchVarIndexTime,[], handles) 1072 1065 1073 %------------------------------------------------------------------------ 1066 1074 % --- Executes on button press in OK. -
trunk/src/series/aver_synchro.m
r924 r974 200 200 sigma_sub=pi/Param.ActionInput.WavePeriod;%subharmonic 201 201 sinsub_V=0; 202 NbField=0; 202 203 vec_C=0; 203 204 204 205 %%%%%%%%%%%%%%%% loop on field indices %%%%%%%%%%%%%%%% 205 206 for index=1:nbfield 207 index 206 208 update_waitbar(WaitbarHandle,index/nbfield) 207 209 if ~isempty(RUNHandle)&& ~strcmp(get(RUNHandle,'BusyAction'),'queue') … … 220 222 end 221 223 %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 222 228 MeanU=MeanU+Data.U; 223 229 MeanV=MeanV+Data.V; … … 248 254 %%%%%%%%%%%%%%%%%%%%%%%% 249 255 Data.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'}; 251 257 %Data.ListVarName=[{'coord_y','coord_x'} Data.ListVarName]; 252 258 %Data.VarDimName={'coord_y', 'coord_x'}; … … 255 261 % Data.VarDimName{ilist}='nb_vectors'; 256 262 end 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); 263 Data.MeanU=MeanU./NbField; 264 Data.MeanV=MeanV./NbField; 265 cos1_U=cos1_U./NbField; 266 cos1_V=cos1_V./NbField; 267 sin1_U=sin1_U./NbField; 268 sin1_V=sin1_V./NbField; 269 cos2_U=cos2_U./NbField; 270 cos2_V=cos2_V./NbField; 271 sin2_U=sin2_U./NbField; 272 sin2_V=sin2_V./NbField; 273 cos3_U=cos3_U./NbField; 274 cos3_V=cos3_V./NbField; 275 sin3_U=sin3_U./NbField; 276 sin3_V=sin3_V./NbField; 277 cossub_U=cossub_U./NbField; 278 cossub_V=cossub_V./NbField; 279 sinsub_U=sinsub_U./NbField; 280 sinsub_V=sinsub_V./NbField; 281 Data.cos1_U=cos1_U; 282 Data.cos1_V=cos1_V; 283 Data.a1_U=sqrt(2)*sqrt(cos1_U.*cos1_U+sin1_U.*sin1_U); 284 Data.a1_V=-sqrt(2)*sqrt(cos1_V.*cos1_V+sin1_V.*sin1_V); 277 285 Data.a2_U=sqrt(2)*sqrt(cos2_U.*cos2_U+sin2_U.*sin2_U); 278 286 Data.a2_V=-sqrt(2)*sqrt(cos2_V.*cos2_V+sin2_V.*sin2_V); … … 281 289 Data.asub_U=sqrt(2)*sqrt(cossub_U.*cossub_U+sinsub_U.*sinsub_U); 282 290 Data.asub_V=-sqrt(2)*sqrt(cossub_V.*cossub_V+sinsub_V.*sinsub_V); 283 clear i291 % clear i 284 292 Data.phase1_U=(angle(cos1_U+i*sin1_U)); 293 285 294 Data.phase1_V=angle(cos1_V+i*sin1_V); 286 295 Data.phase2_U=(angle(cos2_U+i*sin2_U)); -
trunk/src/update_waitbar.m
r924 r974 28 28 pos=get(hwaitbar,'Position');%read waitbar position in pixels 29 29 set(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]) 32 CData=zeros(floor(pos(4)),floor(pos(3)),3); 33 CData(:,:,3)=1 ;% initial color blue(rgb=[1 1 0]) 34 32 35 CData(:,1:floor(advance_ratio*size(CData,2)),2)=0; % advancement part in red (suppress the second color component green) 33 36 set(hwaitbar,'CData',CData)
Note: See TracChangeset
for help on using the changeset viewer.