Changeset 107
- Timestamp:
- Jul 26, 2010, 11:20:39 PM (14 years ago)
- Location:
- trunk/src
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/cell2tab.m
r89 r107 35 35 charchain=[charchain textlu]; 36 36 end 37 %Tabchar(itab)={charchain};38 37 Tabchar(itab,1)={charchain}; 39 38 end -
trunk/src/civ.m
r100 r107 752 752 set(handles.list_subdir_civ1,'Value',1) 753 753 set(handles.list_subdir_civ2,'Value',1) 754 set(handles.list_subdir_civ1,'String',[ 'browse...';listdir])755 set(handles.list_subdir_civ2,'String',[ 'browse...';listdir])754 set(handles.list_subdir_civ1,'String',[{'browse...'};listdir]) 755 set(handles.list_subdir_civ2,'String',[{'browse...'};listdir]) 756 756 %check wether the current subdir exists: 757 757 subdir_civ1=get(handles.subdir_civ1,'String'); -
trunk/src/get_field.m
r89 r107 784 784 function RUN_Callback(hObject, eventdata, handles) 785 785 %--------------------------------------------------------- 786 %path_get_field=fileparts(which('get_field'));787 %list=get(handles.ACTION,'String');788 786 index=get(handles.ACTION,'Value'); 789 % ACTION=list{index};790 787 list_func=get(handles.ACTION,'UserData'); 791 788 h_fun=list_func{index}; 792 % %hselect_field=get(handles.inputfile,'parent');%handle of the get_field interface793 % fct_path=list_path{index}; %path stored for the function ACTION794 % if ~isequal(fct_path,path_get_field)795 % addpath(fct_path)% add the prescribed path if not the current one796 % end797 % eval(['h_fun=@' ACTION ';'])798 % if ~isequal(fct_path,path_get_field)799 % rmpath(fct_path)% add the prescribed path if not the current one800 % end801 789 set(handles.RUN,'BackgroundColor',[0.831 0.816 0.784]) 802 790 drawnow … … 1026 1014 if isfield(Field, Field.ListGlobalAttribute{iline}) 1027 1015 eval(['val=Field.' Field.ListGlobalAttribute{iline} ';']) 1028 if ischar(val); 1016 if ischar(val);% attribute value is char string 1029 1017 Tabcell{iline,2}=val; 1030 else 1018 elseif size(val,1)==1 %attribute value is a number or matlab vector 1031 1019 Tabcell{iline,2}=num2str(val); 1032 1020 end … … 1458 1446 % -------------------------------------------------------------------- 1459 1447 function MenuExportField_Callback(hObject, eventdata, handles) 1460 1448 global Data_get_field 1449 % huvmat=findobj(allchild(0),'Name','uvmat'); 1450 inputfile=get(handles.inputfile,'String'); 1451 Data_get_field=nc2struct(inputfile); 1452 % Data_view_field=UvData.ProjField_2; 1453 evalin('base','global Data_get_field')%make CurData global in the workspace 1454 display(['content of ' inputfile ':']) 1455 evalin('base','Data_get_field') %display CurData in the workspace 1456 commandwindow; 1461 1457 1462 1458 % -------------------------------------------------------------------- -
trunk/src/nomtype2pair.m
r59 r107 31 31 %determine nom_type_nc: 32 32 nom_type_pair=[];%default 33 switch nom_type 34 case {'_i_j'} 35 if Dtj>0 || Dtj<0 36 nom_type_pair='_i_j1-j2'; 33 if ischar(nom_type) 34 switch nom_type 35 case {'_i_j'} 36 if Dtj>0 || Dtj<0 37 nom_type_pair='_i_j1-j2'; 38 if Dti>0 || Dti<0 39 nom_type_pair='_i1-i2_j1-j2'; 40 end 41 elseif Dti>0 || Dti<0 42 nom_type_pair='_i1-i21_j'; 43 else 44 nom_type_pair='_i_j'; 45 end 46 case {'_i1-i2_j'} 47 if Dtj>0 || Dtj<0 48 nom_type_pair='_i1-i2_j1-j2'; 49 else 50 nom_type_pair='_i1-i2_j'; 51 end 52 case {'i_j1-j2'} 37 53 if Dti>0 || Dti<0 38 nom_type_pair='_i1-i2_j1-j2'; 54 nom_type_pair='_i1-i2_j1-j2'; 55 else 56 nom_type_pair='_i1-i2_j'; 39 57 end 40 elseif Dti>0 || Dti<0 41 nom_type_pair='_i1-i21_j'; 42 else 43 nom_type_pair='_i_j'; 44 end 45 case {'_i1-i2_j'} 46 if Dtj>0 || Dtj<0 47 nom_type_pair='_i1-i2_j1-j2'; 48 else 49 nom_type_pair='_i1-i2_j'; 50 end 51 case {'i_j1-j2'} 52 if Dti>0 || Dti<0 53 nom_type_pair='_i1-i2_j1-j2'; 54 else 55 nom_type_pair='_i1-i2_j'; 56 end 57 case {'i1-i2_j1-j2'} 58 nom_type_pair='_i1-i2_j1-j2'; 59 case '#a' 60 if Dtj>0 || Dtj<0 61 nom_type_pair='#_ab'; 62 end 63 otherwise 64 if Dti>0 || Dti<0 65 nom_type_pair='_i1-i2'; 66 end 58 case {'i1-i2_j1-j2'} 59 nom_type_pair='_i1-i2_j1-j2'; 60 case '#a' 61 if Dtj>0 || Dtj<0 62 nom_type_pair='#_ab'; 63 end 64 otherwise 65 if Dti>0 || Dti<0 66 nom_type_pair='_i1-i2'; 67 end 68 end 67 69 end -
trunk/src/plot_field.m
r105 r107 837 837 if isempty(hima) 838 838 tag=get(haxes,'Tag'); 839 hima=imagesc(AX,AY,B,[MinA MaxA]); 839 if MinA<MaxA 840 hima=imagesc(AX,AY,B,[MinA MaxA]); 841 else 842 hima=imagesc(AX,AY,B,[MaxA-1 MaxA]); 843 end 840 844 set(hima,'Tag','ima','HitTest','off') 841 845 set(haxes,'Tag',tag);%preserve the axes tag (removed by image fct !!!) … … 845 849 caxis([MinA MaxA]) 846 850 else 847 caxis([M inA MinA+1])851 caxis([MaxA-1 MaxA]) 848 852 end 849 853 set(hima,'XData',AX); -
trunk/src/series/aver_stat.m
r80 r107 323 323 A=imread(filename); 324 324 end 325 Data{iview}.ListVarName={' coord_y','coord_x','A'}; %325 Data{iview}.ListVarName={'AY','AX','A'}; % 326 326 Atype{iview}=class(A); 327 327 npy=size(A,1); … … 329 329 nbcolor=size(A,3); 330 330 if nbcolor==3 331 Data{iview}.VarDimName={' coord_y','coord_x',{'coord_y','coord_x','rgb'}};331 Data{iview}.VarDimName={'AY','AX',{'AY','AX','rgb'}}; 332 332 else 333 Data{iview}.VarDimName={' coord_y','coord_x',{'coord_y','coord_x'}};333 Data{iview}.VarDimName={'AY','AX',{'AY','AX'}}; 334 334 end 335 Data{iview}. coord_y=[npy-0.5 0.5];336 Data{iview}. coord_x=[0.5 npx-0.5];335 Data{iview}.AY=[npy-0.5 0.5]; 336 Data{iview}.AX=[0.5 npx-0.5]; 337 337 Data{iview}.A=double(A); 338 338 Data{iview}.CoordType='px'; -
trunk/src/series/time_series.m
r102 r107 186 186 end 187 187 188 % Root name of output files (TO GENERALISE FOR TWO INPUT SERIES)189 % filebasesub=fullfile(RootPath{1},RootFile{1});190 % if NbSlice==1191 % filebase_out=[filebasesub '_time'];192 % else193 % filebase_out=[filebasesub '_' NbSlice_name 'mtim'];194 % increment=num_i1{1}(2)-num_i1{1}(1);195 % if ~isequal(increment,1) % if an increment is set196 % answeryes=msgbox_uvmat('INPUT_Y-N',['will take time series in ' num2str(NbSlice) 'slices with increment = ' num2str(increment) '!']);197 % else198 % answeryes=msgbox_uvmat('INPUT_Y-N',{['will take time series in ' num2str(NbSlice) ' slices'];['results stored as files ' filebase_out ' ...']});199 % end200 % if ~isequal(answeryes,'Yes')201 % return202 % end203 % end204 188 VelType_str=get(hseries.VelTypeMenu,'String'); 205 189 VelType_val=get(hseries.VelTypeMenu,'Value'); … … 288 272 % Root name of output files (TO GENERALISE FOR TWO INPUT SERIES) 289 273 subdir_result='time_series'; 290 % filebasesub=fullfile(RootPath{1},subdir_result,RootFile{1});291 % if isempty(SubDir{1}) % create a subdirectory '/aver_stat'292 % subdir_result='aver_stat';293 % filebasemean=fullfile(RootPath{1},subdir_result);294 274 if ~exist(fullfile(RootPath{1},subdir_result),'dir') 295 275 dircur=pwd; %record current working directory … … 351 331 A=imread(filename); 352 332 end 353 Data{iview}.ListVarName={' coord_y','coord_x','A'}; %333 Data{iview}.ListVarName={'AY','AX','A'}; % 354 334 npy=size(A,1); 355 335 npx=size(A,2); 356 336 nbcolor=size(A,3); 357 337 if nbcolor==3 358 Data{iview}.VarDimName={' coord_y','coord_x',{'coord_y','coord_x','rgb'}};338 Data{iview}.VarDimName={'AY','AX',{'AY','AX','rgb'}}; 359 339 else 360 Data{iview}.VarDimName={' coord_y','coord_x',{'coord_y','coord_x'}};340 Data{iview}.VarDimName={'AY','AX',{'AY','AX'}}; 361 341 end 362 Data{iview}. coord_y=[npy-0.5 0.5];363 Data{iview}. coord_x=[0.5 npx-0.5];342 Data{iview}.AY=[npy-0.5 0.5]; 343 Data{iview}.AX=[0.5 npx-0.5]; 364 344 Data{iview}.A=double(A); 365 345 Data{iview}.CoordType='px'; … … 426 406 for ivar=1:nbvar 427 407 if length(Field.VarAttribute)>=ivar && isfield(Field.VarAttribute{ivar},'Role') 408 %Field.ListVarName{ivar} 428 409 var_role=Field.VarAttribute{ivar}.Role;%'role' of the variable 429 410 if isequal(var_role,'errorflag') … … 439 420 testsum(ivar)=1; %constant coordinates, record without time evolution 440 421 end 441 % check whether the variable ivar is a dimension variable442 DimCell=Field.VarDimName{ivar};443 if ischar(DimCell)444 DimCell={DimCell};445 end446 if numel(DimCell)==1 && isequal(Field.ListVarName{ivar},DimCell{1})%detect dimension variables447 testsum(ivar)=1;448 end422 end 423 % check whether the variable ivar is a dimension variable 424 DimCell=Field.VarDimName{ivar}; 425 if ischar(DimCell) 426 DimCell={DimCell}; 427 end 428 if numel(DimCell)==1 && isequal(Field.ListVarName{ivar},DimCell{1})%detect dimension variables 429 testsum(ivar)=1; 449 430 end 450 431 end … … 506 487 end 507 488 % add time dimension and update VarDimIndex: 508 %if ~isequal(Series.ProjObject.ProjMode,'inside')% take the average in the domain for 'inside' mode509 489 for ivar=1:length(Field.ListVarName) 510 % vardimindex=Field.VarDimIndex{ivar};% array of dimension indices for variable VarIndex(ivar)511 490 DimCell=Field.VarDimName(ivar); 512 491 if testsum(ivar)==2%variable used as time series 513 % RecordData.VarDimIndex{ivar}=[1 vardimindex+1];514 492 RecordData.VarDimName{ivar}=[{'Time'} DimCell]; 515 493 elseif testsum(ivar)==1 516 % RecordData.VarDimIndex{ivar}=[vardimindex+1];517 494 RecordData.VarDimName{ivar}=DimCell; 518 495 end 519 496 end 520 % end521 497 indexremove=find(~testsum); 522 498 if ~isempty(indexremove) … … 527 503 end 528 504 end 529 %RecordData.VarDimIndex=[{[1]} RecordData.VarDimIndex]; %time dimension 505 530 506 %shift variable attributes 531 507 if isfield(RecordData,'VarAttribute') … … 534 510 RecordData.VarDimName=[{'Time'} RecordData.VarDimName]; 535 511 RecordData.Action=Series.Action;%name of the processing programme 512 536 513 %name of result file 537 514 [filemean]=... … … 544 521 end 545 522 end 523 546 524 figure 547 525 haxes=axes; -
trunk/src/struct2nc.m
r106 r107 95 95 %write variable attributes 96 96 if testattr 97 for ivar=1: length(VarAttribute)97 for ivar=1:min(numel(VarAttribute),numel(ListVarName)) 98 98 if isstruct(VarAttribute{ivar}) 99 99 attr_names=fields(VarAttribute{ivar}); -
trunk/src/struct2nc_toolbox.m
r58 r107 115 115 %write variable attributes 116 116 if testattr 117 for ivar=1: length(VarAttribute) %loop on the attributes of variable ivar117 for ivar=1:min(numel(VarAttribute),numel(ListVarName)) %loop on the attributes of variable ivar 118 118 if isstruct(VarAttribute{ivar}) 119 119 attr_names=fields(VarAttribute{ivar});
Note: See TracChangeset
for help on using the changeset viewer.