
csa2lxs is called to find values for an approximating cubic spline for two-dimensional input data at a list of specified coordinates. csa2xs is called if you want to weight the input data values, calculate derivatives, or handle data sparse areas specially. If you do not want to do any of these three things, then use csa2ls.
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 csa2lxs(
xi[*] : float,
yi[*] : float,
zi[*] : float,
wts[*] : float,
knots[2] : integer
smth[1] : float
nderiv[2] : integer
xo[*] : float
yo[*] : float
)
csa2lxs 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
;
; Create the input arrays.
;
xmin = -1.4
xmax = 1.4
ymin = -1.2
ymax = 1.2
ndata = 500
xi = new(ndata,float)
yi = new(ndata,float)
zi = new(ndata,float)
do i=0,ndata-1
xi(i) = xmin + (xmax-xmin)*rand()/32767.
yi(i) = ymin + (ymax-ymin)*rand()/32767.
zi(i) = xi(i) + yi(i)
t1 = 1.0/((fabs(xi(i)-0.1))^2.75 + fabs(yi(i))^2.75 + 0.09)
t2 = 1.0/((fabs(xi(i)+0.1))^2.75 + fabs(yi(i))^2.75 + 0.09)
zi(i) = 0.3*(zi(i)+t1-t2)
end do
;
; Find an approximated value for the second order mixed partial at
; a single point.
;
knots = (/10,10/)
xo = 0.
yo = 0.
knots = 4
wts = -1.
smth = 0.
nderiv = (/1,1/)
zo = csa2lxs(xi,yi,zi,wts,knots,smth,nderiv,xo,yo)
end
NG4.1 Home, Index, Examples, Glossary, Feedback, Ref Contents, Ref WhereAmI?