naginterfaces.library.interp.dim2_scat_shep¶
- naginterfaces.library.interp.dim2_scat_shep(x, y, f, nw, nq)[source]¶
dim2_scat_shep
generates a two-dimensional interpolant to a set of scattered data points, using a modified Shepard method.For full information please refer to the NAG Library document for e01sg
https://support.nag.com/numeric/nl/nagdoc_30.2/flhtml/e01/e01sgf.html
- Parameters
- xfloat, array-like, shape
The Cartesian coordinates of the data points , for .
- yfloat, array-like, shape
The Cartesian coordinates of the data points , for .
- ffloat, array-like, shape
must be set to the data value , for .
- nwint
The number of data points that determines each radius of influence , appearing in the definition of each of the weights , for (see Notes). Note that is different for each weight. If the default value is used instead.
- nqint
The number of data points to be used in the least squares fit for coefficients defining the nodal functions (see Notes). If the default value is used instead.
- Returns
- iqint, ndarray, shape
Integer data defining the interpolant .
- rqfloat, ndarray, shape
Real data defining the interpolant .
- Raises
- NagValueError
- (errno )
On entry, is too small: .
- (errno )
On entry, is too small: .
- (errno )
On entry, and .
Constraint: .
- (errno )
On entry, and .
Constraint: .
- (errno )
On entry, .
Constraint: or .
- (errno )
On entry, .
Constraint: .
- (errno )
There are duplicate nodes in the dataset. , for and . The interpolant cannot be derived.
- (errno )
All nodes are collinear. There is no unique solution.
- Notes
dim2_scat_shep
constructs a smooth function which interpolates a set of scattered data points , for , using a modification of Shepard’s method. The surface is continuous and has continuous first partial derivatives.The basic Shepard (1968) method interpolates the input data with the weighted mean
where , and .
The basic method is global in that the interpolated value at any point depends on all the data, but this function uses a modification (see Franke and Nielson (1980) and Renka (1988a)), whereby the method becomes local by adjusting each to be zero outside a circle with centre and some radius . Also, to improve the performance of the basic method, each above is replaced by a function , which is a quadratic fitted by weighted least squares to data local to and forced to interpolate . In this context, a point is defined to be local to another point if it lies within some distance of it. Computation of these quadratics constitutes the main work done by this function.
The efficiency of the function is further enhanced by using a cell method for nearest neighbour searching due to Bentley and Friedman (1979).
The radii and are chosen to be just large enough to include and data points, respectively, for user-supplied constants and . Default values of these arguments are provided by the function, and advice on alternatives is given in Further Comments.
This function is derived from the function QSHEP2 described by Renka (1988b).
Values of the interpolant generated by this function, and its first partial derivatives, can subsequently be evaluated for points in the domain of the data by a call to
dim2_scat_shep_eval()
.
- References
Bentley, J L and Friedman, J H, 1979, Data structures for range searching, ACM Comput. Surv. (11), 397–409
Franke, R and Nielson, G, 1980, Smooth interpolation of large sets of scattered data, Internat. J. Num. Methods Engrg. (15), 1691–1704
Renka, R J, 1988, Algorithm 660: QSHEP2D: Quadratic Shepard method for bivariate interpolation of scattered data, ACM Trans. Math. Software (14), 149–150
Renka, R J, 1988, Multivariate interpolation of large sets of scattered data, ACM Trans. Math. Software (14), 139–148
Shepard, D, 1968, A two-dimensional interpolation function for irregularly spaced data, Proc. 23rd Nat. Conf. ACM, 517–523, Brandon/Systems Press Inc., Princeton