The SPL_INIT function is called to establish the type of interpolating spline for a tabulated set of functional values X i , Y i = F ( X i ). SPL_INIT returns the values of the 2nd derivative of the interpolating function at the points X i .
It is important to realize that SPL_INIT should be called only once to process an entire tabulated function in arrays X and Y . Once this has been done, values of the interpolated function for any value of X can be obtained by calls (as many as desired) to the separate function SPL_INTERP.
SPL_INIT is based on the routine spline described in section 3.3 of Numerical Recipes in C: The Art of Scientific Computing (Second Edition), published by Cambridge University Press, and is used by permission.
X = (FINDGEN(21)/20.) * 2.0*!PI
PRINT, SPL_INIT(X, Y, YP0 = -1.1, YPN_1 = 0.0)
23.1552 -6.51599 1.06983 -1.26115 -0.839544 -1.04023
-0.950336 -0.817987 -0.592022 -0.311726 2.31192e-05 0.311634
0.592347 0.816783 0.954825 1.02348 0.902068 1.02781
PRINT, SPL_INIT(X, Y, YP0 = -1.1)
23.1552 -6.51599 1.06983 -1.26115 -0.839544 -1.04023
-0.950336 -0.817988 -0.592020 -0.311732 4.41521e-05 0.311555
SPL_INTERP , SPLINE , SPLINE_P