Ignore:
Timestamp:
Jan 19, 2015, 9:29:28 PM (10 years ago)
Author:
sommeria
Message:

various

File:
1 edited

Legend:

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

    r833 r851  
    6464    Data.OutputSubDirMode='last'; %select the last subDir in the input table as root of the output subdir name (option 'all'/'first'/'last', 'all' by default)
    6565    Data.OutputFileMode='NbInput_i';% one output file expected per value of i index (used for waitbar)
    66         % check the existence of the first file in the series: suppressed
    67 %     first_j=[];
    68 %     if isfield(Param.IndexRange,'first_j'); first_j=Param.IndexRange.first_j; end
    69 %     last_j=[];
    70 %     if isfield(Param.IndexRange,'last_j'); last_j=Param.IndexRange.last_j; end
    71 %     PairString='';
    72 %     if isfield(Param.IndexRange,'PairString'); PairString=Param.IndexRange.PairString; end
    7366    return
    7467end
     
    571564        end     
    572565       
    573         ncfile=fullfile_uvmat(RootPath_A,OutputDir,RootFile_A,'.nc',NomTypeNc,i1,i2,...
    574             j1,j2);
     566        ncfile=fullfile_uvmat(RootPath_A,OutputDir,RootFile_A,'.nc',NomTypeNc,i1,i2,j1,j2);
    575567        par_civ2.ImageWidth=FileInfo_A.Width;
    576568        par_civ2.ImageHeight=FileInfo_A.Height;
     
    599591            DVDY=zeros(size(par_civ2.Grid,1),1);
    600592        end
    601         NbSubDomain=size(Data.Civ1_SubRange,3);
    602         % get the guess from patch1
     593       
     594         % get the guess from patch1 or patch2 (case 'iterate')
     595        if isfield (par_civ2,'iterate') && strcmp(par_civ2.iterate,'iterate')
     596           SubRange= Data.Civ2_SubRange;
     597           NbCentres=Data.Civ2_NbCentres;
     598           Coord_tps=Data.Civ2_Coord_tps;
     599           U_tps=Data.Civ2_U_tps;
     600           V_tps=Data.Civ2_V_tps;
     601           CivStage=Data.CivStage;
     602           Civ1_Dt=Data.Civ2_Dt;
     603           Data=[];%reinitialise the result structure Data
     604           Data.ListGlobalAttribute={'Conventions','Program','CivStage'};
     605           Data.Conventions='uvmat/civdata';% states the conventions used for the description of field variables and attributes
     606           Data.Program='civ_series';
     607           Data.CivStage=CivStage;
     608           Data.ListVarName={};
     609           Data.VarDimName={};
     610        else
     611           SubRange= Data.Civ1_SubRange;
     612           NbCentres=Data.Civ1_NbCentres;
     613           Coord_tps=Data.Civ1_Coord_tps;
     614           U_tps=Data.Civ1_U_tps;
     615           V_tps=Data.Civ1_V_tps;
     616           Civ1_Dt=Data.Civ1_Dt;
     617        end
     618        NbSubDomain=size(SubRange,3);       
    603619        for isub=1:NbSubDomain% for each sub-domain of Patch1
    604             nbvec_sub=Data.Civ1_NbCentres(isub);% nbre of Civ1 vectors in the subdomain
    605             ind_sel=find(par_civ2.Grid(:,1)>=Data.Civ1_SubRange(1,1,isub) & par_civ2.Grid(:,1)<=Data.Civ1_SubRange(1,2,isub) &...
    606                 par_civ2.Grid(:,2)>=Data.Civ1_SubRange(2,1,isub) & par_civ2.Grid(:,2)<=Data.Civ1_SubRange(2,2,isub));
     620            nbvec_sub=NbCentres(isub);% nbre of Civ vectors in the subdomain
     621            ind_sel=find(par_civ2.Grid(:,1)>=SubRange(1,1,isub) & par_civ2.Grid(:,1)<=SubRange(1,2,isub) &...
     622                par_civ2.Grid(:,2)>=SubRange(2,1,isub) & par_civ2.Grid(:,2)<=SubRange(2,2,isub));
    607623            epoints = par_civ2.Grid(ind_sel,:);% coordinates of interpolation sites
    608             ctrs=Data.Civ1_Coord_tps(1:nbvec_sub,:,isub) ;%(=initial points) ctrs
     624            ctrs=Coord_tps(1:nbvec_sub,:,isub) ;%(=initial points) ctrs
    609625            nbval(ind_sel)=nbval(ind_sel)+1;% records the number of values for eacn interpolation point (in case of subdomain overlap)
    610             EM = tps_eval(epoints,ctrs);
    611             Shiftx(ind_sel)=Shiftx(ind_sel)+EM*Data.Civ1_U_tps(1:nbvec_sub+3,isub);
    612             Shifty(ind_sel)=Shifty(ind_sel)+EM*Data.Civ1_V_tps(1:nbvec_sub+3,isub);
     626            EM = tps_eval(epoints,ctrs);               
     627            Shiftx(ind_sel)=Shiftx(ind_sel)+EM*U_tps(1:nbvec_sub+3,isub);
     628            Shifty(ind_sel)=Shifty(ind_sel)+EM*V_tps(1:nbvec_sub+3,isub);
    613629            if par_civ2.CheckDeformation
    614630                [EMDX,EMDY] = tps_eval_dxy(epoints,ctrs);%2D matrix of distances between extrapolation points epoints and spline centres (=site points) ctrs
    615                 DUDX(ind_sel)=DUDX(ind_sel)+EMDX*Data.Civ1_U_tps(1:nbvec_sub+3,isub);
    616                 DUDY(ind_sel)=DUDY(ind_sel)+EMDY*Data.Civ1_U_tps(1:nbvec_sub+3,isub);
    617                 DVDX(ind_sel)=DVDX(ind_sel)+EMDX*Data.Civ1_V_tps(1:nbvec_sub+3,isub);
    618                 DVDY(ind_sel)=DVDY(ind_sel)+EMDY*Data.Civ1_V_tps(1:nbvec_sub+3,isub);
     631                DUDX(ind_sel)=DUDX(ind_sel)+EMDX*U_tps(1:nbvec_sub+3,isub);
     632                DUDY(ind_sel)=DUDY(ind_sel)+EMDY*U_tps(1:nbvec_sub+3,isub);
     633                DVDX(ind_sel)=DVDX(ind_sel)+EMDX*V_tps(1:nbvec_sub+3,isub);
     634                DVDY(ind_sel)=DVDY(ind_sel)+EMDY*V_tps(1:nbvec_sub+3,isub);
    619635            end
    620636        end
     
    628644        par_civ2.SearchBoxSize(2)=2*iby2+9;
    629645        Civ2_Dt=time(i2+1,j2+1)-time(i1+1,j1+1);
    630         par_civ2.SearchBoxShift=(Civ2_Dt/Data.Civ1_Dt)*[Shiftx(nbval>=1)./nbval(nbval>=1) Shifty(nbval>=1)./nbval(nbval>=1)];
     646        par_civ2.SearchBoxShift=(Civ2_Dt/Civ1_Dt)*[Shiftx(nbval>=1)./nbval(nbval>=1) Shifty(nbval>=1)./nbval(nbval>=1)];
    631647        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
    632648        if par_civ2.CheckDeformation
     
    636652            par_civ2.DVDY=DVDY./nbval;
    637653        end
    638         % caluclate velocity data (y and v in indices, reverse to y component)
     654        % calculate velocity data (y and v in indices, reverse to y component)
    639655        [xtable ytable utable vtable ctable F] = civ (par_civ2);
    640656        list_param=(fieldnames(Param.ActionInput.Civ2))';
Note: See TracChangeset for help on using the changeset viewer.