Changeset 912 for trunk/src/series/civ_series.m
- Timestamp:
- Jun 16, 2015, 8:15:10 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series/civ_series.m
r911 r912 356 356 end 357 357 end 358 if ~CheckOverwrite && exist(ncfile,'file') 359 continue% skip iteration if the mode overwrite is desactivated and the result file already exists 358 ncfile_out=ncfile;% by default 359 if isfield (Param.ActionInput,'Civ2') 360 i1_civ2=i1_series_Civ2(ifield); 361 i2_civ2=i1_civ2; 362 if ~isempty(i2_series_Civ2) 363 i2_civ2=i2_series_Civ2(ifield); 364 end 365 j1_civ2=1; 366 if ~isempty(j1_series_Civ2) 367 j1_civ2=j1_series_Civ2(ifield); 368 end 369 j2_civ2=i1_civ2; 370 if ~isempty(j2_series_Civ2) 371 j2_civ2=j2_series_Civ2(ifield); 372 end 373 if strcmp(Param.ActionInput.ListCompareMode,'PIV') 374 ncfile_out=fullfile_uvmat(RootPath_A,OutputDir,RootFile_A,'.nc',NomTypeNc,i1_civ2,i2_civ2,j1_civ2,j2_civ2); 375 else % displacement 376 ncfile_out=fullfile_uvmat(RootPath_A,OutputDir,RootFile_A,'.nc',NomTypeNc,i2_civ2,[],j2_civ2); 377 end 378 end 379 if ~CheckOverwrite && exist(ncfile_out,'file') 380 disp(['existing output file ' ncfile_out ' already exists, skip to next field']) 381 continue% skip iteration if the mode overwrite is desactivated and the result file already exists 360 382 end 361 383 end … … 582 604 par_civ2.ImageA=[]; 583 605 par_civ2.ImageB=[]; 584 i1=i1_series_Civ2(ifield);585 i2=i1;586 if ~isempty(i2_series_Civ2)587 i2=i2_series_Civ2(ifield);588 end589 j1=1;590 if ~isempty(j1_series_Civ2)591 j1=j1_series_Civ2(ifield);592 end593 j2=j1;594 if ~isempty(j2_series_Civ2)595 j2=j2_series_Civ2(ifield);596 end597 ImageName_A_Civ2=fullfile_uvmat(RootPath_A,SubDir_A,RootFile_A,FileExt_A,NomType_A,i1 ,[],j1);606 % i1_civ2=i1_series_Civ2(ifield); 607 % i2_civ2=i1_civ2; 608 % if ~isempty(i2_series_Civ2) 609 % i2_civ2=i2_series_Civ2(ifield); 610 % end 611 % j1_civ2=1; 612 % if ~isempty(j1_series_Civ2) 613 % j1_civ2=j1_series_Civ2(ifield); 614 % end 615 % j2_civ2=i1_civ2; 616 % if ~isempty(j2_series_Civ2) 617 % j2_civ2=j2_series_Civ2(ifield); 618 % end 619 ImageName_A_Civ2=fullfile_uvmat(RootPath_A,SubDir_A,RootFile_A,FileExt_A,NomType_A,i1_civ2,[],j1_civ2); 598 620 599 621 if strcmp(ImageName_A_Civ2,ImageName_A) && isequal(FrameIndex_A_Civ1(ifield),FrameIndex_A_Civ2(ifield)) … … 602 624 [par_civ2.ImageA,VideoObject_A] = read_image(ImageName_A_Civ2,FileType_A,VideoObject_A,FrameIndex_A_Civ2(ifield)); 603 625 end 604 ImageName_B_Civ2=fullfile_uvmat(RootPath_B,SubDir_B,RootFile_B,FileExt_B,NomType_B,i2 ,[],j2);626 ImageName_B_Civ2=fullfile_uvmat(RootPath_B,SubDir_B,RootFile_B,FileExt_B,NomType_B,i2_civ2,[],j2_civ2); 605 627 if strcmp(ImageName_B_Civ2,ImageName_B) && isequal(FrameIndex_B_Civ1(ifield),FrameIndex_B_Civ2) 606 628 par_civ2.ImageB=par_civ1.ImageB; … … 608 630 [par_civ2.ImageB,VideoObject_B] = read_image(ImageName_B_Civ2,FileType_B,VideoObject_B,FrameIndex_B_Civ2(ifield)); 609 631 end 610 if strcmp(Param.ActionInput.ListCompareMode,'PIV')611 ncfile=fullfile_uvmat(RootPath_A,OutputDir,RootFile_A,'.nc',NomTypeNc,i1,i2,j1,j2);612 else % displacement613 ncfile=fullfile_uvmat(RootPath_A,OutputDir,RootFile_A,'.nc',NomTypeNc,i2,[],j2);614 end632 % if strcmp(Param.ActionInput.ListCompareMode,'PIV') 633 % ncfile_out=fullfile_uvmat(RootPath_A,OutputDir,RootFile_A,'.nc',NomTypeNc,i1,i2,j1,j2); 634 % else % displacement 635 % ncfile_out=fullfile_uvmat(RootPath_A,OutputDir,RootFile_A,'.nc',NomTypeNc,i2,[],j2); 636 % end 615 637 par_civ2.ImageWidth=FileInfo_A.Width; 616 638 par_civ2.ImageHeight=FileInfo_A.Height; … … 712 734 Civ2_Dt=1; 713 735 else 714 Civ2_Dt=time(i2 +1,j2+1)-time(i1+1,j1+1);736 Civ2_Dt=time(i2_civ2+1,j2_civ2+1)-time(i1_civ2+1,j1_civ2+1); 715 737 end 716 738 end … … 737 759 Data.Civ2_ImageB=ImageName_B; 738 760 if strcmp(Param.ActionInput.ListCompareMode,'displacement') 739 Data.Civ2_Time=time(i2 +1,j2+1);% the time is the time of the secodn image761 Data.Civ2_Time=time(i2_civ2+1,j2_civ2+1);% the time is the time of the secodn image 740 762 Data.Civ2_Dt=1;% time interval is 1, to yield displacement instead of velocity=displacement/Dt at reading 741 763 else 742 Data.Civ2_Time=(time(i2 +1,j2+1)+time(i1+1,j1+1))/2;764 Data.Civ2_Time=(time(i2_civ2+1,j2_civ2+1)+time(i1_civ2+1,j1_civ2+1))/2; 743 765 Data.Civ2_Dt=Civ2_Dt; 744 766 end … … 863 885 %% write result in a netcdf file if requested 864 886 if CheckOutputFile 865 errormsg=struct2nc(ncfile ,Data);887 errormsg=struct2nc(ncfile_out,Data); 866 888 if isempty(errormsg) 867 disp([ncfile ' written'])889 disp([ncfile_out ' written']) 868 890 else 869 891 disp(errormsg)
Note: See TracChangeset
for help on using the changeset viewer.