Changeset 107 for trunk/src/series/time_series.m
- Timestamp:
- Jul 26, 2010, 11:20:39 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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;
Note: See TracChangeset
for help on using the changeset viewer.