Changeset 478 for trunk/src/series/time_series.m
- Timestamp:
- Jun 26, 2012, 8:41:27 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series/time_series.m
r474 r478 72 72 else 73 73 hseries=guidata(Param.hseries);%handles of the GUI series 74 WaitbarPos=get(hseries.waitbar_frame,'Position');%position of the waitbar on the GUI series75 74 if isfield(Param,'Specific')&& strcmp(Param.Specific,'?') 76 75 checkrun=1;% will only search interactive input parameters (preparation of BATCH mode) … … 140 139 %% coordinate transform or other user defined transform 141 140 transform_fct='';%default 142 if isfield(Param,'FieldTransform') 141 if isfield(Param,'FieldTransform')&&~isempty(Param.FieldTransform.TransformName) 143 142 addpath(Param.FieldTransform.TransformPath) 144 143 transform_fct=str2func(Param.FieldTransform.TransformName); … … 169 168 % end 170 169 % end 170 if checkrun==1 171 return % stop here for input checks 172 end 171 173 172 174 %% Set field names and velocity types … … 242 244 for i_slice=1:NbSlice 243 245 index_slice=i_slice:NbSlice:nbfield;% select file indices of the slice 244 nbfile s=0;246 nbfile=0; 245 247 nbmissing=0; 246 248 … … 248 250 for index=index_slice 249 251 if checkrun 250 update_waitbar(hseries. waitbar_frame,WaitbarPos,index/(nbfield))252 update_waitbar(hseries.Waitbar,index/(nbfield)) 251 253 stopstate=get(hseries.RUN,'BusyAction'); 252 254 else … … 255 257 256 258 %%%%%%%%%%%%%%%% loop on views (input lines) %%%%%%%%%%%%%%%% 257 Data=cell(1,nbview);%initiate the set Data258 nbtime=0;259 dt=[];260 259 if isequal(stopstate,'queue')% enable STOP command 260 Data=cell(1,nbview);%initiate the set Data 261 nbtime=0; 262 dt=[]; 261 263 % loop on views (in case of multiple input series) 262 264 for iview=1:nbview … … 277 279 end 278 280 end 281 279 282 % coordinate transform (or other user defined transform) 280 283 if ~isempty(transform_fct) … … 288 291 end 289 292 end 293 294 % field calculation (vort, div...) 295 if strcmp(FileType{1},'civx')||strcmp(FileType{1},'civdata') 296 Data{1}=calc_field(InputFields{1}.FieldName,Data{1});%calculate field (vort..) 297 end 298 299 % field substration (for two input file series) 290 300 if length(Data)==2 291 301 [Field,errormsg]=sub_field(Data{1},Data{2}); %substract the two fields … … 296 306 [Field,errormsg]=proj_field(Field,Param.ProjObject); 297 307 end 298 nb time=nbtime+1;308 nbfile=nbfile+1; 299 309 300 310 % initiate the time series at the first iteration 301 if nb time==1311 if nbfile==1 302 312 % stop program if the first field reading is in error 303 313 if ~isempty(errormsg) … … 356 366 if isequal(Param.ProjObject.ProjMode,'inside')% take the average in the domain for 'inside' mode 357 367 if isempty(VarVal) 358 displ_uvmat('ERROR',['empty result at frame index ' num2str(i1_series{iview}(i file))],checkrun)368 displ_uvmat('ERROR',['empty result at frame index ' num2str(i1_series{iview}(index))],checkrun) 359 369 return 360 370 end … … 378 388 if isempty(time)% time read in ncfiles 379 389 if isfield(Field,'Time') 380 DataOut.Time( filecounter,1)=Field.Time;390 DataOut.Time(nbfile,1)=Field.Time; 381 391 else 382 DataOut.Time( filecounter,1)=ifile;%default392 DataOut.Time(nbfile,1)=index;%default 383 393 end 384 394 else % time from ImaDoc prevails TODO: correct 385 % DataOut.Time(filecounter,1)=time{1}(i1_series{1})(ifile),j1_series{1}(ifile))+time(end,i2_series{end}(ifile),j2_series{end}(ifile)))/2; 386 DataOut.Time(filecounter,1)=i1_series{1}(ifile);% TODO : generalise 395 DataOut.Time(nbtime,1)=i1_series{1}(index);% TODO : generalise 387 396 end 388 397 … … 390 399 if ~isempty(errormsg) 391 400 nbmissing=nbmissing+1; 392 display(['i file=' num2str(ifile) ':' errormsg])401 display(['index=' num2str(index) ':' errormsg]) 393 402 end 394 403 end … … 452 461 453 462 %% plot the time series (the last one in case of multislices) 454 figure455 haxes=axes;456 463 if checkrun 457 plot_field(DataOut,haxes) 458 end 459 460 %% display the result file using the GUI get_field 461 hget_field=findobj(allchild(0),'name','get_field'); 462 if ~isempty(hget_field) 463 delete(hget_field) 464 end 465 get_field(OutputFile,DataOut) 466 467 468 464 figure 465 haxes=axes; 466 plot_field(DataOut,haxes) 467 468 %% display the result file using the GUI get_field 469 hget_field=findobj(allchild(0),'name','get_field'); 470 if ~isempty(hget_field) 471 delete(hget_field) 472 end 473 get_field(OutputFile,DataOut) 474 end 475 476
Note: See TracChangeset
for help on using the changeset viewer.