Ignore:
Timestamp:
Apr 21, 2023, 11:01:06 AM (17 months ago)
Author:
sommeria
Message:

various updates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/tps_coeff_field.m

    r1107 r1122  
    11%'tps_coeff_field': calculate the thin plate spline (tps) coefficients within subdomains for a field structure
    22%---------------------------------------------------------------------
    3 % DataOut=tps_coeff_field(DataIn,checkall)
     3% DataOut=tps_coeff_field(DataIn,checkall,Smoothing)
    44%
    55% OUTPUT:
     
    1313% checkall:=1 if tps is needed for all fields (a projection mode interp_tps has been chosen),
    1414%          =0 otherwise (tps only needed to get spatial derivatives of scattered data)
    15 %
     15% Smoothing parameter: =0 (no smoothing) by default
     16
    1617% called functions:
    1718% 'find_field_cells': analyse the input field structure, grouping the variables  into 'fields' with common coordinates
     
    3738%=======================================================================
    3839
    39 function [DataOut,errormsg]=tps_coeff_field(DataIn,checkall)     
     40function [DataOut,errormsg]=tps_coeff_field(DataIn,checkall,Smoothing)     
    4041DataOut=DataIn;%default
     42if ~exist('Smoothing','var')
     43Smoothing=0;
     44end
    4145SubDomainNbPoint=1000; %default, estimated nbre of data source points in a subdomain used for tps
    4246if isfield(DataIn,'SubDomain')
     
    5357nbtps=0;% indicate the number of tps coordinate sets in the field structure (in general =1)
    5458
    55 for icell=1:numel(CellInfo);
     59for icell=1:numel(CellInfo)
    5660    if NbDimArray(icell)>=2 && strcmp(CellInfo{icell}.CoordType,'scattered') %if the coordinates are scattered
    5761        NbCoord=NbDimArray(icell);% dimension of space
     
    129133                for isub=1:size(SubRange,3)
    130134                    ind_sel=IndSelSubDomain(1:NbCentre(isub),isub);% array indices selected for the subdomain
    131                     [tild,Var_tps(1:NbCentre(isub)+NbCoord+1,isub)]=tps_coeff([X(ind_sel) Y(ind_sel)],DataIn.(ListVarInterp{ilist})(ind_sel),0);%calculate the tps coeff in the subdomain
     135                    [tild,Var_tps(1:NbCentre(isub)+NbCoord+1,isub)]=tps_coeff([X(ind_sel) Y(ind_sel)],DataIn.(ListVarInterp{ilist})(ind_sel),Smoothing);%calculate the tps coeff in the subdomain
    132136                end
    133137                DataOut.(ListNewVar{ilist+3})=Var_tps;
Note: See TracChangeset for help on using the changeset viewer.