naginterfaces.library.interp.dim2_​spline_​grid

naginterfaces.library.interp.dim2_spline_grid(x, y, f)[source]

dim2_spline_grid computes a bicubic spline interpolating surface through a set of data values, given on a rectangular grid in the - plane.

For full information please refer to the NAG Library document for e01da

https://www.nag.com/numeric/nl/nagdoc_28.6/flhtml/e01/e01daf.html

Parameters
xfloat, array-like, shape

and must contain , for , and , for , respectively.

yfloat, array-like, shape

and must contain , for , and , for , respectively.

ffloat, array-like, shape

must contain , for , for .

Returns
pxint

and contain and , the total number of knots of the computed spline with respect to the and variables, respectively.

pyint

and contain and , the total number of knots of the computed spline with respect to the and variables, respectively.

lamdafloat, ndarray, shape

contains the complete set of knots associated with the variable

mufloat, ndarray, shape

contains the complete set of knots associated with the variable

cfloat, ndarray, shape

The coefficients of the spline interpolant. contains the coefficient described in Notes.

Raises
NagValueError
(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

On entry, the or the mesh points are not in strictly ascending order.

(errno )

An intermediate set of linear equations is singular – the data is too ill-conditioned to compute -spline coefficients.

Notes

In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.

dim2_spline_grid determines a bicubic spline interpolant to the set of data points , for , for . The spline is given in the B-spline representation

such that

where and denote normalized cubic B-splines, the former defined on the knots to and the latter on the knots to , and the are the spline coefficients. These knots, as well as the coefficients, are determined by the function, which is derived from the function B2IRE in Anthony et al. (1982). The method used is described in Further Comments.

For further information on splines, see Hayes and Halliday (1974) for bicubic splines and de Boor (1972) for normalized B-splines.

Values and derivatives of the computed spline can subsequently be computed by calling fit.dim2_spline_evalv, fit.dim2_spline_evalm or fit.dim2_spline_derivm as described in Evaluation of Computed Spline.

References

Anthony, G T, Cox, M G and Hayes, J G, 1982, DASL – Data Approximation Subroutine Library, National Physical Laboratory

Cox, M G, 1975, An algorithm for spline interpolation, J. Inst. Math. Appl. (15), 95–108

de Boor, C, 1972, On calculating with B-splines, J. Approx. Theory (6), 50–62

Hayes, J G and Halliday, J, 1974, The least squares fitting of cubic spline surfaces to general data sets, J. Inst. Math. Appl. (14), 89–103