Changeset 526 for trunk/src/uvmat.m
- Timestamp:
- Aug 20, 2012, 12:32:31 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/uvmat.m
r525 r526 9 9 %INPUT: 10 10 % input: input file name (if character chain), or input image matrix to 11 % visualize, or Matlab structure representing netcdf field s (with fields11 % visualize, or Matlab structure representing netcdf fieldname (with fieldname 12 12 % ListVarName....) 13 13 % … … 42 42 % .MovieObject: current movie object 43 43 % .TimeUnit: unit for time 44 % .XmlData: cell array of 1 or 2 structures representing the xml files associated with the input field s(containing timing and geometry calibration)44 % .XmlData: cell array of 1 or 2 structures representing the xml files associated with the input fieldname (containing timing and geometry calibration) 45 45 % .Field: cell array of 1 or 2 structures representing the current input field(s) 46 46 % .PlotAxes: field structure representing the current field plotted on the main axes (used for mouse operations) … … 54 54 % 2) These functions call 'uvmat/display_file_name.m' which detects the file series, and fills the file index boxes 55 55 % 3) Then 'uvmat/update_rootinfo.m' Updates information about a new field series (indices to scan, timing, calibration from an xml file) 56 % 4) Then field sare opened and visualised by the main sub-function 'uvmat/refresh_field.m'56 % 4) Then fieldname are opened and visualised by the main sub-function 'uvmat/refresh_field.m' 57 57 % The function first reads the name of the input file(s) (one or two) from the edit boxes of the GUI 58 58 % It then reads the input file(s) with the function read_field.m and perform the following list of operations: … … 66 66 % Field{1} Field{2} 67 67 % | | 68 % --->transform fct<--- transform (e.g. phys.m) and combine input field s68 % --->transform fct<--- transform (e.g. phys.m) and combine input fieldname 69 69 % | 70 70 % (calc_tps.m) calculate tps coefficients (for filter projection or spatial derivatives). … … 77 77 % UvData.PlotAxes ViewData.PlotAxes (on view_field) 78 78 % | | 79 % plot_field.m (uvmat) plot_field.m (view_field) plot the projected field s79 % plot_field.m (uvmat) plot_field.m (view_field) plot the projected fieldname 80 80 % 81 81 % … … 200 200 % set(handles.ListObject_1,'Value',1)% default: empty projection objectproj_field 201 201 % set(handles.ListObject_1,'String',{''}) 202 set(handles.Field s,'Value',1)203 set(handles.Field s,'string',{''})202 set(handles.FieldName,'Value',1) 203 set(handles.FieldName,'string',{''}) 204 204 UvData.Object={[]}; 205 205 … … 294 294 testinputfield=1; 295 295 end 296 297 %% plot input field if exists298 % if testinputfield299 % %delete drawn objects300 % hother=findobj(handles.PlotAxes,'Tag','proj_object');%find all the proj objects301 % for iobj=1:length(hother)302 % delete_object(hother(iobj))303 % end304 % if isempty(inputfile)305 % errormsg=refresh_field(handles,[],[],[],[],[],[],{Field});306 % set(handles.MenuTools,'Enable','on')307 % set(handles.OBJECT_txt,'Visible','on')308 % set(handles.edit_object,'Visible','on')309 % % set(handles.ListObject_1,'Visible','on')310 % set(handles.frame_object,'Visible','on')311 % if ~isempty(errormsg)312 % msgbox_uvmat('ERROR',errormsg)313 % end314 % end315 % end316 296 317 297 set_vec_col_bar(handles) %update the display of color code for vectors … … 530 510 function SubDir_Callback(hObject, eventdata, handles) 531 511 %------------------------------------------------------------------------ 532 %refresh the menu of input field s512 %refresh the menu of input fieldname 533 513 Fields_Callback(hObject, eventdata, handles); 534 514 % refresh the current field view … … 779 759 if index==1 780 760 handles_RootPath=handles.RootPath; 781 handles_Fields=handles.Field s;761 handles_Fields=handles.FieldName; 782 762 elseif index==2 783 763 handles_RootPath=handles.RootPath_1; 784 handles_Fields=handles.Field s_1;764 handles_Fields=handles.FieldName_1; 785 765 end 786 766 787 767 set(handles_RootPath,'BackgroundColor',[1 1 0]) 788 768 drawnow 789 set(handles.Field s,'UserData',[])% reinialize data from uvmat opening769 set(handles.FieldName,'UserData',[])% reinialize data from uvmat opening 790 770 UvData=get(handles.uvmat,'UserData');%huvmat=handles of the uvmat interface 791 771 UvData.NewSeries=1; %flag for run0: begin a new series … … 990 970 end 991 971 992 %% set default options in menu 'Field s'972 %% set default options in menu 'FieldName' 993 973 switch FileType 994 974 case {'civx','civdata'} … … 1426 1406 %------------------------------------------------------------------------ 1427 1407 % --- Executes on button press in runplus: make one step forward and call 1428 % --- run0. The step forward is along the field sseries 1 or 2 depending on1408 % --- run0. The step forward is along the fieldname series 1 or 2 depending on 1429 1409 % --- the scan_i and scan_j check box (exclusive each other) 1430 1410 function runplus_Callback(hObject, eventdata, handles) … … 1446 1426 %------------------------------------------------------------------------ 1447 1427 % --- Executes on button press in runmin: make one step backward and call 1448 % --- run0. The step backward is along the field sseries 1 or 2 depending on1428 % --- run0. The step backward is along the fieldname series 1 or 2 depending on 1449 1429 % --- the scan_i and scan_j check box (exclusive each other) 1450 1430 function runmin_Callback(hObject, eventdata, handles) … … 1783 1763 set(handles.movie_pair,'BackgroundColor',[1 1 0])%paint the command button in yellow 1784 1764 drawnow 1785 list_fields=get(handles.Field s,'String');% list menu fields1786 index_fields=get(handles.Field s,'Value');% selected string index1765 list_fields=get(handles.FieldName,'String');% list menu fields 1766 index_fields=get(handles.FieldName,'Value');% selected string index 1787 1767 FieldName=list_fields{index_fields}; % selected field 1788 1768 UvData=get(handles.uvmat,'UserData'); … … 1792 1772 NomType=get(handles.NomType,'String'); 1793 1773 else 1794 list_fields=get(handles.Field s_1,'String');% list menu fields1795 index_fields=get(handles.Field s_1,'Value');% selected string index1774 list_fields=get(handles.FieldName_1,'String');% list menu fields 1775 index_fields=get(handles.FieldName_1,'Value');% selected string index 1796 1776 FieldName=list_fields{index_fields}; % selected field 1797 1777 if isequal(FieldName,'image') … … 2026 2006 ParamIn.ColorVar='';%default variable name for vector color 2027 2007 frame_index=1;%default 2028 % if ~isempty(FileName)2029 2008 FieldName='';%default 2030 2009 VelType='';%default 2031 % FileType=UvData.FileType{1};2032 2010 switch UvData.FileType{1} 2033 2011 case {'civx','civdata','netcdf'}; 2034 list_fields=get(handles.Field s,'String');% list menu fields2035 FieldName= list_fields{get(handles.Field s,'Value')}; % selected field2012 list_fields=get(handles.FieldName,'String');% list menu fields 2013 FieldName= list_fields{get(handles.FieldName,'Value')}; % selected field 2036 2014 if ~strcmp(FieldName,'get_field...') 2037 2015 if get(handles.FixVelType,'Value') … … 2075 2053 ParamIn.VelType=VelType; 2076 2054 XNameMenu=get(handles.Coord_x,'String'); 2077 ParamIn.Coord Name=XNameMenu{get(handles.Coord_x,'Value')};2055 ParamIn.Coord_x=XNameMenu(get(handles.Coord_x,'Value')); 2078 2056 YNameMenu=get(handles.Coord_y,'String'); 2079 ParamIn.Coord Name={ParamIn.CoordName, YNameMenu{get(handles.Coord_y,'Value')}};2057 ParamIn.Coord_y=YNameMenu(get(handles.Coord_y,'Value')); 2080 2058 end 2081 2059 check_tps = 0; … … 2115 2093 switch UvData.FileType{2} 2116 2094 case {'civx','civdata','netcdf'}; 2117 list_fields=get(handles.Field s_1,'String');% list menu fields2095 list_fields=get(handles.FieldName_1,'String');% list menu fields 2118 2096 if ischar(list_fields),list_fields={list_fields};end 2119 FieldName_1= list_fields{get(handles.Field s_1,'Value')}; % selected field2097 FieldName_1= list_fields{get(handles.FieldName_1,'Value')}; % selected field 2120 2098 if ~strcmp(FieldName,'get_field...') 2121 2099 if get(handles.FixVelType,'Value') … … 2220 2198 set(handles.VelType,'Visible','off') 2221 2199 end 2222 % display the Field smenu from the input file and pick the selected one:2200 % display the FieldName menu from the input file and pick the selected one: 2223 2201 % if isstruct(ParamOut) 2224 2202 % field_index=strcmp(ParamOut.FieldName,ParamOut.FieldList); 2225 % set(handles.Field s,'String',ParamOut.FieldList); %update the field menu2226 % set(handles.Field s,'Value',find(field_index,1))2203 % set(handles.FieldName,'String',ParamOut.FieldList); %update the field menu 2204 % set(handles.FieldName,'Value',find(field_index,1)) 2227 2205 % end 2228 2206 … … 2230 2208 test_veltype_1=0; 2231 2209 if isempty(FileName_1) 2232 % set(handles.Field s_1,'Value',1); %update the field menu2210 % set(handles.FieldName_1,'Value',1); %update the field menu 2233 2211 % if isstruct(ParamOut) 2234 % set(handles.Field s_1,'String',[{''};ParamOut.FieldList]); %update the field menu2212 % set(handles.FieldName_1,'String',[{''};ParamOut.FieldList]); %update the field menu 2235 2213 % end 2236 2214 elseif ~test_keepdata_1 … … 2247 2225 % update the second field menu: the same quantity 2248 2226 if isstruct(ParamOut_1) 2249 set(handles.Field s_1,'String',[{''};ParamOut_1.FieldList]); %update the field menu2250 % display the Field smenu from the input file and pick the selected one:2227 set(handles.FieldName_1,'String',[{''};ParamOut_1.FieldList]); %update the field menu 2228 % display the FieldName menu from the input file and pick the selected one: 2251 2229 field_index=strcmp(ParamOut_1.FieldName,ParamOut_1.FieldList); 2252 set(handles.Field s_1,'Value',find(field_index,1)+1)2230 set(handles.FieldName_1,'Value',find(field_index,1)+1) 2253 2231 end 2254 2232 … … 2261 2239 2262 2240 % field_index=strcmp(ParamOut_1.FieldName,ParamOut_1.FieldList); 2263 % set(handles.Field s,'String',ParamOut.FieldList); %update the field menu2264 % set(handles.Field s,'Value',find(field_index,1))2241 % set(handles.FieldName,'String',ParamOut.FieldList); %update the field menu 2242 % set(handles.FieldName,'Value',find(field_index,1)) 2265 2243 2266 2244 %% introduce w as background image by default for a new series (only for nbdim=2) … … 2277 2255 set(handles.FileIndex_1,'String',indices) 2278 2256 set(handles.FileExt_1,'String','"'); 2279 set(handles.Field s_1,'Visible','on');2280 set(handles.Field s_1,'Visible','on');2257 set(handles.FieldName_1,'Visible','on'); 2258 set(handles.FieldName_1,'Visible','on'); 2281 2259 set(handles.RootPath_1,'Visible','on') 2282 2260 set(handles.RootFile_1,'Visible','on') … … 2284 2262 set(handles.FileIndex_1,'Visible','on'); 2285 2263 set(handles.FileExt_1,'Visible','on'); 2286 set(handles.Field s_1,'Visible','on');2264 set(handles.FieldName_1,'Visible','on'); 2287 2265 Field{1}.AName='w'; 2288 2266 end … … 2364 2342 2365 2343 2366 %% store the current open names, field sand vel types in uvmat interface2344 %% store the current open names, fieldname and vel types in uvmat interface 2367 2345 UvData.FileName_1=FileName_1; 2368 2346 UvData.ParamOut_1=ParamOut_1; … … 2589 2567 write_plot_param(handles,PlotParamOut) %update the auto plot parameters 2590 2568 2591 %% 2D or 3D field sare generally projected2569 %% 2D or 3D fieldname are generally projected 2592 2570 else 2593 2571 set(handles.Objects,'Visible','on') … … 3010 2988 set(handles.FileIndex_1,'Visible','off'); 3011 2989 set(handles.FileExt_1,'Visible','off'); 3012 set(handles.Field s_1,'Value',1);%set to blank state2990 set(handles.FieldName_1,'Value',1);%set to blank state 3013 2991 set(handles.VelType_1,'Value',1);%set to blank state 3014 2992 set(handles.num_Opacity,'String','')% desactivate opacity setting … … 3076 3054 end 3077 3055 %------------------------------------------------------------------------ 3078 % --- Executes on menu selection Field s3079 function Field s_Callback(hObject, eventdata, handles)3080 %------------------------------------------------------------------------ 3081 list_fields=get(handles.Field s,'String');% list menu fields3082 index_fields=get(handles.Field s,'Value');% selected string index3056 % --- Executes on menu selection FieldName 3057 function FieldName_Callback(hObject, eventdata, handles) 3058 %------------------------------------------------------------------------ 3059 list_fields=get(handles.FieldName,'String');% list menu fields 3060 index_fields=get(handles.FieldName,'Value');% selected string index 3083 3061 field= list_fields{index_fields(1)}; % selected string 3084 3062 if isequal(field,'get_field...') … … 3092 3070 delete(hget_field) 3093 3071 end 3094 hget_field=get_field(FileName); 3095 % set(hget_field,'Name','get_field') 3096 % hhget_field=guidata(hget_field); 3097 % set(hhget_field.list_fig,'Value',1) 3098 % set(hhget_field.list_fig,'String',{'uvmat'}) 3099 % set(handles.transform_fct,'Value',1)% no transform by default 3100 % set(handles.path_transform,'String','') 3072 get_field(FileName); 3101 3073 return %no further action 3102 3074 end … … 3151 3123 3152 3124 %common to Fields_1_Callback 3153 list_fields_1=get(handles.Field s_1,'String');% list menu fields3125 list_fields_1=get(handles.FieldName_1,'String');% list menu fields 3154 3126 field_1=''; 3155 3127 if ~isempty(list_fields_1) 3156 field_1= list_fields_1{get(handles.Field s_1,'Value')}; % selected string3128 field_1= list_fields_1{get(handles.FieldName_1,'Value')}; % selected string 3157 3129 end 3158 3130 if isequal(field,'image')||isequal(field_1,'image') … … 3172 3144 3173 3145 %--------------------------------------------------- 3174 % --- Executes on menu selection Field s3175 function Field s_1_Callback(hObject, eventdata, handles)3146 % --- Executes on menu selection FieldName 3147 function FieldName_1_Callback(hObject, eventdata, handles) 3176 3148 %------------------------------------------------- 3177 3149 %% read input data … … 3185 3157 end 3186 3158 UvData.FileName_1='';% desactivate the use of a constant second file 3187 list_fields=get(handles.Field s,'String');% list menu fields3188 field= list_fields{get(handles.Field s,'Value')}; % selected string3189 list_fields=get(handles.Field s_1,'String');% list menu fields3190 field_1= list_fields{get(handles.Field s_1,'Value')}; % selected string for the second field3159 list_fields=get(handles.FieldName,'String');% list menu fields 3160 field= list_fields{get(handles.FieldName,'Value')}; % selected string 3161 list_fields=get(handles.FieldName_1,'String');% list menu fields 3162 field_1= list_fields{get(handles.FieldName_1,'Value')}; % selected string for the second field 3191 3163 if isempty(field_1)%||(numel(UvData.FileType)>=2 && strcmp(UvData.FileType{2},'image')) 3192 3164 set(handles.SubField,'Value',0) … … 4837 4809 series; %first display of the GUI to fill waiting time 4838 4810 [RootPath,SubDir,RootFile,FileIndex,FileExt]=read_file_boxes(handles); 4839 param.FileName=[fullfile(RootPath,SubDir,RootFile) FileIndex FileExt]; 4811 Param.FileName=[fullfile(RootPath,SubDir,RootFile) FileIndex FileExt];%first input file name 4840 4812 if isequal(get(handles.SubField,'Value'),1) 4841 4813 [RootPath_1,SubDir_1,RootFile_1,FileIndex_1,FileExt_1]=read_file_boxes_1(handles); 4842 4814 FileName_1=[fullfile(RootPath_1,SubDir_1,RootFile_1) FileIndex_1 FileExt_1]; 4843 if ~isequal(FileName_1,param.FileName) 4844 param.FileName_1=FileName_1; 4845 end 4846 end 4847 param.NomType=get(handles.NomType,'String'); 4848 param.NomType_1=get(handles.NomType_1,'String'); 4849 param.CheckFixPair=get(handles.CheckFixPair,'Value'); 4850 huvmat=get(handles.MenuSeries,'parent'); 4851 UvData=get(huvmat,'UserData'); 4815 if ~isequal(FileName_1,Param.FileName) 4816 Param.FileName_1=FileName_1;%second input file name if relevant 4817 end 4818 end 4819 Param.NomType=get(handles.NomType,'String'); 4820 Param.NomType_1=get(handles.NomType_1,'String'); 4821 Param.CheckFixPair=get(handles.CheckFixPair,'Value'); 4822 UvData=get(handles.uvmat,'UserData'); 4852 4823 if isfield(UvData,'XmlData')&& isfield(UvData.XmlData{1},'Time') 4853 param.Time=UvData.XmlData{1}.Time;4824 Param.Time=UvData.XmlData{1}.Time; 4854 4825 end 4855 4826 if isequal(get(handles.scan_i,'Value'),1) 4856 param.incr_i=str2num(get(handles.num_IndexIncrement,'String'));4827 Param.incr_i=str2num(get(handles.num_IndexIncrement,'String')); 4857 4828 elseif isequal(get(handles.scan_j,'Value'),1) 4858 param.incr_j=str2num(get(handles.num_IndexIncrement,'String')); 4859 end 4860 param.list_fields=get(handles.Fields,'String');% list menu fields 4861 FieldName=param.list_fields{get(handles.Fields,'Value')}; 4862 ind_image=find(strcmp('image',param.list_fields)); 4863 if ~isempty(ind_image) && numel(param.list_fields)>1 4864 param.list_fields(ind_image)=[]; %suppress 'image' option 4865 end 4866 param.index_fields=find(strcmp(FieldName,param.list_fields));% selected string index 4867 % if param.index_fields>1 4868 % param.index_fields=param.index_fields-1; 4869 % end 4870 param.list_fields_1=get(handles.Fields_1,'String');% list menu fields 4871 if ischar(param.list_fields_1),param.list_fields_1={param.list_fields_1};end 4872 FieldName_1=param.list_fields_1{get(handles.Fields_1,'Value')}; 4873 ind_image=find(strcmp('image',param.list_fields_1)); 4874 if ~isempty(ind_image) && numel(param.list_fields_1)>1 4875 param.list_fields_1(ind_image)=[]; %suppress 'image' option 4876 end 4877 param.index_fields_1=find(strcmp(FieldName_1,param.list_fields_1));% selected string index 4878 %param.index_fields=find(strcmp(FieldName,param.list_fields));% selected string index 4879 % param.index_fields_1=get(handles.Fields_1,'Value')-1;% selected string index 4880 % if param.index_fields_1>1 4881 % param.index_fields_1=param.index_fields_1-1; 4882 % end 4883 param.menu_coord_str=get(handles.transform_fct,'String'); 4884 param.menu_coord_val=get(handles.transform_fct,'Value'); 4885 series(param); %run the series interface 4829 Param.incr_j=str2num(get(handles.num_IndexIncrement,'String')); 4830 end 4831 4832 %% transfer fields and coordinate names 4833 Param.list_fields=get(handles.FieldName,'String');% list menu fields 4834 FieldName=Param.list_fields{get(handles.FieldName,'Value')}; 4835 ind_image=find(strcmp('image',Param.list_fields)); 4836 if ~isempty(ind_image) && numel(Param.list_fields)>1 4837 Param.list_fields(ind_image)=[]; %suppress 'image' option 4838 end 4839 Param.index_fields=find(strcmp(FieldName,Param.list_fields));% selected string index 4840 Param.list_fields_1=get(handles.FieldName_1,'String');% list menu fields 4841 if ischar(Param.list_fields_1),Param.list_fields_1={Param.list_fields_1};end 4842 FieldName_1=Param.list_fields_1{get(handles.FieldName_1,'Value')}; 4843 ind_image=find(strcmp('image',Param.list_fields_1)); 4844 if ~isempty(ind_image) && numel(Param.list_fields_1)>1 4845 Param.list_fields_1(ind_image)=[]; %suppress 'image' option 4846 end 4847 Param.index_fields_1=find(strcmp(FieldName_1,Param.list_fields_1));% selected string index 4848 Param.transform_str=get(handles.transform_fct,'String'); 4849 Param.transform_val=get(handles.transform_fct,'Value'); 4850 Param.Coord_x_str=get(handles.Coord_x,'String'); 4851 Param.Coord_x_val=get(handles.Coord_x,'Value'); 4852 Param.Coord_y_str=get(handles.Coord_y,'String'); 4853 Param.Coord_y_val=get(handles.Coord_y,'Value'); 4854 series(Param); %run the series interface 4886 4855 4887 4856 %------------------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.