Changeset 912 for trunk/src/series


Ignore:
Timestamp:
Jun 16, 2015, 8:15:10 PM (9 years ago)
Author:
sommeria
Message:

interp range introduced in set_object

Location:
trunk/src/series
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/series/check_data_files.m

    r908 r912  
    154154                    if strcmp(FileType{iview},'civx')||strcmp(FileType{iview},'civdata')
    155155                        if isfield(FileInfo,'CivStage')
    156                             liststage={'civ1','fix1','patch1','civ2','fix2','patch2'};
    157                             lastfield=liststage{FileInfo.CivStage};
     156                            liststage={'civ','fix','patch'};
     157                            stagechoice=1+mod(FileInfo.CivStage-1,3);
     158                            iter=1+floor((FileInfo.CivStage-1)/3);
     159                            lastfield=[liststage{stagechoice} num2str(iter)];
     160                            %liststage={'civ1','fix1','patch1','civ2','fix2','patch2'};                       
     161                            %lastfield=liststage{FileInfo.CivStage};                           
    158162                        end
    159163                    end
  • trunk/src/series/civ_series.m

    r911 r912  
    356356            end
    357357        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
    360382        end
    361383    end
     
    582604            par_civ2.ImageA=[];
    583605            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             end
    589             j1=1;
    590             if ~isempty(j1_series_Civ2)
    591                 j1=j1_series_Civ2(ifield);
    592             end
    593             j2=j1;
    594             if ~isempty(j2_series_Civ2)
    595                 j2=j2_series_Civ2(ifield);
    596             end
    597             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);
    598620           
    599621            if strcmp(ImageName_A_Civ2,ImageName_A) && isequal(FrameIndex_A_Civ1(ifield),FrameIndex_A_Civ2(ifield))
     
    602624                [par_civ2.ImageA,VideoObject_A] = read_image(ImageName_A_Civ2,FileType_A,VideoObject_A,FrameIndex_A_Civ2(ifield));
    603625            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);
    605627            if strcmp(ImageName_B_Civ2,ImageName_B) && isequal(FrameIndex_B_Civ1(ifield),FrameIndex_B_Civ2)
    606628                par_civ2.ImageB=par_civ1.ImageB;
     
    608630                [par_civ2.ImageB,VideoObject_B] = read_image(ImageName_B_Civ2,FileType_B,VideoObject_B,FrameIndex_B_Civ2(ifield));
    609631            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 % displacement
    613                 ncfile=fullfile_uvmat(RootPath_A,OutputDir,RootFile_A,'.nc',NomTypeNc,i2,[],j2);
    614             end
     632%             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
    615637            par_civ2.ImageWidth=FileInfo_A.Width;
    616638            par_civ2.ImageHeight=FileInfo_A.Height;
     
    712734                Civ2_Dt=1;
    713735            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);
    715737            end
    716738        end
     
    737759            Data.Civ2_ImageB=ImageName_B;
    738760             if strcmp(Param.ActionInput.ListCompareMode,'displacement')
    739                 Data.Civ2_Time=time(i2+1,j2+1);% the time is the time of the secodn image
     761                Data.Civ2_Time=time(i2_civ2+1,j2_civ2+1);% the time is the time of the secodn image
    740762                Data.Civ2_Dt=1;% time interval is 1, to yield displacement instead of velocity=displacement/Dt at reading
    741763             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;
    743765            Data.Civ2_Dt=Civ2_Dt;
    744766             end
     
    863885    %% write result in a netcdf file if requested
    864886    if CheckOutputFile
    865         errormsg=struct2nc(ncfile,Data);
     887        errormsg=struct2nc(ncfile_out,Data);
    866888        if isempty(errormsg)
    867             disp([ncfile ' written'])
     889            disp([ncfile_out ' written'])
    868890        else
    869891            disp(errormsg)
Note: See TracChangeset for help on using the changeset viewer.