Changeset 651 for trunk/src/filter_tps.m
- Timestamp:
- Jun 25, 2013, 12:48:10 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/filter_tps.m
r582 r651 1 1 %'filter_tps': find the thin plate spline coefficients for interpolation-smoothing 2 2 %------------------------------------------------------------------------ 3 % [SubRange,NbCentre s,Coord_tps,U_tps,V_tps,W_tps,U_smooth,V_smooth,W_smooth,FF] =filter_tps(Coord,U,V,W,SubDomain,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,SubDomain,Rho,Threshold) 4 4 % 5 5 % OUTPUT: 6 6 % SubRange(NbCoord,NbSubdomain,2): range (min, max) of the coordiantes x and y respectively, for each subdomain 7 % NbCentre s(NbSubdomain): number of source points for each subdomain7 % NbCentre(NbSubdomain): number of source points for each subdomain 8 8 % FF: false flags 9 9 % U_smooth, V_smooth: filtered velocity components at the positions of the initial data 10 % Coord_tps(NbCentre s,NbCoord,NbSubdomain): positions of the tps centres10 % Coord_tps(NbCentre,NbCoord,NbSubdomain): positions of the tps centres 11 11 % U_tps,V_tps: weight of the tps for each subdomain 12 12 % to get the interpolated field values, use the function calc_field.m … … 19 19 % Subdomain: estimated number of data points in each subdomain 20 20 21 function [SubRange,NbCentre s,Coord_tps,U_tps,V_tps,W_tps,U_smooth,V_smooth,W_smooth,FF] =filter_tps(Coord,U,V,W,SubDomain,Rho,Threshold)21 function [SubRange,NbCentre,Coord_tps,U_tps,V_tps,W_tps,U_smooth,V_smooth,W_smooth,FF] =filter_tps(Coord,U,V,W,SubDomain,Rho,Threshold) 22 22 23 23 %% adjust subdomain decomposition … … 46 46 %% default output 47 47 SubRange=zeros(NbCoord,2,NbSubDomain);%initialise the positions of subdomains 48 NbCentres=zeros(1,NbSubDomain);%number of interpolated values per subdomain, =0 by default 49 %Coord_tps=zeros(NbVec,NbCoord,NbSubDomain);% default positions of the tps source= initial positions of the good vectors sorted by subdomain 50 %U_tps=zeros(NbVec,NbSubDomain);%default spline 51 %V_tps=zeros(NbVec,NbSubDomain);%default spline 48 NbCentre=zeros(1,NbSubDomain);%number of interpolated values per subdomain, =0 by default 52 49 W_tps=[];%default (2 component case) 53 50 U_smooth=zeros(NbVec,1); % smoothed velocity U at the initial positions … … 93 90 U_smooth(ind_sel)=U_smooth(ind_sel)+U_smooth_sub; 94 91 V_smooth(ind_sel)=V_smooth(ind_sel)+V_smooth_sub; 95 NbCentre s(isub)=numel(ind_sel);96 Coord_tps(1:NbCentre s(isub),:,isub)=Coord(ind_sel,:);97 U_tps(1:NbCentre s(isub)+3,isub)=U_tps_sub;98 V_tps(1:NbCentre s(isub)+3,isub)=V_tps_sub;92 NbCentre(isub)=numel(ind_sel); 93 Coord_tps(1:NbCentre(isub),:,isub)=Coord(ind_sel,:); 94 U_tps(1:NbCentre(isub)+3,isub)=U_tps_sub; 95 V_tps(1:NbCentre(isub)+3,isub)=V_tps_sub; 99 96 nb_select(ind_sel)=nb_select(ind_sel)+1; 100 97 display('good') … … 110 107 U_smooth(ind_sel(ind_ind_sel))=U_smooth(ind_sel(ind_ind_sel))+U_smooth_sub; 111 108 V_smooth(ind_sel(ind_ind_sel))=V_smooth(ind_sel(ind_ind_sel))+V_smooth_sub; 112 NbCentre s(isub)=numel(ind_ind_sel);113 Coord_tps(1:NbCentre s(isub),:,isub)=Coord(ind_sel(ind_ind_sel),:);114 U_tps(1:NbCentre s(isub)+3,isub)=U_tps_sub;115 V_tps(1:NbCentre s(isub)+3,isub)=V_tps_sub;109 NbCentre(isub)=numel(ind_ind_sel); 110 Coord_tps(1:NbCentre(isub),:,isub)=Coord(ind_sel(ind_ind_sel),:); 111 U_tps(1:NbCentre(isub)+3,isub)=U_tps_sub; 112 V_tps(1:NbCentre(isub)+3,isub)=V_tps_sub; 116 113 nb_select(ind_sel(ind_ind_sel))=nb_select(ind_sel(ind_ind_sel))+1; 117 114 display('good2')
Note: See TracChangeset
for help on using the changeset viewer.