Changeset 399 for trunk/src/civ_matlab.m


Ignore:
Timestamp:
Apr 27, 2012, 12:28:47 PM (12 years ago)
Author:
sommeria
Message:

implementation of thin plate interpolation (proj on planes with mode 'filter'), rationalisation of variable formats in civ_matlab

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/civ_matlab.m

    r397 r399  
    108108    Data.ListGlobalAttribute=[Data.ListGlobalAttribute Civ1_param];% {'Civ1_Time','Civ1_Dt'}];
    109109    Data.ListVarName={'Civ1_X','Civ1_Y','Civ1_U','Civ1_V','Civ1_F','Civ1_C'};%  cell array containing the names of the fields to record
    110     Data.VarDimName={'NbVec1','NbVec1','NbVec1','NbVec1','NbVec1','NbVec1'};
     110    Data.VarDimName={'nb_vec_1','nb_vec_1','nb_vec_1','nb_vec_1','nb_vec_1','nb_vec_1'};
    111111    Data.VarAttribute{1}.Role='coord_x';
    112112    Data.VarAttribute{2}.Role='coord_y';
     
    159159    else
    160160        Data.ListVarName=[Data.ListVarName {'Civ1_FF'}];
    161         Data.VarDimName=[Data.VarDimName {'NbVec1'}];
     161        Data.VarDimName=[Data.VarDimName {'nb_vec_1'}];
    162162        nbvar=length(Data.ListVarName);
    163163        Data.VarAttribute{nbvar}.Role='errorflag';   
     
    179179    nbvar=length(Data.ListVarName);
    180180    Data.ListVarName=[Data.ListVarName {'Civ1_U_smooth','Civ1_V_smooth','Civ1_SubRange','Civ1_NbSites','Civ1_Coord_tps','Civ1_U_tps','Civ1_V_tps'}];
    181     Data.VarDimName=[Data.VarDimName {'NbVec1','NbVec1',{'NbCoord','Two','NbSubDomain1'},{'NbSubDomain1'},...
    182              {'NbVec1Sub','NbCoord','NbSubDomain1'},{'Nbtps1','NbSubDomain1'},{'Nbtps1','NbSubDomain1'}}];
     181        Data.VarDimName=[Data.VarDimName {'nb_vec_1','nb_vec_1',{'nb_coord','nb_bounds','nb_subdomain_1'},{'nb_subdomain_1'},...
     182             {'nb_tps_1','nb_coord','nb_subdomain_1'},{'nb_tps_1','nb_subdomain_1'},{'nb_tps_1','nb_subdomain_1'}}];
    183183    Data.VarAttribute{nbvar+1}.Role='vector_x';
    184184    Data.VarAttribute{nbvar+2}.Role='vector_y';
     
    195195    [Data.Civ1_SubRange,Data.Civ1_NbSites,Data.Civ1_Coord_tps,Data.Civ1_U_tps,Data.Civ1_V_tps,tild,Ures, Vres,tild,FFres]=...
    196196            filter_tps([Data.Civ1_X(ind_good) Data.Civ1_Y(ind_good)],Data.Civ1_U(ind_good),Data.Civ1_V(ind_good),[],Data.Patch1_SubDomain,Data.Patch1_Rho,Data.Patch1_Threshold);
    197 %       Data.Civ1_U_Diff(ind_good)=Data.Civ1_U(ind_good)-Ures;
    198 %       Data.Civ1_V_Diff(ind_good)=Data.Civ1_V(ind_good)-Vres;
     197      fill=zeros(3,2,size(Data.Civ1_SubRange,3)); %matrix of zeros to complement the matrix Data.Civ1_Coord_tps (conveninent for file storage)
     198      Data.Civ1_Coord_tps=cat(1,Data.Civ1_Coord_tps,fill);
    199199      Data.Civ1_U_smooth(ind_good)=Ures;
    200200      Data.Civ1_V_smooth(ind_good)=Vres;
     
    305305    nbvar=numel(Data.ListVarName);
    306306    Data.ListVarName=[Data.ListVarName {'Civ2_X','Civ2_Y','Civ2_U','Civ2_V','Civ2_F','Civ2_C'}];%  cell array containing the names of the fields to record
    307     Data.VarDimName=[Data.VarDimName {'NbVec2','NbVec2','NbVec2','NbVec2','NbVec2','NbVec2'}];
     307    Data.VarDimName=[Data.VarDimName {'nb_vec_2','nb_vec_2','nb_vec_2','nb_vec_2','nb_vec_2','nb_vec_2'}];
    308308    Data.VarAttribute{nbvar+1}.Role='coord_x';
    309309    Data.VarAttribute{nbvar+2}.Role='coord_y';
     
    339339    else
    340340        Data.ListVarName=[Data.ListVarName {'Civ2_FF'}];
    341         Data.VarDimName=[Data.VarDimName {'NbVec2'}];
     341        Data.VarDimName=[Data.VarDimName {'nb_vec_2'}];
    342342        nbvar=length(Data.ListVarName);
    343343        Data.VarAttribute{nbvar}.Role='errorflag';   
     
    356356    nbvar=length(Data.ListVarName);
    357357    Data.ListVarName=[Data.ListVarName {'Civ2_U_smooth','Civ2_V_smooth','Civ2_SubRange','Civ2_NbSites','Civ2_Coord_tps','Civ2_U_tps','Civ2_V_tps'}];
    358     Data.VarDimName=[Data.VarDimName {'NbVec2','NbVec2',{'NbCoord','Two','NbSubDomain2'},{'NbSubDomain2'},...
    359              {'NbVec2Sub','NbCoord','NbSubDomain2'},{'Nbtps2','NbSubDomain2'},{'Nbtps2','NbSubDomain2'}}];
    360 %     Data.ListVarName=[Data.ListVarName {'Civ2_U_Diff','Civ2_V_Diff','Civ2_X_SubRange','Civ2_Y_SubRange','Civ2_X_tps','Civ2_Y_tps','Civ2_U_tps','Civ2_V_tps','Civ2_Indices_tps'}];
    361 %     Data.VarDimName=[Data.VarDimName {'NbVec2','NbVec2',{'NbSubDomain2','Two'},{'NbSubDomain2','Two'},...
    362 %              {'NbVec2Sub','NbSubDomain2'},{'NbVec2Sub','NbSubDomain2'},{'Nbtps2','NbSubDomain2'},{'Nbtps2','NbSubDomain2'},{'NbVec2Sub','NbSubDomain2'}}];
     358    Data.VarDimName=[Data.VarDimName {'nb_vec_2','nb_vec_2',{'nb_coord','nb_bounds','nb_subdomain_2'},{'nb_subdomain_2'},...
     359             {'nb_tps_2','nb_coord','nb_subdomain_2'},{'nb_tps_2','nb_subdomain_2'},{'nb_tps_2','nb_subdomain_2'}}];
    363360
    364361        Data.VarAttribute{nbvar+1}.Role='vector_x';
     
    376373    [Data.Civ2_SubRange,Data.Civ2_NbSites,Data.Civ2_Coord_tps,Data.Civ2_U_tps,Data.Civ2_V_tps,tild,Ures, Vres,tild,FFres]=...
    377374         filter_tps([Data.Civ2_X(ind_good) Data.Civ2_Y(ind_good)],Data.Civ2_U(ind_good),Data.Civ2_V(ind_good),[],Data.Patch2_SubDomain,Data.Patch2_Rho,Data.Patch2_Threshold);
     375           fill=zeros(3,2,size(Data.Civ2_SubRange,3)); %matrix of zeros to complement the matrix Data.Civ1_Coord_tps (conveninent for file storage)
     376      Data.Civ2_Coord_tps=cat(1,Data.Civ2_Coord_tps,fill);
    378377    Data.Civ2_U_smooth(ind_good)=Ures;
    379378    Data.Civ2_V_smooth(ind_good)=Vres;
Note: See TracChangeset for help on using the changeset viewer.