csa1s calculates an approximating cubic spline for one-dimensional input data. If you want to weight the input data values, calculate derivatives, or handle data sparse areas specially, then you will need to use csa1xs.
Note: This function is only available in version 4.1.1 of NCL. If your site is licensed for version 4.1, then you can get version 4.1.1 for free. To get version 4.1.1 of NCAR Graphics software, please contact your site representative. If you don't know who your site representative is, then send email to ncarginf@ucar.edu or call (303) 497-1201.
function csa1s( xi[*] : float, yi[*] : float, knots[1] : integer xo[*] : float )
csa1s is in the csagrid package - a software package that implements a cubic spline approximation algorithm to fit a function to input data. The input for the approximation is a set of randomly-spaced data. These data may be one-dimensional, two-dimensional, or three-dimensional.
The general documentation for csagrid contains several complete examples for entries in the csagrid package.
begin ;----------- Define original data -------------------------------------- xi = (/0.0, 0.1, 0.2, 0.3, 0.5, 0.6, 0.65, 0.8, 0.9, 1./) yi = (/0.0, 0.8, -0.9, -0.9, 0.9, 1.0, 0.90, -0.8, -0.8, 0./) npts = 101 xo = fspan(0.0,1.0,npts) ; Create the output X coordinate array. ;--- Calculate approximated function values using differing number of knots. knots = 4 yo = csa1s(xi,yi,knots,xo) end
NG4.1 Home, Index, Examples, Glossary, Feedback, Ref Contents, Ref WhereAmI?