Changeset 768 for trunk


Ignore:
Timestamp:
May 2, 2014, 10:49:00 PM (7 years ago)
Author:
sommeria
Message:

bug corrected for civ2 with dt2 non equal to Dt1
cleaning of time_series

Location:
trunk/src/series
Files:
2 edited

Legend:

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

    r763 r768  
    507507            par_civ2.ImageA=par_civ1.ImageA;
    508508        else
    509             [par_civ2.ImageA,VideoObject_A] = read_image(ImageName_A,FileType_A,VideoObject_A,FrameIndex_A_Civ2(ifield));
     509            [par_civ2.ImageA,VideoObject_A] = read_image(ImageName_A_Civ2,FileType_A,VideoObject_A,FrameIndex_A_Civ2(ifield));
    510510        end
    511511        ImageName_B_Civ2=fullfile_uvmat(RootPath_B,SubDir_B,RootFile_B,FileExt_B,NomType_B,i2_series_Civ2(ifield),[],j2_series_Civ2(ifield));
     
    513513            par_civ2.ImageB=par_civ1.ImageB;
    514514        else
    515             [par_civ2.ImageB,VideoObject_B] = read_image(ImageName_B,FileType_B,VideoObject_B,FrameIndex_B_Civ2(ifield));
     515            [par_civ2.ImageB,VideoObject_B] = read_image(ImageName_B_Civ2,FileType_B,VideoObject_B,FrameIndex_B_Civ2(ifield));
    516516        end     
    517517       
     
    572572        par_civ2.SearchBoxSize(1)=2*ibx2+9;% search ara +-4 pixels around the guess
    573573        par_civ2.SearchBoxSize(2)=2*iby2+9;
    574         par_civ2.SearchBoxShift=[Shiftx(nbval>=1)./nbval(nbval>=1) Shifty(nbval>=1)./nbval(nbval>=1)];
     574        i1=i1_series_Civ2(ifield);
     575        i2=i1;
     576        if ~isempty(i2_series_Civ2)
     577            i2=i2_series_Civ2(ifield);
     578        end
     579        j1=1;
     580        if ~isempty(j1_series_Civ2)
     581            j1=j1_series_Civ2(ifield);
     582        end
     583        j2=j1;
     584        if ~isempty(j2_series_Civ1)
     585            j2=j2_series_Civ2(ifield);
     586        end
     587        Civ2_Dt=time(i2+1,j2+1)-time(i1+1,j1+1);
     588        par_civ2.SearchBoxShift=(Civ2_Dt/Data.Civ1_Dt)*[Shiftx(nbval>=1)./nbval(nbval>=1) Shifty(nbval>=1)./nbval(nbval>=1)];
    575589        par_civ2.Grid=[par_civ2.Grid(nbval>=1,1)-par_civ2.SearchBoxShift(:,1)/2 par_civ2.Grid(nbval>=1,2)-par_civ2.SearchBoxShift(:,2)/2];% grid taken at the extrapolated origin of the displacement vectors
    576590        if par_civ2.CheckDeformation
     
    582596        % caluclate velocity data (y and v in indices, reverse to y component)
    583597        [xtable ytable utable vtable ctable F] = civ (par_civ2);
    584 
    585598        list_param=(fieldnames(Param.ActionInput.Civ2))';
    586599        Civ2_param=regexprep(list_param,'^.+','Civ2_$0');% insert 'Civ2_' before  each string in list_param
     
    589602        Data.Civ2_ImageA=ImageName_A;
    590603        Data.Civ2_ImageB=ImageName_B;
    591         i1=i1_series_Civ2(ifield);
    592         i2=i1;
    593         if ~isempty(i2_series_Civ2)
    594             i2=i2_series_Civ2(ifield);
    595         end
    596         j1=1;
    597         if ~isempty(j1_series_Civ2)
    598             j1=j1_series_Civ2(ifield);
    599         end
    600         j2=j1;
    601         if ~isempty(j2_series_Civ1)
    602             j2=j2_series_Civ2(ifield);
    603         end
    604604        Data.Civ2_Time=(time(i2+1,j2+1)+time(i1+1,j1+1))/2;
    605         Data.Civ2_Dt=time(i2+1,j2+1)-time(i1+1,j1+1);
     605        Data.Civ2_Dt=Civ2_Dt;
    606606%         Data.Civ2_Time=1;
    607607%         Data.Civ2_Dt=1;
  • trunk/src/series/time_series.m

    r751 r768  
    113113ImageTypeOptions={'image','multimage','mmreader','video'};
    114114NcTypeOptions={'netcdf','civx','civdata'};
     115FileType=cell(1,nbview);
     116FileInfo=cell(1,nbview);
     117MovieObject=cell(1,nbview);
     118CheckImage=cell(1,nbview);
     119CheckNc=cell(1,nbview);
     120frame_index=cell(1,nbview);
    115121for iview=1:nbview
    116122    if ~exist(filecell{iview,1}','file')
     
    119125    end
    120126    [FileType{iview},FileInfo{iview},MovieObject{iview}]=get_file_type(filecell{iview,1});
     127    if strcmp(FileType{iview},'civdata')||strcmp(FileType{iview},'civx')
     128        if ~isfield(Param.InputFields,'VelType')
     129            FileType{iview}='netcdf';% civ data read as usual netcdf files
     130        end
     131    end
    121132    CheckImage{iview}=~isempty(find(strcmp(FileType{iview},ImageTypeOptions)));% =1 for images
    122133    CheckNc{iview}=~isempty(find(strcmp(FileType{iview},NcTypeOptions)));% =1 for netcdf files
    123     if ~isempty(j1_series{iview})
     134    if isempty(j1_series{iview})
     135        frame_index{iview}=i1_series{iview};
     136    else
    124137        frame_index{iview}=j1_series{iview};
    125     else
    126         frame_index{iview}=i1_series{iview};
    127138    end
    128139end
     
    130141%% calibration data and timing: read the ImaDoc files
    131142[XmlData,NbSlice_calib,time,errormsg]=read_multimadoc(RootPath,SubDir,RootFile,FileExt,i1_series,i2_series,j1_series,j2_series);
     143if ~isempty(errormsg)
     144    disp_uvmat('ERROR',['error in reading xmlfile: ' errormsg],checkrun)
     145    return
     146end
    132147if size(time,1)>1
    133148    diff_time=max(max(diff(time)));
Note: See TracChangeset for help on using the changeset viewer.