[AIT logo]

Institut für Astronomie und Astrophysik

Abteilung Astronomie

Sand 1, D-72076 Tübingen, Germany
New Address!   --   Neue Adresse!
[Uni logo]


CSPLINE Source code in cspline.pro

CSPLINE

Name
      CSPLINE
Purpose
      Function to evaluate a natural cubic spline at specified data points
Explanation
      Combines the Numerical Recipes functions SPL_INIT and SPL_INTERP
Calling Sequence
      result = cspline( x, y, t, [ DERIV = ])
Input Parameters
      x - vector of spline node positions, must be monotonic increasing or
          decreasing
      y - vector of node values
      t - x-positions at which to evaluate the spline, scalar or vector
 INPUT-OUTPUT KEYWORD:
      DERIV - values of the second derivatives of the interpolating function
               at the node points.   This is an intermediate step in the
               computation of the natural spline that requires only the X and
               Y vectors.    If repeated interpolation is to be applied to
               the same (X,Y) pair, then some computation time can be saved
               by supplying the DERIV keyword on each call.   On the first call
               DERIV will be computed and returned on output.
Output Parameters
       the values for positions t are returned as the function value
       If any of the input variables are double precision, then the output will
       also be double precision; otherwise the output is floating point.
Example
       The following uses the example vectors from the SPL_INTERP documentation
       IDL> x = (findgen(21)/20.0)*2.0*!PI ;X vector
       IDL> y = sin(x)                     ;Y vector
       IDL> t = (findgen(11)/11.0)*!PI     ;Values at which to interpolate
       IDL> plot,x,y,psym=1                ;Plot original grid
       IDL> oplot, t,cspline(x,y,t),psym=2 ;Overplot interpolated values
Procedure
      The "Numerical Recipes" implementation of the natural cubic spline is
      used, by calling the intrinsic IDL functions SPL_INIT and SPL_INTERP.
Revision History
      version 1  D. Lindler  May, 1989
      version 2  W. Landsman April, 1997
      Rewrite using the intrinsic SPL_INIT & SPL_INTERP functions
      Converted to IDL V5.0   W. Landsman   September 1997
      Work for monotonic decreasing X vector    W. Landsman   February 1999

Last modified by pro2html on 2002 September 27 at 03:47 UTC

[Home Page] [Software, Documentation] [IDL Documentation] [Quick Reference] [Feedback]

Jörn Wilms (wilms@astro.uni-tuebingen.de)
Updated automatically