Changeset 41 for trunk/src/series/time_series.m
- Timestamp:
- Mar 10, 2010, 11:03:36 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series/time_series.m
r38 r41 34 34 %projection object 35 35 test_object=get(hseries.GetObject,'Value'); 36 if test_object%isfield(Series,'sethandles') 37 Series.ProjObject=read_set_object(Series.sethandles); 36 if test_object 37 hset_object=findobj(allchild(0),'Name','set_object'); 38 ProjObject=read_set_object(guidata(hset_object)); 38 39 %answeryes=questdlg({['field series projected on ' Series.ProjObject.Style]}); 39 answeryes=msgbox_uvmat('INPUT_Y-N',['field series projected on ' Series.ProjObject.Style]);40 answeryes=msgbox_uvmat('INPUT_Y-N',['field series projected on ' ProjObject.Style]); 40 41 if ~isequal(answeryes,'Yes') 41 42 return … … 170 171 171 172 % Root name of output files (TO GENERALISE FOR TWO INPUT SERIES) 172 filebasesub=fullfile(RootPath{1},RootFile{1});173 if NbSlice==1174 filebase_out=[filebasesub '_time'];175 else176 filebase_out=[filebasesub '_' NbSlice_name 'mtim'];177 increment=num_i1{1}(2)-num_i1{1}(1);178 if ~isequal(increment,1) % if an increment is set179 answeryes=msgbox_uvmat('INPUT_Y-N',['will take time series in ' num2str(NbSlice) 'slices with increment = ' num2str(increment) '!']);180 else181 answeryes=msgbox_uvmat('INPUT_Y-N',{['will take time series in ' num2str(NbSlice) ' slices'];['results stored as files ' filebase_out ' ...']});182 end183 if ~isequal(answeryes,'Yes')184 return185 end186 end173 % filebasesub=fullfile(RootPath{1},RootFile{1}); 174 % if NbSlice==1 175 % filebase_out=[filebasesub '_time']; 176 % else 177 % filebase_out=[filebasesub '_' NbSlice_name 'mtim']; 178 % increment=num_i1{1}(2)-num_i1{1}(1); 179 % if ~isequal(increment,1) % if an increment is set 180 % answeryes=msgbox_uvmat('INPUT_Y-N',['will take time series in ' num2str(NbSlice) 'slices with increment = ' num2str(increment) '!']); 181 % else 182 % answeryes=msgbox_uvmat('INPUT_Y-N',{['will take time series in ' num2str(NbSlice) ' slices'];['results stored as files ' filebase_out ' ...']}); 183 % end 184 % if ~isequal(answeryes,'Yes') 185 % return 186 % end 187 % end 187 188 VelType_str=get(hseries.VelTypeMenu,'String'); 188 189 VelType_val=get(hseries.VelTypeMenu,'Value'); … … 269 270 end 270 271 271 % image or scalar processing programme set by user 272 Coord_menu=get(hseries.CoordType,'String'); 273 menu_val=get(hseries.CoordType,'Value'); 274 usrfct=Coord_menu{menu_val}; 275 testfct=~isequal(usrfct,''); 272 % Root name of output files (TO GENERALISE FOR TWO INPUT SERIES) 273 subdir_result='time_series'; 274 % filebasesub=fullfile(RootPath{1},subdir_result,RootFile{1}); 275 % if isempty(SubDir{1}) % create a subdirectory '/aver_stat' 276 % subdir_result='aver_stat'; 277 % filebasemean=fullfile(RootPath{1},subdir_result); 278 if ~exist(fullfile(RootPath{1},subdir_result),'dir') 279 dircur=pwd; %record current working directory 280 cd(RootPath{1})% goes to the iamge directory 281 [m1,m2,m3]=mkdir(subdir_result); 282 if ~isequal(m2,'') 283 msgbox_uvmat('CONFIRMATION',m2);%error message for directory creation 284 end 285 cd(dircur) %back to the initial working directory 286 end 287 filebase_out=filebase{1}; 288 NomTypeOut=nomtype2pair(NomType{1},num_i2{end}(end)-num_i1{1}(1),num_j2{end}(end)-num_j1{1}(1)); 289 290 % coordinate transform or other user defined transform 291 transform_fct=[];%default 292 if isfield(Series,'transform_fct') 293 transform_fct=Series.transform_fct; 294 end 276 295 277 296 % to update: … … 331 350 end 332 351 end 333 % geometry transform or other user defined transform 334 if ~isequal(Series.CoordType,'') 352 353 % coordinate transform (or other user defined transform) 354 if ~isempty(transform_fct) 355 % z index 356 if ~isempty(NbSlice_calib) 357 Data{iview}.ZIndex=mod(num_i1{iview}(ifile)-1,NbSlice_calib{1})+1;%Zindex for phys transform 358 end 335 359 if nbview==2 336 [Data{1},Data{2}]= feval(Series.CoordType,Data{1},XmlData{1},Data{2},XmlData{2});360 [Data{1},Data{2}]=transform_fct(Data{1},XmlData{1},Data{2},XmlData{2}); 337 361 if isempty(Data{2}) 338 362 Data(2)=[]; 339 363 end 340 364 else 341 Data{1}= feval(Series.CoordType,Data{1},XmlData{1});342 end 343 end 365 Data{1}=transform_fct(Data{1},XmlData); 366 end 367 end 344 368 if testcivx 345 369 Data{iview}=calc_field(FieldName,Data{iview});%calculate field (vort..) … … 354 378 Field=Data{1}; 355 379 end 356 if isfield(Series,'ProjObject') 357 Series.ProjObject 358 [Field,errormsg]=proj_field(Field,Series.ProjObject); 380 if test_object 381 [Field,errormsg]=proj_field(Field,ProjObject); 359 382 if ~isempty(errormsg) 360 383 msgbox_uvmat('ERROR',['error in time_series/proj_field:' errormsg]) … … 393 416 end 394 417 % check whether the variable ivar is a dimension variable 395 %index=Field.VarDimIndex{ivar};%dimension indices of the variable #ivar396 418 DimCell=Field.VarDimName{ivar}; 397 419 if ischar(DimCell) … … 416 438 if testsum(ivar)==2% test for recorded variable 417 439 eval(['VarVal=Field.' VarName ';']); 418 if isequal( Series.ProjObject.ProjMode,'inside')% take the average in the domain for 'inside' mode440 if isequal(ProjObject.ProjMode,'inside')% take the average in the domain for 'inside' mode 419 441 if isempty(VarVal) 420 442 msgbox_uvmat('ERROR',['empty result at frame index ' num2str(num_i1{iview}(ifile))])
Note: See TracChangeset
for help on using the changeset viewer.