Changeset 771
- Timestamp:
- May 3, 2014, 5:20:29 PM (11 years ago)
- Location:
- trunk/src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/get_field.m
r764 r771 169 169 set(handles.FieldOption,'value',1) 170 170 if isfield(Field,'Conventions')&& strcmp(Field.Conventions,'uvmat/civdata') 171 set(handles.FieldOption,'String',{' pick variables';'civdata...'})171 set(handles.FieldOption,'String',{'scalar';'vectors';'civdata...'}) 172 172 else 173 set(handles.FieldOption,'String',{' pick variables'})173 set(handles.FieldOption,'String',{'scalar';'vectors'}) 174 174 end 175 175 checkseries=1; … … 247 247 set(hObject,'Position',pos_view_field) 248 248 set(handles.get_field,'WindowStyle','modal')% Make the GUI modal 249 if isfield(ParamIn,'Title') 250 set(hObject,'Name',ParamIn.Title) 251 end 249 252 250 253 %% set z coordinate menu if relevant … … 407 410 ordinate_Callback(hObject, eventdata, handles) 408 411 409 case {'scalar' ,'pick variables'}412 case {'scalar'} 410 413 set(handles.Coordinates,'Visible','on') 411 414 set(handles.PanelOrdinate,'Visible','off') … … 958 961 case '1D plot' 959 962 960 case {'scalar' ,'pick variables'}963 case {'scalar'} 961 964 scalar_Callback(hObject, eventdata, handles) 962 965 case 'vectors' -
trunk/src/get_file_type.m
r752 r771 17 17 % fileinput: name, including path, of the file to analyse 18 18 function [FileType,FileInfo,VideoObject]=get_file_type(fileinput) 19 20 FileInfo=[]; 19 %%%% TODO: suppress the output argument FileType, contained in FileInfo %%%% 20 FileInfo=[];% will remain empty in the absence of input file 21 21 VideoObject=[]; 22 22 if exist(fileinput,'file') 23 FileInfo.FileName=fileinput; 24 FileInfo.FileType='txt'; %default 23 25 FileType='txt';%default, text file 24 26 else … … 30 32 switch FileExt 31 33 case '.fig' 34 FileInfo.FileType='figure'; 32 35 FileType='figure'; 33 36 case '.xml' 37 FileInfo.FileType='xml'; 34 38 FileType='xml'; 35 39 case '.xls' 40 FileInfo.FileType='xls'; 36 41 FileType='xls'; 37 42 otherwise … … 51 56 FileInfo.NumberOfFrames=1; 52 57 end 58 FileInfo.FileName=FileInfo.Filename; %correct the info given by imfinfo 59 FileInfo.FileType=FileType; 53 60 end 54 61 else 55 62 error_nc=0; 56 63 try 57 [Data,tild,tild,errormsg]=nc2struct(fileinput,'ListGlobalAttribute','absolut_time_T0','Conventions',... 58 'CivStage','patch2','fix2','civ2','patch','fix','hart'); 64 % [Data,tild,tild,errormsg]=nc2struct(fileinput,'ListGlobalAttribute','absolut_time_T0','Conventions',... 65 % 'CivStage','patch2','fix2','civ2','patch','fix','hart'); 66 [Data,tild,tild,errormsg]=nc2struct(fileinput,[]); 59 67 if ~isempty(errormsg) 60 68 error_nc=1; 61 69 else 62 if ~isempty(Data.absolut_time_T0') && ~isempty(Data.hart) 70 if isfield(Data,'absolut_time_T0') && isfield(Data,'hart') && ~isempty(Data.absolut_time_T0) && ~isempty(Data.hart) 71 FileInfo.FileType='civx'; 63 72 FileType='civx'; % test for civx velocity fields 64 if is equal(Data.patch2,1)73 if isfield(Data,'patch2') && isequal(Data.patch2,1) 65 74 FileInfo.CivStage=6; 66 elseif is equal(Data.fix2,1)75 elseif isfield(Data,'fix2') && isequal(Data.fix2,1) 67 76 FileInfo.CivStage=5; 68 elseif is equal(Data.civ2,1)77 elseif isfield(Data,'civ2')&& isequal(Data.civ2,1) 69 78 FileInfo.CivStage=4; 70 elseif is equal(Data.patch,1)79 elseif isfield(Data,'patch')&&isequal(Data.patch,1) 71 80 FileInfo.CivStage=3; 72 elseif is equal(Data.fix,1)81 elseif isfield(Data,'fix')&&isequal(Data.fix,1) 73 82 FileInfo.CivStage=2; 74 83 else 75 84 FileInfo.CivStage=1; 76 85 end 77 elseif strcmp(Data.Conventions,'uvmat/civdata') 86 elseif isfield(Data,'Conventions') && strcmp(Data.Conventions,'uvmat/civdata') 87 FileInfo.FileType='civdata'; % test for civx velocity fields 78 88 FileType='civdata'; % test for civx velocity fields 79 89 FileInfo.CivStage=Data.CivStage; 80 90 else 91 FileInfo.FileType='netcdf'; 81 92 FileType='netcdf'; 93 FileInfo.ListVarName=Data.ListVarName; 82 94 end 83 95 end … … 96 108 FileType='mmreader'; 97 109 end 110 FileInfo.FileName=fileinput; 111 FileInfo.FileType=FileType; 98 112 FileInfo.BitDepth=FileInfo.BitsPerPixel/3; 99 113 end -
trunk/src/nc2struct.m
r756 r771 16 16 % .DimValue= vlalues of dimensions (added information, not requested for field description) 17 17 % .VarType= integers giving the type of variable as coded by netcdf= 2 for char, =4 for single,=( for double 18 % .Txt: error message19 18 % var_detect: vector with same length as the cell array ListVarName, = 1 for each detected variable and 0 else. 20 19 % var_detect=[] in the absence of input cell array … … 31 30 % while output names will be set by the first line 32 31 % - the string 'ListGlobalAttribute' followed by a list of attribute names: reads only these attributes (fast reading) 33 % - the string 'TimeVarName', a string (the variable considered as time), an integer or vector with integer values34 % representing time indices to select , the cell of other input variable names.32 % - the string 'TimeVarName', a string (the name of the variable considered as time), an integer or vector with integer values 33 % representing time indices to select for each variable, the cell of other input variable names. 35 34 % - the string 'TimeDimName', a string (the name of the dimension considered as time), an integer or vector with integer values 36 % representing time indices to select , the cell of other input variable names.35 % representing time indices to select for each variable, the cell of other input variable names. 37 36 38 37 %AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -
trunk/src/series.m
r770 r771 234 234 set(handles.FieldName,'Value',Param.index_fields);% selected string index 235 235 end 236 if isfield(Param,'Coord_x_str') && isfield(Param,'Coord_x_val')236 if isfield(Param,'Coord_x_str') && ischar(Param.Coord_x_str) 237 237 set(handles.Coord_x,'String',Param.Coord_x_str);% list menu fields 238 set(handles.Coord_x,'Value',Param.Coord_x_val);% selected string index239 end 240 if isfield(Param,'Coord_y_str')&& is field(Param,'Coord_y_val')238 % set(handles.Coord_x,'Value',Param.Coord_x_val);% selected string index 239 end 240 if isfield(Param,'Coord_y_str')&& ischar(Param.Coord_y_str) 241 241 set(handles.Coord_y,'String',Param.Coord_y_str);% list menu fields 242 set(handles.Coord_y,'Value',Param.Coord_y_val);% selected string index242 % set(handles.Coord_y,'Value',Param.Coord_y_val);% selected string index 243 243 end 244 244 … … 1031 1031 switch FileType 1032 1032 case {'civx','civdata'} 1033 FieldList=set_field_list('U','V'); 1034 set(handles.FieldName,'String',[FieldList;{'C'};{'get_field...'}]);%standard menu for civx data 1035 set(handles.FieldName,'Value',1) % set menu to 'velocity 1036 set(handles.Coord_x,'Value',1); 1037 set(handles.Coord_x,'String',{'X'}); 1038 set(handles.Coord_y,'Value',1); 1039 set(handles.Coord_y,'String',{'Y'}); 1033 FieldList=[set_field_list('U','V');{'C'}];%standard menu for civx data 1034 % set(handles.Coord_x,'Value',1); 1035 set(handles.Coord_x,'String','X'); 1036 % set(handles.Coord_y,'Value',1); 1037 set(handles.Coord_y,'String','Y'); 1040 1038 case 'netcdf' 1041 set(handles.FieldName,'Value',1) 1042 set(handles.FieldName,'String',{'get_field...'}) 1043 if isempty(i2_series) 1044 i2=[]; 1039 ind_x=find(strcmp(get(handles.Coord_x,'String'),FileInfo.ListVarName)); 1040 if isempty(ind_x) 1041 FieldList={};% new kind of file opened, we need to pick variables with get_field... 1042 set(handles.Coord_x,'String','') 1043 set(handles.Coord_y,'String','') 1045 1044 else 1046 i2=i2_series(1,ref_j+1,ref_i+1); 1047 end 1048 if isempty(j1_series) 1049 j1=[];j2=[]; 1050 else 1051 j1=j1_series(1,ref_j+1,ref_i+1); 1052 if isempty(j2_series) 1053 j2=[]; 1045 FileInfo.ListVarName(ind_x)=[];%remove coord-x from the list of variables to display 1046 ind_y=find(strcmp(get(handles.Coord_y,'String'),FileInfo.ListVarName)); 1047 if isempty(ind_y) 1048 FieldList={};% new kind of file opened, we need to pick variables with get_field... 1049 set(handles.Coord_x,'String','') 1050 set(handles.Coord_y,'String','') 1054 1051 else 1055 j2=j2_series(1,ref_j+1,ref_i+1); 1052 FileInfo.ListVarName(ind_y)=[];%remove coord-y from the list of variables to display 1053 FieldList=(FileInfo.ListVarName)'; 1056 1054 end 1057 end 1058 % FieldName_Callback([], [], handles) 1055 end 1059 1056 otherwise 1060 1057 set(handles.FieldName,'Value',1) % set menu to 'image' 1061 1058 set(handles.FieldName,'String',{'image'}) 1062 set(handles.Coord_x,'Value',1); 1063 set(handles.Coord_x,'String',{'AX'}); 1064 set(handles.Coord_y,'Value',1); 1065 set(handles.Coord_y,'String',{'AY'}); 1066 end 1067 1059 set(handles.Coord_x,'String','AX'); 1060 set(handles.Coord_y,'String','AY'); 1061 end 1062 if ismember(FileType,{'civx','civdata','netcdf'}) 1063 PrevMenu=get(handles.FieldName,'String'); 1064 PrevMenu=PrevMenu(get(handles.FieldName,'Value')); 1065 FieldValue=[]; 1066 for ilist=1:numel(PrevMenu) 1067 index_menu=find(strcmp(PrevMenu{ilist},FieldList)); 1068 if ~isempty(index_menu) 1069 FieldValue=[FieldValue index_menu]; 1070 end 1071 end 1072 if isempty(FieldValue) 1073 FieldValue=1; 1074 end 1075 set(handles.FieldName,'Value',FieldValue) 1076 set(handles.FieldName,'String',[FieldList;{'get_field...'}]) 1077 end 1078 1079 1068 1080 %------------------------------------------------------------------------ 1069 1081 function num_first_i_Callback(hObject, eventdata, handles) … … 2311 2323 Param.InputTable{1,5},Param.InputTable{1,4},i1,i2,j1,j2); 2312 2324 if exist(FirstFileName,'file') 2325 ParamIn.Title='get_field: pick input variables and coordinates for series processing'; 2313 2326 ParamIn.SeriesInput=1; 2314 2327 GetFieldData=get_field(FirstFileName,ParamIn); … … 2322 2335 ['norm(' UName ',' VName ')'];... 2323 2336 UName;VName}; 2324 case {'scalar' ,'pick variables'}2337 case {'scalar'} 2325 2338 FieldList=GetFieldData.PanelScalar.scalar; 2326 2339 YName={GetFieldData.Coordinates.Coord_y}; … … 2328 2341 FieldList={FieldList}; 2329 2342 end 2330 case '1D plot'2331 YName=GetFieldData.PanelOrdinate.ordinate;2332 2343 case 'civdata...' 2333 FieldList=[set_field_list('U','V' ,'C') ;{'C'}];2334 set(handles.FieldName,'Value', 2) % set menu to 'velocity2344 FieldList=[set_field_list('U','V') ;{'C'}]; 2345 set(handles.FieldName,'Value',1) % set menu to 'velocity 2335 2346 XName='X'; 2336 2347 YName='y'; … … 2340 2351 set(handles.FieldName,'String',[FieldList; {'get_field...'}]); 2341 2352 if ~strcmp(GetFieldData.FieldOption,'civdata...') 2342 set(handles.FieldName,'Value', [1:numel(FieldList)])%select all input fields by default2353 set(handles.FieldName,'Value',1:numel(FieldList))%select all input fields by default 2343 2354 set(handles.VelType,'visible','off') 2344 2355 XName=GetFieldData.Coordinates.Coord_x; 2356 YName=GetFieldData.Coordinates.Coord_y; 2345 2357 TimeNameStr=GetFieldData.Time.SwitchVarIndexTime; 2346 2358 switch TimeNameStr … … 2363 2375 end 2364 2376 end 2365 set(handles.Coord_x,'String',{XName})2377 set(handles.Coord_x,'String',XName) 2366 2378 set(handles.Coord_y,'String',YName) 2367 2379 end -
trunk/src/series/civ_input.m
r765 r771 305 305 end 306 306 end 307 % indicate max and min indices updated from input file series (not stored in Param.ActionInput) 308 set(handles.MaxIndex_i,'String',num2str(MaxIndex_i)); 309 set(handles.MinIndex_i,'String',num2str(MinIndex_i)); 310 set(handles.MaxIndex_j,'String',num2str(MaxIndex_i)); 311 set(handles.MinIndex_j,'String',num2str(MinIndex_i)); 307 312 308 313 %% set the GUI to modal: wait for OK to close … … 546 551 checkbox(6)=get(handles.CheckPatch2,'Value'); 547 552 ind_selected=find(checkbox,1); 548 % if ~isempty(ind_selected)549 % RootPath=get(handles.RootPath,'String');550 % if isempty(RootPath)551 % msgbox_uvmat('ERROR','Please open an image or PIV .nc file with the upper bar menu Open/Browse...')552 % return553 % end554 % end555 553 set(handles.PairIndices,'Visible','on') 556 %set(handles.Civ1_ImageB,'Visible','on')557 %set(handles.TitleSubdirCiv1,'Visible','on')558 554 if opening==0 559 555 errormsg=find_netcpair_civ(handles,1); % select the available netcdf files … … 564 560 if max(checkbox(4:6))% case of civ2 pair choice needed 565 561 set(handles.TitlePairCiv2,'Visible','on') 566 % set(handles.TitleSubdirCiv2,'Visible','on')567 % set(handles.Civ2_ImageA,'Visible','on')568 %set(handles.ListSubdirCiv2,'Visible','on')569 562 set(handles.ListPairCiv2,'Visible','on') 570 563 if ~opening … … 575 568 end 576 569 else 577 % set(handles.TitleSubdirCiv2,'Visible','off')578 % set(handles.Civ2_ImageA,'Visible','off')579 570 set(handles.ListPairCiv2,'Visible','off') 580 571 end … … 956 947 mode_value=get(handles.ListPairMode,'Value'); 957 948 mode=mode_list{mode_value}; 949 errormsg=''; 958 950 if isequal(get(handles.CheckCiv1,'Value'),0)|| isequal(mode,'series(Dj)') 959 951 errormsg=find_netcpair_civ(handles,1);% update the menu of pairs depending on the available netcdf files … … 963 955 errormsg=find_netcpair_civ(handles,2); 964 956 end 965 957 if ~isempty(errormsg) 966 958 msgbox_uvmat('ERROR',errormsg) 967 959 end 968 960 969 961 %------------------------------------------------------------------------ -
trunk/src/uvmat.m
r764 r771 3138 3138 case 'get_field...' 3139 3139 %% fill the axes and variables from selections in get_field 3140 ParamIn =[];3140 ParamIn.Title='get_field: choose input field for display in uvmat' ; 3141 3141 % in case of civ data, we use the civ choice as default input for the GUI get_field 3142 3142 if strcmp(get(handles.VelType,'Visible'),'on')
Note: See TracChangeset
for help on using the changeset viewer.