|
IDL Analyst Reference Guide: Interpolation and Approximation |
|
The IMSL_SCAT2DINTERP function computes a smooth bivariate interpolant to scattered data that is locally a quintic polynomial in two variables.
| Note This routine requires an IDL Analyst license. For more information, contact your ITT Visual Information Solutions sales or technical support representative. |
Result = IMSL_SCAT2DINTERP(xydata, fdata, xout, yout [, /DOUBLE])
A two-dimensional array containing the grid of values of the interpolant.
Two-dimensional array containing the data points for the interpolation problem. Argument xydata is dimensioned (2, N_ELEMENTS (fdata)). The i-th data point (xi, yi) is stored in xydata (0, i) = xi and xydata (1, i) = yi.
One-dimensional array containing the values to be interpolated.
One-dimensional array specifying the x values for the output grid. It must be strictly increasing.
One-dimensional array specifying the y values for the output grid. It must be strictly increasing.
If present and nonzero, double precision is used.
The IMSL_SCAT2DINTERP function computes a C1 interpolant to scattered data in the plane. Given the data points (in R3):

where n = N_ELEMENTS(xydata) / 2, IMSL_SCAT2DINTERP returns the values of the interpolant s on the user-specified grid. The computation of s is as follows.
First, the Delaunay triangulation of the points:
is computed. On each triangle T in this triangulation, s has the following form:

Thus, s is a bivariate quintic polynomial on each triangle of the triangulation. In addition:
and s is continuously differentiable across the boundaries of neighboring triangles. These conditions do not exhaust the freedom implied by the above representation. This additional freedom is exploited in an attempt to produce an interpolant that is faithful to the global shape properties implied by the data. For more information on this procedure, refer to the article by Akima (1978). The output grid is specified by the two real vectors, xout and yout, that represent the first (second) coordinates of the grid.
In this example, IMSL_SCAT2DINTERP is used to fit a surface to randomly scattered data. The resulting surface and the original data points are then plotted as shown in Figure 6-15.
IMSL_RANDOMOPT, Set = 12345 ndata = 15 xydata = FLTARR(2, ndata) xydata(*) = IMSL_RANDOM(2 * ndata) fdata = IMSL_RANDOM(ndata) x = xydata(0, *) y = xydata(1, *) ngrid = 20 xout = FINDGEN(ngrid)/(ngrid - 1) yout = FINDGEN(ngrid)/(ngrid - 1) ; Define the grid used to evaluate the computed surface. surf = IMSL_SCAT2DINTERP(xydata, fdata, xout, yout) ; Call IMSL_SCAT2DINTERP. SURFACE, surf, xout, yout, /Save, Ax = 45, Charsize = 1.5 ; Plot the computed surface. PLOTS, x, y, fdata, /T3d, Symsize = 2, Psym = 2 ; Plot the original data points.
MATH_DUPLICATE_XYDATA_VALUES—Two-dimensional data values must be distinct.
MATH_XOUT_NOT_STRICTLY_INCRSING—Vector xout must be strictly increasing.
MATH_YOUT_NOT_STRICTLY_INCRSING—Vector yout must be strictly increasing.
IDL Online Help (March 06, 2007)