The SPLINE function performs cubic spline interpolation.
This routine is written in the IDL language. Its source code can be found in the file spline.pro in the lib subdirectory of the IDL distribution.
Result = SPLINE( X, Y, T [, Sigma] [, /DOUBLE] )
Returns the result of the cubic spline interpolation. If X, Y, or T are of type double-precision, then the computations will be done using double-precision and a double-precision result will be returned. Otherwise, single-precision will be used.
The abscissa vector. Values must be monotonically increasing. X must have three or more points.
The vector of ordinate values corresponding to X. Y should have the same number of elements as X.
The vector of abscissa values for which the ordinate is desired. The values of T must be monotonically increasing.
The amount of "tension" that is applied to the curve. The default value is 1.0. If sigma is close to 0, (e.g., .01), then effectively there is a cubic spline fit. If sigma is large, (e.g., greater than 10), then the fit will be like a polynomial interpolation.
Set this keyword to perform computations using double-precision arithmetic and to return a double-precision result.
The commands below show a typical use of SPLINE:
; X values of original function: X = [2.,3.,4.] ; Make a quadratic Y = (X-3)^2 ;Values for interpolated points: T = FINDGEN(20)/10.+2 ; Do the interpolation: Z = SPLINE(X,Y,T)
Introduced: Original
DOUBLE keyword added: 6.1