# csa3ls

csa3ls is called to find values for an approximating cubic spline for three-dimensional input data at a list of specified coordinates. If you want to weight the input data values, calculate derivatives, or handle data sparse areas specially, then you will need to use csa3lxs.

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.

## Synopsis

function csa3ls(
xi[*]    : float,
yi[*]    : float,
zi[*]    : float,
ui[*]    : float,
knots[3] : integer
xo[*]    : float
yo[*]    : float
zo[*]    : float
)

## Arguments

xi
A one-dimensional array of any size containing the X coordinates of the input data points.
yi
A one-dimensional array of the same size as xi containing the Y coordinates of the input data points.
zi
A one-dimensional array of the same size as xi and yi containing the Z coordinates of the input data points.
ui
A one-dimensional array of the same size as xi, yi, and zi containing the functional values at the input data coordinates given by xi, yi, and zi. That is ui[k] is the input function value at (xi[k],yi[k],zi[k]) for k=0 to dimsizes(xi)-1.
knots
The number of knots to be used in constructing the approximating surface. knots(0), knots(1), and knots(2) must all be at least 4. The larger the value for knots, the closer the approximated surface will come to passing through the input function values.
xo
A one-dimensional array containing the X coordinates of a list of points where functional values are desired. xo can be a single point.
yo
A one-dimensional array containing the Y coordinates of a list of points where functional values are desired. yo can be a single point.
zo
A one-dimensional array containing the Z coordinates of a list of points where functional values are desired. zo can be a single point.

## Return value

csa3ls returns a one-dimensional array containing the calculated functional values. If uo is the returned value, then uo has the same size as xo, yo, and zo. That is, uo(i) contains the functional value at coordinate (xo(i), yo(i), zo(i)) for i=0,dimsizes(xo)-1.

## Description

csa3ls 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.

## Example

begin

;
;  Create the input arrays.
;
xmin = -2.
xmax =  2.
ymin = -2.
ymax =  2.
zmin = -2.
zmax =  2.

nx = 21
ny = 21
nz = 21

ndata = 1000
xi = new(ndata,float)
yi = new(ndata,float)
zi = new(ndata,float)
ui = new(ndata,float)

do i=0,ndata-1
xi(i) = xmin + (xmax-xmin)*rand()/32767.
yi(i) = ymin + (ymax-ymin)*rand()/32767.
zi(i) = zmin + (zmax-zmin)*rand()/32767.
ui(i) = xi(i)*xi(i) + yi(i)*yi(i) + zi(i)*zi(i)
end do

;
;  Calculate an approximation value at a single point.
;
knots = (/4,4,4/)
xo = 1.5
yo = 1.0
zo = 0.5
uo = csa3ls(xi,yi,zi,ui,knots,xo,yo,zo)
end

### Reference Manual Control Panel

\$Revision: 1.3 \$ \$Date: 1999/03/18 22:38:59 \$