Changeset 413
- Timestamp:
- May 8, 2012, 2:27:50 PM (12 years ago)
- Location:
- trunk/src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/civ.m
r412 r413 3937 3937 3938 3938 %------------------------------------------------------------------------ 3939 % --- Executes on button press in TestCiv1: display image correlation function 3939 % --- Executes on button press in TestCiv1: prepare the image correlation function 3940 % activated by mouse motion 3940 3941 function TestCiv1_Callback(hObject, eventdata, handles) 3941 3942 %------------------------------------------------------------------------ 3942 set(handles.TestCiv1,'BackgroundColor',[1 1 0])3943 3943 drawnow 3944 3944 if get(handles.TestCiv1,'Value') 3945 ref_i=str2double(get(handles.ref_i,'String')); 3945 set(handles.TestCiv1,'BackgroundColor',[0.7 0.7 0.7])% paint TestCiv1 button to grey to confirm civ launch 3946 ref_i=str2double(get(handles.ref_i,'String'));% read reference i index 3946 3947 if strcmp(get(handles.ref_j,'Visible'),'on') 3947 ref_j=str2double(get(handles.ref_j,'String')); 3948 ref_j=str2double(get(handles.ref_j,'String'));% read reference j index if relevant 3948 3949 else 3949 ref_j=1;%default 3950 end 3951 [filecell,i1,i2 1,j1,j2,i1_civ2,i2_civ2,j1_civ2,j2_civ2,nom_type_nc,file_ref_fix1,file_ref_fix2]=...3952 set_civ_filenames(handles,ref_i,ref_j,[1 0 0 0 0 0]); 3950 ref_j=1;%default j index 3951 end 3952 [filecell,i1,i2,j1,j2,i1_civ2,i2_civ2,j1_civ2,j2_civ2,nom_type_nc,file_ref_fix1,file_ref_fix2]=... 3953 set_civ_filenames(handles,ref_i,ref_j,[1 0 0 0 0 0]);% get the corresponding file name and indices 3953 3954 Data.ListVarName={'ny','nx','A'}; 3954 3955 Data.VarDimName= {'ny','nx',{'ny','nx'}}; 3955 Data.A=imread(filecell.ima1.civ1{1}); 3956 Data.A=imread(filecell.ima1.civ1{1}); % read the first image 3956 3957 if ndims(Data.A)==3 %case of color image 3957 3958 Data.VarDimName= {'ny','nx',{'ny','nx','rgb'}}; … … 3959 3960 Data.ny=[size(Data.A,1) 1]; 3960 3961 Data.nx=[1 size(Data.A,2)]; 3962 Data.CoordUnit='pixel';% used to set equal scaling for x and y in image dispaly 3961 3963 par_civ1=read_GUI(handles.Civ1); 3962 3964 par_civ1.ImageWidth=size(Data.A,2); 3963 3965 par_civ1.ImageHeight=size(Data.A,1); 3964 3966 par_civ1.Mask='all';% will provide only the grid set for PIV, no image correlation 3965 par_civ1.i1= 1;%i1_civ1;3966 par_civ1.i2= 2;%i2_civ1;3967 par_civ1.i1=i1; 3968 par_civ1.i2=i2; 3967 3969 Param.Civ1=par_civ1; 3968 3970 Grid=civ_matlab(Param);% get the grid of x, y positions set for PIV … … 3986 3988 set(handles.TestCiv1,'BackgroundColor',[1 0 0]) 3987 3989 else 3990 set(handles.TestCiv1,'BackgroundColor',[1 0 0])% paint button to red 3988 3991 corrfig=findobj(allchild(0),'tag','corrfig');% look for a current figure for image correlation display 3989 3992 if ~isempty(corrfig) -
trunk/src/mouse_down.m
r410 r413 40 40 test_zoom=0; 41 41 end 42 test_piv=isfield(FigData,'CivHandle'); 42 43 43 44 %% look for parameters set by the GUI uvmat … … 52 53 test_edit=get(hhuvmat.edit_object,'Value');%test for object editing, third priority 53 54 test_edit_vect=get(hhuvmat.edit_vect,'Value');%test for vector editing, priority 4 54 test_create=isequal(get(hhuvmat.MenuObject,'checked'),'on');% test for object creation, priority 5 55 if test_create 56 hset_object=findobj(allchild(0),'tag','set_object'); 57 test_create=~isempty(hset_object)&&~test_edit; 58 end 55 % test_create=isequal(get(hhuvmat.MenuObject,'checked'),'on');% test for object creation, priority 5 56 % if test_create 57 test_create=0; 58 hset_object=findobj(allchild(0),'tag','set_object'); 59 if ~isempty(hset_object) 60 hPLOT=findobj(hset_object,'tag','PLOT'); 61 test_create=strcmp(get(hPLOT,'enable'),'on') &&~test_edit; 62 end 63 % test_create=~isempty(hset_object)&&~test_edit; 64 59 65 test_cal=isequal(get(hhuvmat.MenuCalib,'checked'),'on');% test for calibration 60 66 if test_cal% test for calibration popints, priority 6 … … 194 200 end 195 201 202 %% PIV test 203 if test_piv 204 figure 205 newaxes=axes; 206 copyobj(AxeData.CurrentCorrImage,newaxes); 207 set(newaxes,'CLim',[0 1]) 208 copyobj(AxeData.CurrentVector,newaxes) 209 copyobj(AxeData.TitleHandle,newaxes) 210 colorbar 211 end 212 196 213 %% selection of an existing projection object (third priority) 197 214 if test_edit && (isequal(tag_obj,'proj_object')||isequal(tag_obj,'DeformPoint')) -
trunk/src/mouse_motion.m
r399 r413 212 212 xround=Field.X(ind_pt); 213 213 yround=Field.Y(ind_pt); 214 par.Grid=[xround size(Field.A,1)-yround+1]; 214 % par.Grid=[xround size(Field.A,1)-yround+1]; 215 par.Grid=[xround yround]; 215 216 % mark the correlation box with a rectangle 216 217 par.ImageA=Field.A; … … 258 259 corrfig=findobj(allchild(0),'tag','corrfig'); 259 260 if ~isempty(corrfig) 260 set(0,'CurrentFigure',corrfig(1)) 261 set(0,'CurrentFigure',corrfig(1)) 261 262 AxeData.CurrentCorrImage=imagesc(rangx,-rangy,result_conv,[0 1]); 262 263 AxeData.CurrentVector=line([0 Data.Civ1_U],[0 Data.Civ1_V],'Tag','vector'); 264 AxeData.TitleHandle=title(num2str(par.Grid)); 263 265 colorbar 264 266 set(haxes,'UserData',AxeData) … … 270 272 set(AxeData.CurrentCorrImage,'YData',-rangy) 271 273 set(AxeData.CurrentVector,'XData',[0 Data.Civ1_U],'YData',[0 Data.Civ1_V]) 274 set(AxeData.TitleHandle,'String',num2str(par.Grid)) 272 275 end 273 276 end -
trunk/src/mouse_up.m
r410 r413 152 152 ProjData= proj_field(UvData.Field,ObjectData);%project the current interface field on ObjectData 153 153 if ~isempty(ProjData) 154 if strcmp(tagfig,'uvmat')% uvmat plot selected, projection plot seen on view_field154 if strcmp(tagfig,'uvmat')% uvmat plot selected, projection plot seen in view_field 155 155 hview_field=findobj(allchild(0),'tag','view_field'); 156 156 if isempty(hview_field) 157 hview_field=view_field; 157 hview_field=view_field(ProjData); 158 else 159 hhview_field=guidata(hview_field); 160 [PlotType,PlotParam]=plot_field(ProjData,hhview_field.axes3,read_GUI(hview_field));%update an existing field plot 161 write_plot_param(hhview_field,PlotParam); %update the display of plotting parameters for the current object 158 162 end 159 163 ViewFieldData=get(hview_field,'UserData'); 160 164 ViewFieldData.axes3=ProjData; 161 165 set(hview_field,'UserData',ViewFieldData) 162 hh_plotfield=guidata(hview_field);166 163 167 else 164 168 UvData.axes3=ProjData; 165 hh_plotfield=hhuvmat; 169 [PlotType,PlotParam]=plot_field(ProjData,hhuvmat.axes3,read_GUI(hhuvmat));%update an existing field plot 170 write_plot_param(hhuvmat,PlotParam); %update the display of plotting parameters for the current object 166 171 end 167 172 %[PlotType,PlotParam]=plot_field(ProjData,hh_plotfield.axes3,read_plot_param(hh_plotfield));%update an existing field plot 168 [PlotType,PlotParam]=plot_field(ProjData,hh_plotfield.axes3,read_GUI(hview_field));%update an existing field plot 169 write_plot_param(hh_plotfield,PlotParam); %update the display of plotting parameters for the current object 173 170 174 end 171 175 set(hhuvmat.edit_object,'BackgroundColor',[1 1 0]);% paint the edit text in yellow -
trunk/src/set_object.m
r410 r413 415 415 function PLOT_Callback(hObject, eventdata, handles) 416 416 417 %% reading the object selection in the GUI uvmat418 huvmat=findobj('tag','uvmat');%find the current uvmat GUI handle419 UvData=get(huvmat,'UserData');%Data associated to the GUI uvmat420 hhuvmat=guidata(huvmat);%handles of the objects children of the GUI uvmat421 ListObject=get(hhuvmat.ListObject,'String');% list of objects displyed in uvmat422 IndexObj(1)=get(hhuvmat.ListObject_1,'Value');% index of the selected object for display in uvmat423 if get(hhuvmat.ViewObject,'Value')424 IndexObj(2)=get(hhuvmat.ListObject,'Value');% index of the object, possibly selected for display in view_field425 end426 427 417 %% read the object parameters in the GUI set_object 428 418 ObjectData=read_GUI(handles.set_object);%read the parameters defining the object in the GUI set_object … … 438 428 ObjectName=ObjectData.Name;%name of the current object defined in set_object 439 429 if isempty(ObjectName) 440 % if get(hhuvmat.edit_object,'Value')% edit mode 441 % if isempty(ListObject) 442 % ObjectName='Plane'; 443 % else 444 % ObjectName=ListObject{IndexObj(end)};%take the name of the last (second) selected item 445 % end 446 % else %new object 447 ObjectName=ObjectData.Type; 448 % end 430 ObjectName=ObjectData.Type; 431 end 432 433 %% read the object selection in the GUI uvmat 434 huvmat=findobj('tag','uvmat');%find the current uvmat GUI handle 435 UvData=get(huvmat,'UserData');%Data associated to the GUI uvmat 436 hhuvmat=guidata(huvmat);%handles of the objects children of the GUI uvmat 437 ListObject=get(hhuvmat.ListObject_1,'String');% list of objects displayed in uvmat 438 IndexObj(1)=get(hhuvmat.ListObject_1,'Value');% index of the selected object for display in uvmat 439 if get(hhuvmat.ViewObject,'Value') && get(hhuvmat.edit_object,'Value') 440 IndexObj(2)=get(hhuvmat.ListObject,'Value');% index of the object, possibly selected for display in view_field 449 441 end 450 442 if ~get(hhuvmat.edit_object,'Value') %new object is being created … … 473 465 UvData.Object{IndexObj(2)}=[];%initiate a new object (empty yet) 474 466 end 475 testnew=0;476 if numel(IndexObj)==1 % if only one object is selected, the projection is in uvmat477 plotaxes=hhuvmat.axes3;%handle of axes3 in view_field478 else % if a second object is selected, the projection is in view_field, and this second object is selected479 hview_field=findobj(allchild(0),'tag','view_field');480 if isempty(hview_field)481 hview_field=view_field;%open the GUI view_field if it is not found482 end483 PlotHandles=guidata(hview_field);484 plotaxes=PlotHandles.axes3;%handle of axes3 in view_field485 end486 467 487 468 %% naming the object 488 ListObject{IndexObj(end),1}=ObjectName;489 set(hhuvmat.ListObject,'String',ListObject)490 set(hhuvmat.ListObject_1,'String',ListObject)469 % ListObject{IndexObj(end),1}=ObjectName; 470 % set(hhuvmat.ListObject,'String',ListObject) 471 % set(hhuvmat.ListObject_1,'String',ListObject) 491 472 492 473 %% update the object plot 493 % if testnew 494 % set(hhuvmat.ListObject,'Value',IndexObj) 495 % ObjectData.DisplayHandle_uvmat=hhuvmat.axes3; 496 % ObjectData.DisplayHandle_view_field=[]; 497 % else 498 if IndexObj(end)<=length(UvData.Object) && isfield(UvData.Object{IndexObj(end)},'DisplayHandle_uvmat')% save the previous object graph handles 499 ObjectData.DisplayHandle_uvmat=UvData.Object{IndexObj(end)}.DisplayHandle_uvmat; 500 else 501 ObjectData.DisplayHandle_uvmat=hhuvmat.axes3;%there is no object handle, than the axes handles is used as input 502 end 503 if isfield(UvData.Object{IndexObj(end)},'DisplayHandle_view_field')% save the previous object graph handles 504 ObjectData.DisplayHandle_view_field=UvData.Object{IndexObj(end)}.DisplayHandle_view_field; 505 else 506 ObjectData.DisplayHandle_view_field=[]; 507 end 508 % end 474 if IndexObj(end)<=length(UvData.Object) && isfield(UvData.Object{IndexObj(end)},'DisplayHandle_uvmat')% save the previous object graph handles 475 ObjectData.DisplayHandle_uvmat=UvData.Object{IndexObj(end)}.DisplayHandle_uvmat; 476 else 477 ObjectData.DisplayHandle_uvmat=hhuvmat.axes3;%there is no object handle, than the axes handles is used as input 478 end 479 if isfield(UvData.Object{IndexObj(end)},'DisplayHandle_view_field')% save the previous object graph handles 480 ObjectData.DisplayHandle_view_field=UvData.Object{IndexObj(end)}.DisplayHandle_view_field; 481 else 482 ObjectData.DisplayHandle_view_field=[]; 483 end 509 484 UvData.Object{IndexObj(end)}=ObjectData;%update the current object properties 510 485 if numel(IndexObj)==2 511 486 UvData.Object=update_obj(UvData,IndexObj(1),IndexObj(2)); 512 487 end 513 488 set(huvmat,'UserData',UvData) 514 489 515 %% plot the field projected on the object and store in the corresponding figue490 %% plot the field projected on the object 516 491 if strcmp(ObjectData.ProjMode,'mask_inside')||strcmp(ObjectData.ProjMode,'mask_outside')||strcmp(ObjectData.ProjMode,'none') 517 492 PlotType='text'; … … 521 496 msgbox_uvmat('ERROR', errormsg) 522 497 return 523 end 524 fighandle=get(plotaxes,'parent'); 525 PlotParam=read_GUI(fighandle); 526 PlotType=plot_field(ProjData,plotaxes,PlotParam);%update an existing field plot 498 end 499 if numel(IndexObj)==1 % if only one object is selected, the projection is in uvmat 500 % plotaxes=hhuvmat.axes3;%handle of axes3 in view_field 501 PlotType=plot_field(ProjData,hhuvmat.axes3,read_GUI(get(hhuvmat.axes3,'parent')));%update the current uvmat plot 502 else % if a second object is selected, the projection is in view_field, and this second object is selected 503 hview_field=findobj(allchild(0),'tag','view_field'); 504 if isempty(hview_field) 505 PlotType=view_field(ProjData); %open the view_field GUI for plot 506 % hview_field=view_field;%open the GUI view_field if it is not found 507 else 508 hhview_field=guidata(hview_field); 509 [PlotType,PlotParam]=plot_field(ProjData,hhview_field.axes3,read_GUI(hview_field));%update an existing plot in view_field 510 write_plot_param(hhview_field,PlotParam); %update the display of plotting parameters for the current object 511 end 512 % PlotHandles=guidata(hview_field); 513 % plotaxes=PlotHandles.axes3;%handle of axes3 in view_field 514 end 515 % fighandle=get(plotaxes,'parent'); 516 % PlotParam=read_GUI(fighandle); 517 % PlotType=plot_field(ProjData,plotaxes,PlotParam);%update an existing field plot 527 518 end 528 519 if strcmp(PlotType,'text') -
trunk/src/uvmat.m
r411 r413 2513 2513 return 2514 2514 end 2515 % if testnewseries && isfield(ObjectData,'CoordUnit')&& isfield(PlotParam{imap},'Coordinates')2516 % PlotParam{imap}.Coordinates=rmfield(PlotParam{imap}.Coordinates,'CheckFixEqual'); %set FixEqual to depend on the field (=1 if Data.CoordUnit=1 in plot_field)2517 % end2518 2515 if testnewseries && isfield(ObjectData,'CoordUnit') 2519 PlotParam{imap}.Coordinates.CheckFixEqual=1; 2516 PlotParam{imap}.Coordinates.CheckFixEqual=1;% set x and y scaling equal if CoordUnit is defined (common unit for x and y) 2520 2517 end 2521 2518 %use of mask (TODO: check) … … 4425 4422 hhset_object=guidata(hset_object); 4426 4423 set(hhset_object.PLOT,'enable','on')% activate the refresh button 4427 set(handles.MenuObject,'checked','on')4424 %set(handles.MenuObject,'checked','on') 4428 4425 set(handles.uvmat,'UserData',UvData) 4429 4426 set(handles.CheckZoom,'Value',0) %desactivate the zoom for object creation by the mouse … … 4456 4453 set(handles.edit_object,'Value',0); %suppress the object edit mode 4457 4454 set(handles.edit_object,'BackgroundColor',[0.7,0.7,0.7]) 4458 set(handles.MenuObject,'checked','on')4455 %set(handles.MenuObject,'checked','on') 4459 4456 set(handles.delete_object,'Visible','on') 4460 4457 -
trunk/src/view_field.m
r408 r413 92 92 AxeData.LimEditBox=1; %initialise AxeData, the parent figure sets plot parameters 93 93 set(handles.axes3,'UserData',AxeData) 94 if ~exist('Field','var') 95 return 96 end 97 [PlotType,PlotParamOut]= plot_field(Field,handles.axes3);%,PlotParam,KeepLim,PosColorbar) 98 99 if isfield(PlotParamOut,'Vectors') 100 set(handles.Vectors,'Visible','on') 101 end 102 write_plot_param(handles,PlotParamOut);% update the display of the plotting parameters 103 94 if exist('Field','var') 95 [PlotType,PlotParamOut]= plot_field(Field,handles.axes3);%,PlotParam,KeepLim,PosColorbar) 96 set(handles.Coordinates,'Visible','on') 97 if isfield(PlotParamOut,'Vectors') 98 set(handles.Vectors,'Visible','on') 99 end 100 write_plot_param(handles,PlotParamOut);% update the display of the plotting parameters 101 end 104 102 %------------------------------------------------------------------------ 105 103 % --- Outputs from this function are returned to the command menuline. … … 140 138 end 141 139 end 140 end 141 hciv=findobj(allchild(0),'Tag','civ');%find the current civ GUI 142 if ~isempty(hciv) 143 hhciv=guidata(hciv); 144 set(hhciv.TestCiv1,'Value',0)% desactivate TestCiv1 if on 145 set(hhciv.TestCiv1,'BackgroundColor',[1 0 0])% 146 end 147 corrfig=findobj(allchild(0),'tag','corrfig');% look for a civ correlation window used with TesCiv1 148 if ~isempty(corrfig) 149 delete(corrfig) 142 150 end 143 151 … … 317 325 if test 318 326 set(handles.CheckFixEqual,'BackgroundColor',[1 1 0]) 319 cla(handles.axes3)320 327 else 321 328 set(handles.CheckFixEqual,'BackgroundColor',[0.7 0.7 0.7]) … … 328 335 % --- Executes on button press in 'zoom'. 329 336 %------------------------------------------------------------------- 330 function zoom_Callback(hObject, eventdata, handles)331 if (get(handles. zoom,'Value') == 1);332 set(handles. zoom,'BackgroundColor',[1 1 0])333 set(handles. FixLimits,'Value',1)% propose by default fixed limits for the plotting axes334 set(handles. FixLimits,'BackgroundColor',[1 1 0])335 else 336 set(handles. zoom,'BackgroundColor',[0.7 0.7 0.7])337 end 338 339 % -------------------------------------------------------------------340 % ----Executes on button press in 'record': records the current flags of manual correction.341 % -------------------------------------------------------------------342 function record_Callback(hObject, eventdata, handles)343 % [filebase,num_i1,num_j1,num_i2,num_j2,Ext,NomType,SubDir]=read_input_file(handles);344 filename=read_file_boxes(handles);345 AxeData=get(gca,'UserData');346 [erread,message]=fileattrib(filename);347 if ~isempty(message) && ~isequal(message.UserWrite,1)348 msgbox_view_field('ERROR',['no writting access to ' filename])349 return350 end351 test_civ2=isequal(get(handles.civ2,'BackgroundColor'),[1 1 0]);352 test_civ1=isequal(get(handles.civ1,'BackgroundColor'),[1 1 0]);353 if ~test_civ2 && ~test_civ1354 msgbox_view_field('ERROR','manual correction only possible for CIV1 or CIV2 velocity fields')355 end356 if test_civ2357 nbname='nb_vectors2';358 flagname='vec2_FixFlag';359 attrname='fix2';360 end361 if test_civ1362 nbname='nb_vectors';363 flagname='vec_FixFlag';364 attrname='fix';365 end366 % write fix flags in the netcdf file367 hhh=which('netcdf.open');% look for built-in matlab netcdf library368 if ~isequal(hhh,'')% case of new builtin Matlab netcdf library369 nc=netcdf.open(filename,'NC_WRITE');370 netcdf.reDef(nc)371 netcdf.putAtt(nc,netcdf.getConstant('NC_GLOBAL'),attrname,1)372 dimid = netcdf.inqDimID(nc,nbname);373 try374 varid = netcdf.inqVarID(nc,flagname);% look for already existing fixflag variable375 catch376 varid=netcdf.defVar(nc,flagname,'double',dimid);%create fixflag variable if it does not exist377 end378 netcdf.endDef(nc)379 netcdf.putVar(nc,varid,AxeData.FF);380 netcdf.close(nc)381 else %old netcdf library382 netcdf_toolbox(filename,AxeData,attrname,nbname,flagname)383 end384 385 function netcdf_toolbox(filename,AxeData,attrname,nbname,flagname)386 nc=netcdf(filename,'write'); %open netcdf file387 result=redef(nc);388 eval(['nc.' attrname '=1;']);389 theDim=nc(nbname) ;% get the number of velocity vectors390 nb_vectors=size(theDim);391 var_FixFlag=ncvar(flagname,nc);% var_FixFlag will be written as the netcdf variable vec_FixFlag392 var_FixFlag(1:nb_vectors)=AxeData.FF;%393 fin=close(nc);337 function CheckZoom_Callback(hObject, eventdata, handles) 338 if (get(handles.CheckZoom,'Value') == 1); 339 set(handles.CheckZoom,'BackgroundColor',[1 1 0]) 340 set(handles.CheckFixLimits,'Value',1)% propose by default fixed limits for the plotting axes 341 set(handles.CheckFixLimits,'BackgroundColor',[1 1 0]) 342 else 343 set(handles.CheckZoom,'BackgroundColor',[0.7 0.7 0.7]) 344 end 345 346 % %------------------------------------------------------------------- 347 % %----Executes on button press in 'record': records the current flags of manual correction. 348 % %------------------------------------------------------------------- 349 % function record_Callback(hObject, eventdata, handles) 350 % % [filebase,num_i1,num_j1,num_i2,num_j2,Ext,NomType,SubDir]=read_input_file(handles); 351 % filename=read_file_boxes(handles); 352 % AxeData=get(gca,'UserData'); 353 % [erread,message]=fileattrib(filename); 354 % if ~isempty(message) && ~isequal(message.UserWrite,1) 355 % msgbox_view_field('ERROR',['no writting access to ' filename]) 356 % return 357 % end 358 % test_civ2=isequal(get(handles.civ2,'BackgroundColor'),[1 1 0]); 359 % test_civ1=isequal(get(handles.civ1,'BackgroundColor'),[1 1 0]); 360 % if ~test_civ2 && ~test_civ1 361 % msgbox_view_field('ERROR','manual correction only possible for CIV1 or CIV2 velocity fields') 362 % end 363 % if test_civ2 364 % nbname='nb_vectors2'; 365 % flagname='vec2_FixFlag'; 366 % attrname='fix2'; 367 % end 368 % if test_civ1 369 % nbname='nb_vectors'; 370 % flagname='vec_FixFlag'; 371 % attrname='fix'; 372 % end 373 % %write fix flags in the netcdf file 374 % hhh=which('netcdf.open');% look for built-in matlab netcdf library 375 % if ~isequal(hhh,'')% case of new builtin Matlab netcdf library 376 % nc=netcdf.open(filename,'NC_WRITE'); 377 % netcdf.reDef(nc) 378 % netcdf.putAtt(nc,netcdf.getConstant('NC_GLOBAL'),attrname,1) 379 % dimid = netcdf.inqDimID(nc,nbname); 380 % try 381 % varid = netcdf.inqVarID(nc,flagname);% look for already existing fixflag variable 382 % catch 383 % varid=netcdf.defVar(nc,flagname,'double',dimid);%create fixflag variable if it does not exist 384 % end 385 % netcdf.endDef(nc) 386 % netcdf.putVar(nc,varid,AxeData.FF); 387 % netcdf.close(nc) 388 % else %old netcdf library 389 % netcdf_toolbox(filename,AxeData,attrname,nbname,flagname) 390 % end 391 % 392 % function netcdf_toolbox(filename,AxeData,attrname,nbname,flagname) 393 % nc=netcdf(filename,'write'); %open netcdf file 394 % result=redef(nc); 395 % eval(['nc.' attrname '=1;']); 396 % theDim=nc(nbname) ;% get the number of velocity vectors 397 % nb_vectors=size(theDim); 398 % var_FixFlag=ncvar(flagname,nc);% var_FixFlag will be written as the netcdf variable vec_FixFlag 399 % var_FixFlag(1:nb_vectors)=AxeData.FF;% 400 % fin=close(nc); 394 401 395 402 … … 500 507 set_vec_col_bar(handles) 501 508 update_plot(handles) 502 %------------------------------------------------------------503 %update the slider values after displaying vectors504 %--------------------------------------------------------505 % function slider_update(handles,auto,minC,colcode1,colcode2,maxC)506 % set(handles.slider1,'Min',minC)507 % set(handles.slider1,'Max',maxC)508 % set(handles.slider2,'Min',minC)509 % set(handles.slider2,'Max',maxC)510 % set(handles.min_C_title_vec,'String',num2str(minC))511 % set(handles.max_vec,'String',num2str(maxC))512 % if auto513 % set(handles.colcode1,'String',num2str(colcode1,3))%update display514 % set(handles.colcode2,'String',num2str(colcode2,3))515 % end516 % set(handles.slider1,'Value',colcode1)%update slider with constant display517 % set(handles.slider2,'Value',colcode2)518 % set_vec_col_bar(handles)519 520 509 521 510 %------------------------------------------------------- … … 719 708 set(handles.vec_col_bar,'Cdata',A) 720 709 721 % %------------------------------------------------------------------------722 % function PlotType=update_plot(handles)723 % %------------------------------------------------------------------------724 % haxes= handles.axes3;725 %726 % %ProjField=get(haxes,'UserData');727 % ViewFieldData=get(handles.view_field,'UserData');728 % ProjField=ViewFieldData.axes3;729 % %ProjField=get(haxes,'UserData');730 % PlotParam=read_GUI(handles.view_field);731 % [PlotType,PlotParamOut]= plot_field(ProjField,haxes,PlotParam,1);732 % write_plot_param(handles,PlotParamOut); %update the auto plot parameters733 734 710 %------------------------------------------------------------------- 735 711 function update_plot(handles) … … 768 744 769 745 770 771 772 746 % --- Executes on selection change in ColorCode. 773 747 function ColorCode_Callback(hObject, eventdata, handles)
Note: See TracChangeset
for help on using the changeset viewer.