[AIT logo]

Institut für Astronomie und Astrophysik

Abteilung Astronomie

Waldhäuser Str. 64, D-72076 Tübingen, Germany
[Uni logo]


SPLINE_SMOOTH Source code in spline_smooth.pro

SPLINE_SMOOTH

Name
       SPLINE_SMOOTH
Purpose
       Compute a cubic smoothing spline to (weighted) data
Explanation
       Construct cubic smoothing spline (or give regression solution) to given
       data with minimum "roughness" (measured by the energy in the second
       derivatives) while restricting the weighted mean square distance
       of the approximation from the data.  The results may be written to
       the screen or a file or both and are optionally returned in the
       parameters.  The results may be optionally displayed graphically.
Calling Sequence
       SPLINE_SMOOTH,X,Y,Yerr,distance, [coefficients,smoothness,xplot,yplot
               [ XTITLE= ,YTITLE=, INTERP=, TEXTOUT=,/SILENT,/PLOT,/ERRBAR]
Input Parameters
       X - N_POINT element vector containing the data abcissae
       Y - N_POINT element vector containing the data ordinates
       Yerr -     estimated uncertainty in ordinates ( positive scalar)
       distance - upper bound on the weighted mean square distance
                  of the approximation from the data (non-negative scalar)
Optional Input Parameters
      xplot -    vector of spline evaluation abcissae
Optional Input Keywords
       TEXTOUT - Controls print output device, defaults to !TEXTOUT
               textout=1       TERMINAL using /more option
               textout=2       TERMINAL without /more option
               textout=3       .prt
               textout=4       laser.tmp
               textout=5       user must open file
               textout = filename (default extension of .prt)
Optional Output
       coefficients - N_POINT x 4 element array containing the sequence of
                      spline coefficients including the smoothed ordinates.
       smoothness  - N_POINT element vector containing the energy in second
                     derivatives of approximated function.
       yplot       - vector of evaluated spline ordinates.
Optional Keyword Output
       /SILENT     - suppress all printing.
       /PLOT       - display smooth curve, data ordinates and error bars
       /ERRBAR     - display error bars
       XTITLE      - optional title for X-axis
       YTITLE      - optional title for Y-axis
       INTERP      - optionally returned interpolated smooth spline
Note
       This procedure constructs a smoothing spline according to the method
       described in "Fundamentals of Image Processing" by A. Jain  [Prentice-
       Hall : New Jersey 1989].
       If the distance parameter is sufficiently large a linear regression
       is performed, otherwise a cubic smoothing spline is constructed.
       This procedure assumes regular sampling and independent identically
       distributed normal errors without missing data.  The data are sorted.
       SPLINE_SMOOTH uses the non-standard system variables !TEXTOUT and
       !TEXTUNIT.
       These can be added to one's session using the procedure ASTROLIB.
Common Blocks
       None.
Example
       Obtain coefficients of a univariate smoothing spline fitted to data
       X,Y assuming normally distributed errors Yerr and write the results to
       a file.
       IDL> SPLINE_SMOOTH, X, Y, Yerr, distance, coefficients, smoothness,
            t='spline.dat'
       Fit a smoothing spline to observational data.  Suppress all printing
       and save the smoothed ordinates in output variables. Display results.
       IDL> SPLINE_SMOOTH, X, Y, Yerr, distance, coefficients, /SILENT, /PLOT
Procedures Used
       Procedures TEXTOPEN, TEXTCLOSE, PLOT, PLOTERROR
Restrictions
       This procedure is damn slow and should probably be rewritten using
       the Cholesky decomposition.
Author
       Immanuel Freedman (after A. Jain).      December, 1993
 REVISIONS
       January 12, 1994    I. Freedman (HSTX)  Adjusted formats
       March   14, 1994    I. Freedman (HSTX)  Improved convergence
       March   15, 1994    I. Freedman (HSTX)  User-specified interpolates
       Converted to IDL V5.0   W. Landsman   September 1997
       Call PLOTERROR instead of PLOTERR  W. Landsman      February 1999

Last modified by pro2html on 2001 April 26 at 03:13 UTC

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

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