Changeset 1139 for trunk/src/filter_tps.m
- Timestamp:
- Apr 25, 2024, 5:56:32 PM (6 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/filter_tps.m
r1137 r1139 1 1 %'filter_tps': find the thin plate spline coefficients for interpolation-smoothing 2 2 %------------------------------------------------------------------------ 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) 4 4 % 5 5 % OUTPUT: … … 16 16 % U,V, possibly W: set of velocity components of the initial data 17 17 % SubdomainSize: estimated number of data points in each subdomain 18 % Rho: smoothing parameter18 % FieldSmooth: smoothing parameter 19 19 % Threshold: max diff accepted between smoothed and initial data 20 20 … … 38 38 %======================================================================= 39 39 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)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,FieldSmooth,Threshold) 41 41 42 42 %% adjust subdomain decomposition … … 61 61 62 62 %% smoothing parameter 63 rho=Siz(1)*Siz(2)*Rho/1000;%optimum rhoincrease as the area of the subdomain (division by 1000 to reach good values with the default GUI input)63 smoothing=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) 64 64 65 65 %% default output … … 100 100 % subdomain includes enough vectors, perform tps interpolation 101 101 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); 104 104 UDiff=U_smooth_sub-U(ind_sel);% difference between interpolated U component and initial value 105 105 VDiff=V_smooth_sub-V(ind_sel);% difference between interpolated V component and initial value … … 132 132 % else interpolation-smoothing is done again with the selected vectors 133 133 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); 136 136 x_width=(SubRange(1,2,isub)-SubRange(1,1,isub))/pi; 137 137 y_width=(SubRange(2,2,isub)-SubRange(2,1,isub))/pi;
Note: See TracChangeset
for help on using the changeset viewer.