Ignore:
Timestamp:
Apr 25, 2024, 5:56:32 PM (6 months ago)
Author:
sommeria
Message:

series/test patch added + some bug corrections

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/filter_tps.m

    r1137 r1139  
    11%'filter_tps': find the thin plate spline coefficients for interpolation-smoothing
    22%------------------------------------------------------------------------
    3 % [SubRange,NbCentre,Coord_tps,U_tps,V_tps,W_tps,U_smooth,V_smooth,W_smooth,FF] =filter_tps(Coord,U,V,W,SubDomainSize,Rho,Threshold)
     3% [SubRange,NbCentre,Coord_tps,U_tps,V_tps,W_tps,U_smooth,V_smooth,W_smooth,FF] =filter_tps(Coord,U,V,W,SubDomainSize,FieldSmooth,Threshold)
    44%
    55% OUTPUT:
     
    1616% U,V, possibly W: set of velocity components of the initial data
    1717% SubdomainSize: estimated number of data points in each subdomain
    18 % Rho: smoothing parameter
     18% FieldSmooth: smoothing parameter
    1919% Threshold: max diff accepted between smoothed and initial data
    2020
     
    3838%=======================================================================
    3939
    40 function [SubRange,NbCentre,Coord_tps,U_tps,V_tps,W_tps,U_smooth,V_smooth,W_smooth,FF] =filter_tps(Coord,U,V,W,SubDomainSize,Rho,Threshold)
     40function [SubRange,NbCentre,Coord_tps,U_tps,V_tps,W_tps,U_smooth,V_smooth,W_smooth,FF] =filter_tps(Coord,U,V,W,SubDomainSize,FieldSmooth,Threshold)
    4141
    4242%% adjust subdomain decomposition
     
    6161
    6262%% smoothing parameter
    63 rho=Siz(1)*Siz(2)*Rho/1000;%optimum rho increase as the area of the subdomain (division by 1000 to reach good values with the default GUI input)
     63smoothing=Siz(1)*Siz(2)*FieldSmooth/1000;%optimum smoothing increase as the area of the subdomain (division by 1000 to reach good values with the default GUI input)
    6464
    6565%% default output
     
    100100        % subdomain includes enough vectors, perform tps interpolation
    101101        else
    102             [U_smooth_sub,U_tps_sub]=tps_coeff(Coord(ind_sel,:),U(ind_sel),rho);
    103             [V_smooth_sub,V_tps_sub]=tps_coeff(Coord(ind_sel,:),V(ind_sel),rho);
     102            [U_smooth_sub,U_tps_sub]=tps_coeff(Coord(ind_sel,:),U(ind_sel),smoothing);
     103            [V_smooth_sub,V_tps_sub]=tps_coeff(Coord(ind_sel,:),V(ind_sel),smoothing);
    104104            UDiff=U_smooth_sub-U(ind_sel);% difference between interpolated U component and initial value
    105105            VDiff=V_smooth_sub-V(ind_sel);% difference between interpolated V component and initial value
     
    132132            % else interpolation-smoothing is done again with the selected vectors
    133133            else
    134                 [U_smooth_sub,U_tps_sub]=tps_coeff(Coord(ind_sel(ind_ind_sel),:),U(ind_sel(ind_ind_sel)),rho);
    135                 [V_smooth_sub,V_tps_sub]=tps_coeff(Coord(ind_sel(ind_ind_sel),:),V(ind_sel(ind_ind_sel)),rho);
     134                [U_smooth_sub,U_tps_sub]=tps_coeff(Coord(ind_sel(ind_ind_sel),:),U(ind_sel(ind_ind_sel)),smoothing);
     135                [V_smooth_sub,V_tps_sub]=tps_coeff(Coord(ind_sel(ind_ind_sel),:),V(ind_sel(ind_ind_sel)),smoothing);
    136136                x_width=(SubRange(1,2,isub)-SubRange(1,1,isub))/pi;
    137137                y_width=(SubRange(2,2,isub)-SubRange(2,1,isub))/pi;
Note: See TracChangeset for help on using the changeset viewer.