csa3xs calculates an approximating cubic spline for
three-dimensional input data.
is called if you want to
the input data values,
sparse areas specially.
If you do not want to do any of these three things, then use
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 email@example.com or call (303)
xi[*] : float,
yi[*] : float,
zi[*] : float,
ui[*] : float,
wts[*] : float,
knots : integer
smth : float
nderiv : float
xo[*] : float
yo[*] : float
zo[*] : float
- A one-dimensional array of any size containing the X coordinates of the
input data points.
- A one-dimensional array of the same size as xi containing the Y
coordinates of the input data points.
- A one-dimensional array of the same size as xi and yi
containing the Z coordinates of the input data points.
- A one-dimensional array of the same size as xi, yi,
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
- An array containing weights for the ui values at the input
xi, yi, and zi values.
That is, wts(k) is a weight for the value
of ui(k) for k=0,dimsizes(xi)-1.
If you do not desire to weight the input ui values, then set
wts to -1, and in that case wts can be a scalar.
The weights in the wts array are relative and
may be set to any non-negative value. When csa3xs is called,
the weights are summed and the individual weights are normalized
so that the weight sum is unity.
- The number of knots to be used in constructing the approximating
spline. 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.
- A parameter that controls extrapolation into data sparse regions.
If smth is zero, then nothing special is done in data sparse
regions. A good first choice for smth is 1.
- Specifies whether you want functional values (=0),
first derivative values (=1), or second derivative
values (=2) in each of the three coordinate directions.
- A one-dimensional array containing the X coordinates of the
- A one-dimensional array containing the Y coordinates of the
- A one-dimensional array containing the Z coordinates of the
csa3xs returns a three-dimensional array containing the
calculated functional values. The first dimension of the
returned value has the same size as xo, the
second dimension of the returned value has the same size as yo,
and the third dimension of the returned value has the same size as
If uo is the returned value, then uo(i,j,k)
contains the functional value at coordinate
csa3xs is in the
- 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
for entries in the csagrid package.
; 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)
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)
; Set up the output grid.
xo = fspan(xmin,xmax,nx)
yo = fspan(ymin,ymax,ny)
zo = fspan(zmin,zmax,nz)
; Calculate the values for the approximating cubic spline for the
; first partial derivative with respect to Y.
knots = (/4,4,4/)
wts = -1.
smth = 0.
nderiv = (/0,1,0/)
uo = csa3xs(xi,yi,zi,ui,wts,knots,smth,nderiv,xo,yo,zo)
Reference Manual Control Panel
NG4.1 Home, Index, Examples, Glossary, Feedback, Ref Contents, Ref WhereAmI?
$Revision: 1.3 $ $Date: 1999/03/18 22:39:00 $