Changeset 581 for trunk/src/uvmat.m
- Timestamp:
- Mar 12, 2013, 12:52:13 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/uvmat.m
r580 r581 68 68 % --->transform fct<--- transform (e.g. phys.m) and combine input fieldname 69 69 % | 70 % ( calc_tps.m) calculate tps coefficients (for filter projection or spatial derivatives).70 % (tps_coeff_field.m) calculate tps coefficients (for filter projection or spatial derivatives). 71 71 % | 72 72 % UvData.Field-------------->histogram … … 1022 1022 switch FileType 1023 1023 case {'civx','civdata'} 1024 [FieldList,ColorList]=calc_field; 1024 % [FieldList,ColorList]=calc_field; 1025 [FieldList,ColorList]=set_field_list('U','V','C'); 1025 1026 set(handles_Fields,'String',[{'image'};FieldList;{'get_field...'}]);%standard menu for civx data 1026 1027 set(handles_Fields,'Value',2) % set menu to 'velocity … … 2046 2047 if (strcmp(UvData.FileType{1},'civdata')||strcmp(UvData.FileType{1},'civx')) 2047 2048 for iobj=1:numel(UvData.Object) 2048 if isfield(UvData.Object{iobj},'ProjMode')&& strcmp(UvData.Object{iobj}.ProjMode,' filter')2049 if isfield(UvData.Object{iobj},'ProjMode')&& strcmp(UvData.Object{iobj}.ProjMode,'interp_tps') 2049 2050 check_proj_tps=1; 2050 2051 break … … 2438 2439 2439 2440 %% calculate tps coefficients if needed 2440 UvData.Field= calc_tps(UvData.Field,check_proj_tps);2441 UvData.Field=tps_coeff_field(UvData.Field,check_proj_tps); 2441 2442 2442 2443 %% analyse input field … … 3042 3043 function FieldName_Callback(hObject, eventdata, handles) 3043 3044 %------------------------------------------------------------------------ 3045 UvData=get(handles.uvmat,'UserData'); 3044 3046 list_fields=get(handles.FieldName,'String');% list menu fields 3045 3047 index_fields=get(handles.FieldName,'Value');% selected string index 3046 3048 field= list_fields{index_fields(1)}; % selected string 3049 3050 %% fill the coordinates and variables from selections in get_field 3047 3051 if isequal(field,'get_field...') 3052 if strcmp(get(handles.VelType,'Visible'),'on') 3053 % we use the civ choice as default input 3054 ParamIn.SwitchVarIndexTime='attribute'; 3055 ListVelType=get(handles.VelType,'String'); 3056 VelType=ListVelType{get(handles.VelType,'Value')}; 3057 switch VelType 3058 case 'civ1' 3059 ParamIn.TimeVarName='Civ1_Time'; 3060 ParamIn.vector_x='Civ1_U'; 3061 ParamIn.vector_y='Civ1_V'; 3062 case 'filter1' 3063 ParamIn.TimeVarName='Civ1_Time'; 3064 ParamIn.vector_x='Civ1_U_smooth'; 3065 ParamIn.vector_y='Civ1_V_smooth'; 3066 case 'civ2' 3067 ParamIn.TimeVarName='Civ2_Time'; 3068 ParamIn.vector_x='Civ2_U'; 3069 ParamIn.vector_y='Civ2_V'; 3070 case 'filter2' 3071 ParamIn.TimeVarName='Civ2_Time'; 3072 ParamIn.vector_x='Civ2_U_smooth'; 3073 ParamIn.vector_y='Civ2_V_smooth'; 3074 end 3075 end 3048 3076 set(handles.FixVelType,'visible','off') 3049 set(handles.VelType,' visible','off')3050 set(handles.VelType_1,' visible','off')3077 set(handles.VelType,'Visible','off') 3078 set(handles.VelType_1,'Visible','off') 3051 3079 [RootPath,SubDir,RootFile,FileIndices,FileExt]=read_file_boxes(handles); 3052 3080 FileName=[fullfile(RootPath,SubDir,RootFile) FileIndices FileExt]; 3053 hget_field=findobj(allchild(0),'name','get_field'); 3054 if ~isempty(hget_field) 3055 delete(hget_field) 3056 end 3057 get_field(FileName); 3081 % hget_field=findobj(allchild(0),'name','get_field'); 3082 % if ~isempty(hget_field) 3083 % delete(hget_field) 3084 % end 3085 GetFieldData=get_field(FileName,ParamIn); 3086 FieldList={}; 3087 VecColorList={}; 3088 XName=''; 3089 YName=''; 3090 if GetFieldData.CheckVector 3091 UName=GetFieldData.PanelVectors.vector_x; 3092 VName=GetFieldData.PanelVectors.vector_y; 3093 XName=GetFieldData.PanelVectors.coord_x_vectors; 3094 YName=GetFieldData.PanelVectors.coord_y_vectors; 3095 CName=GetFieldData.PanelVectors.vec_color; 3096 [FieldList,VecColorList]=set_field_list(UName,VName,CName); 3097 % FieldList={['vec(' UName ',' VName ')'];... 3098 % ['norm(' UName ',' VName ')'];... 3099 % ['curl(' UName ',' VName ')'];... 3100 % ['div(' UName ',' VName ')'];... 3101 % ['strain(' UName ',' VName ')']}; 3102 % VecColorList={['norm(' UName ',' VName ')'];... 3103 % UName;... 3104 % VName};... 3105 % if ~isempty(CName) 3106 % VecColorList=[{CName};VecColorList]; 3107 % end 3108 end 3109 if GetFieldData.CheckScalar 3110 AName=GetFieldData.PanelScalar.scalar; 3111 XName=GetFieldData.PanelScalar.coord_x_scalar; 3112 YName=GetFieldData.PanelScalar.coord_y_scalar; 3113 FieldList={AName}; 3114 end 3115 if GetFieldData.CheckPlot1D 3116 XName=GetFieldData.CheckPlot1D.abscissa; 3117 YName=GetFieldData.CheckPlot1D.ordinate; 3118 end 3119 set(handles.Coord_x,'String',{XName}) 3120 set(handles.Coord_y,'String',{YName}) 3121 set(handles.FieldName,'Value',1) 3122 set(handles.FieldName,'String',[FieldList; {'get_field...'}]); 3123 set(handles.ColorScalar,'Value',1) 3124 set(handles.ColorScalar,'String',VecColorList); 3125 UvData.FileType{1}='netcdf'; 3126 set(handles.uvmat,'UserData',UvData) 3127 run0_Callback(hObject, eventdata, handles) 3058 3128 return %no further action 3059 3129 end 3060 3130 3061 UvData=get(handles.uvmat,'UserData'); 3131 3062 3132 3063 3133 %read the rootfile input display … … 3107 3177 indices=fullfile_uvmat('','','','',NomType,i1,i2,j1,j2); 3108 3178 set(handles.FileIndex,'String',indices) 3109 % set(handles.NomType,'String',NomType)3110 3179 3111 3180 %common to Fields_1_Callback … … 3413 3482 % 3414 3483 if isequal(get(handles.edit_vect,'Value'),1) 3415 test_civ2=isequal(get(handles.civ2,'BackgroundColor'),[1 1 0]);3416 test_civ1=isequal(get(handles.VelType,'BackgroundColor'),[1 1 0]);3417 if ~ test_civ2 && ~test_civ13484 VelTypeMenu=get(handles.VelType,'String'); 3485 VelType=VelTypeMenu{get(handles.VelType,'Value')}; 3486 if ~strcmp(VelType,'civ2') && ~strcmp(VelType,'civ1') 3418 3487 msgbox_uvmat('ERROR','manual correction only possible for CIV1 or CIV2 velocity fields') 3419 3488 end … … 3814 3883 function CheckDecimate4_Callback(hObject, eventdata, handles) 3815 3884 %------------------------------------------------------------------------ 3885 if isequal(get(handles.CheckDecimate4,'Value'),1) 3886 set(handles.CheckDecimate16,'Value',0) 3887 end 3888 update_plot(handles); 3889 3890 %------------------------------------------------------------------------ 3891 % --- Executes on selection change in CheckDecimate16 (nb_vec/16). 3892 function CheckDecimate16_Callback(hObject, eventdata, handles) 3893 %------------------------------------------------------------------------ 3894 if isequal(get(handles.CheckDecimate16,'Value'),1) 3895 set(handles.CheckDecimate4,'Value',0) 3896 end 3816 3897 update_plot(handles); 3817 3898 … … 4341 4422 % -------------------------------------------------------------------- 4342 4423 function MenuExportAxis_Callback(hObject, eventdata, handles) 4343 answer=msgbox_uvmat('CONFIRMATION','select a figure/axis on which the current uvmat plot will be exported') 4344 if strcmp(answer,'Yes') 4345 hchild=get(handles.PlotAxes,'children'); 4346 copyobj(hchild,gca); 4347 end 4424 ListFig=findobj(allchild(0),'Type','figure'); 4425 nb_option=0; 4426 menu={}; 4427 for ilist=1:numel(ListFig) 4428 FigName=get(ListFig(ilist),'name'); 4429 if isempty(FigName) 4430 FigName=['figure ' num2str(ListFig(ilist))]; 4431 end 4432 if ~strcmp(FigName,'uvmat') 4433 ListAxes=findobj(ListFig(ilist),'Type','axes'); 4434 ListTags=get(ListAxes,'Tag'); 4435 if ~isempty(ListTags) && ~isempty(find(~strcmp('Colorbar',ListTags), 1)) 4436 ListAxes=ListAxes(~strcmp('Colorbar',ListTags)); 4437 if numel(ListAxes)==1 4438 nb_option=nb_option+1; 4439 menu{nb_option}=FigName ; 4440 AxesHandle(nb_option)=ListAxes; 4441 else 4442 nb_axis=0; 4443 for iaxes=1:numel(ListAxes) 4444 nb_axis=nb_axis+1; 4445 nb_option=nb_option+1; 4446 menu{nb_option}=[FigName '_' num2str(nb_axis)]; 4447 AxesHandle(nb_option)=ListAxes(nb_axis); 4448 end 4449 end 4450 end 4451 end 4452 end 4453 if isempty(menu) 4454 answer=msgbox_uvmat('INPUT_Y-N','no existing plotting axes available, create new figure?'); 4455 if strcmp(answer,'Yes') 4456 hfig=figure; 4457 copyobj(handles.PlotAxes,hfig); 4458 else 4459 return 4460 end 4461 map=colormap(handles.PlotAxes); 4462 colormap(map);%transmit the current colormap to the zoom fig 4463 colorbar 4464 else 4465 answer=msgbox_uvmat('INPUT_MENU','select a figure/axis on which the current uvmat plot will be exported',menu); 4466 if isempty(answer) 4467 return 4468 else 4469 axes(AxesHandle(answer)) 4470 hold on 4471 hchild=get(handles.PlotAxes,'children'); 4472 copyobj(hchild,gca); 4473 end 4474 end 4475 4348 4476 4349 4477 %------------------------------------------------------------------------ … … 4505 4633 %------------------------------------------------------------------------ 4506 4634 data.Type='volume'; 4507 data.ProjMode='interp ';%default4635 data.ProjMode='interp_lin';%default 4508 4636 data.ProjModeMenu={}; 4509 4637 % set(handles.create,'Visible','on') … … 5019 5147 % --- Executes on button press in CheckColorBar. 5020 5148 function CheckColorBar_Callback(hObject, eventdata, handles) 5149
Note: See TracChangeset
for help on using the changeset viewer.