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/griddata_uvmat.m

    r236 r399  
    11%'griddata_uvmat': function griddata_uvmat(vec2_X,vec2_Y,vec2_U,vec_X,vec_Y,'linear')
    22%adapt the input of the matlab function griddata to the appropriate version of Matlab
    3 function ZI = griddata_uvmat(X,Y,Z,XI,YI,rho)
    4 if ~exist('rho','var')|| isequal(rho,0)
     3function ZI = griddata_uvmat(X,Y,Z,XI,YI)
     4% if ~exist('rho','var')|| isequal(rho,0)
    55    txt=ver('MATLAB');
    66    Release=txt.Release;
     
    1313        ZI=griddata(X,Y,Z,XI,YI,'linear');
    1414    end
    15 else %smooth with thin plate spline
    16     [ZI,Z_diff]=patch_uvmat(X,Y,Z,XI,YI,rho);
    17     diff_norm=mean(Z_diff.*Z_diff)
    18     ind_good=find(abs(Z_diff)<5*diff_norm);
    19     nb_remove=numel(Z_diff)-numel(ind_good)
    20     if nb_remove>0
    21     X=X(ind_good);
    22     Y=Y(ind_good);
    23     Z=Z(ind_good);
    24     [ZI,Z_diff]=patch_uvmat(X,Y,Z,XI,YI,rho);
    25     diff_norm_new=mean(Z_diff.*Z_diff)
    26     end
    27 end
     15% else %smooth with thin plate spline
     16%     [ZI,Z_diff]=patch_uvmat(X,Y,Z,XI,YI,rho);
     17%     diff_norm=mean(Z_diff.*Z_diff)
     18%     ind_good=find(abs(Z_diff)<5*diff_norm);
     19%     nb_remove=numel(Z_diff)-numel(ind_good)
     20%     if nb_remove>0
     21%     X=X(ind_good);
     22%     Y=Y(ind_good);
     23%     Z=Z(ind_good);
     24%     [ZI,Z_diff]=patch_uvmat(X,Y,Z,XI,YI,rho);
     25%     diff_norm_new=mean(Z_diff.*Z_diff)
     26%     end
     27% end
Note: See TracChangeset for help on using the changeset viewer.