1c_csa2xs(3NCARG) NCAR GRAPHICS c_csa2xs(3NCARG)
2
3
4
6 c_csa2xs - cubic spline approximation, expanded entry for two-dimen‐
7 sional input, gridded output
8
10 float *c_csa2xs(int, float [], float [], float [], float [], int [], float,
11 int [], int, int, float [], float [], int *);
12
13
14
16 int c_csa2xs(int ni, float xi[], float yi[], float zi[], float wts[],
17 int knots[2], float smth, int nderiv[2], int no, int mo,
18 float xo[], float yo[], int *ier);
19
20
22 ni (integer,input) The number of input data points. It must be
23 that ni is greater than 3 and, depending on the size of
24 knots below, n may have to be larger.
25
26 xi (real, input) An array dimensioned for ni containing the X
27 coordinate values for the input function.
28
29 yi (real, input) An array dimensioned for ni containing the Y
30 coordinate values for the input function.
31
32 zi (real, input) An array containing the functional values of
33 the input function -- zi[k] is the functional value at
34 (xi[k], yi[k]) for k=0,ni-1.
35
36 wts (real, input) An array containing weights for the zi values
37 at the input xi values, that is, wts[l] is a weight for the
38 value of zi[l] for l=0,ni-1. If you do not desire to weight
39 the input zi values, then set wts[0] to -1. The weights in
40 the wts array are relative and may be set to any non-nega‐
41 tive value. When c_csa2xs is called, the weights are summed
42 and the individual weights are normalized so that the
43 weight sum is unity.
44
45 knots (integer, input) The number of knots to be used in each
46 coordinate direction in constructing the approximation
47 spline. knots must be at least 4. The larger the value for
48 knots, the closer the approximated curve will come to pass‐
49 ing through the input function values.
50
51 smth (real, input) A parameter that controls extrapolation into
52 data sparse regions. If smth is zero, then nothing special
53 is done in data sparse regions. A good first choice for
54 smth is 1.
55
56 nderiv (real, input) For each of the two coordinate direction,
57 specifies whether you want functional values (nderiv=0),
58 first derivative values (nderiv=1), or second derivative
59 values (nderiv=2). For example, if nderiv[0]=1 and
60 nderiv[1]=1, then the second order mixed partial would be
61 computed.
62
63 no (integer, input) The number of X coordinate values to be
64 calculated for the output surface.
65
66 mo (integer, input) The number of Y coordinate values to be
67 calculated for the output surface.
68
69 xo (real, input) An array dimensioned for no containing the X
70 coordinate values for the output grid.
71
72 yo (real, output) An array dimensioned for mo containing the Y
73 coordinates of the output grid.
74
75 ier (pointer to integer, output) An error return value. If *ier
76 is returned as 0, then no errors were detected. If *ier is
77 non-zero, then refer to the error list in the error table
78 for details.
79
81 c_csa2xs is called to find an approximating cubic spline surface for
82 two-dimensional input data. c_csa2xs is called if you want to weight
83 the input data values, calculate derivatives, or handle data sparse
84 areas specially. If you do not want to do any of these three things,
85 then use c_csa2s.
86
87 c_csa2xs returns a pointer to a linear array of data that is the
88 approximated grid stored in row-major order. That is, if out is
89 declared as
90
91 float *out;
92
93 and we set:
94
95 out = c_csa2xs(ni, xi, yi, zi, wts, knots, smth, nderiv,
96 no, mo, xo, yo, &ier);
97
98 then out[i*mo+j] is the approximated function value at coordinate point
99 (xo[i], yo[j]) for 0 <= i < no and 0 <= j < mo. The space for out is
100 allocated internal to c_csa2xs and is no * mo floats in size.
101
103 To use c_csa2xs, load the NCAR Graphics library ngmath.
104
106 csagrid, c_csa2s, c_csa2ls, c_csa2lxs
107
108 Complete documentation for Csagrid is available at URL
109 http://ngwww.ucar.edu/ngdoc/ng/ngmath/csagrid/csahome.html
110
112 Copyright (C) 2000
113 University Corporation for Atmospheric Research
114
115 This documentation is free software; you can redistribute it and/or
116 modify it under the terms of the GNU General Public License as pub‐
117 lished by the Free Software Foundation; either version 2 of the
118 License, or (at your option) any later version.
119
120 This software is distributed in the hope that it will be useful, but
121 WITHOUT ANY WARRANTY; without even the implied warranty of MER‐
122 CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
123 Public License for more details.
124
125 You should have received a copy of the GNU General Public License along
126 with this software; if not, write to the Free Software Foundation,
127 Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
128
129
130
131
132UNIX January 1999 c_csa2xs(3NCARG)