Changeset 651 for trunk/src/filter_tps.m


Ignore:
Timestamp:
Jun 25, 2013, 12:48:10 AM (11 years ago)
Author:
sommeria
Message:

various bugs corrected. Introduction of campaign lists in Open menu

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/filter_tps.m

    r582 r651  
    11%'filter_tps': find the thin plate spline coefficients for interpolation-smoothing
    22%------------------------------------------------------------------------
    3 % [SubRange,NbCentres,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)
    44%
    55% OUTPUT:
    66% SubRange(NbCoord,NbSubdomain,2): range (min, max) of the coordiantes x and y respectively, for each subdomain
    7 % NbCentres(NbSubdomain): number of source points for each subdomain
     7% NbCentre(NbSubdomain): number of source points for each subdomain
    88% FF: false flags
    99% U_smooth, V_smooth: filtered velocity components at the positions of the initial data
    10 % Coord_tps(NbCentres,NbCoord,NbSubdomain): positions of the tps centres
     10% Coord_tps(NbCentre,NbCoord,NbSubdomain): positions of the tps centres
    1111% U_tps,V_tps: weight of the tps for each subdomain
    1212% to get the interpolated field values, use the function calc_field.m
     
    1919% Subdomain: estimated number of data points in each subdomain
    2020
    21 function [SubRange,NbCentres,Coord_tps,U_tps,V_tps,W_tps,U_smooth,V_smooth,W_smooth,FF] =filter_tps(Coord,U,V,W,SubDomain,Rho,Threshold)
     21function [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)
    2222
    2323%% adjust subdomain decomposition
     
    4646%% default output
    4747SubRange=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
     48NbCentre=zeros(1,NbSubDomain);%number of interpolated values per subdomain, =0 by default
    5249W_tps=[];%default (2 component case)
    5350U_smooth=zeros(NbVec,1); % smoothed velocity U at the initial positions
     
    9390                U_smooth(ind_sel)=U_smooth(ind_sel)+U_smooth_sub;
    9491                V_smooth(ind_sel)=V_smooth(ind_sel)+V_smooth_sub;
    95                 NbCentres(isub)=numel(ind_sel);
    96                 Coord_tps(1:NbCentres(isub),:,isub)=Coord(ind_sel,:);
    97                 U_tps(1:NbCentres(isub)+3,isub)=U_tps_sub;
    98                 V_tps(1:NbCentres(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;
    9996                nb_select(ind_sel)=nb_select(ind_sel)+1;
    10097                display('good')
     
    110107                U_smooth(ind_sel(ind_ind_sel))=U_smooth(ind_sel(ind_ind_sel))+U_smooth_sub;
    111108                V_smooth(ind_sel(ind_ind_sel))=V_smooth(ind_sel(ind_ind_sel))+V_smooth_sub;
    112                 NbCentres(isub)=numel(ind_ind_sel);
    113                 Coord_tps(1:NbCentres(isub),:,isub)=Coord(ind_sel(ind_ind_sel),:);
    114                 U_tps(1:NbCentres(isub)+3,isub)=U_tps_sub;
    115                 V_tps(1:NbCentres(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;
    116113                nb_select(ind_sel(ind_ind_sel))=nb_select(ind_sel(ind_ind_sel))+1;
    117114                display('good2')
Note: See TracChangeset for help on using the changeset viewer.