1c_ftcurvs1(3NCARG) NCAR GRAPHICS c_ftcurvs1(3NCARG)
2
3
4
6 c_ftcurvs1 - calculate values for a smoothing spline for data in the
7 plane.
8
10 int c_ftcurvs1(int, float [], float [], int, float [],
11 int, float, float, float [], float []);
12
14 int c_ftcurvs1(int n, float xi[], float yi[], int dflg,
15 float d[], int m, float xl, float xr,
16 float xo[], float yo[])
17
19 n The number of input data points. (n > 1)
20
21 xi An array containing the X-coordinates for the input data.
22 These need not be increasing.
23
24 yi An array containing the Y-coordinates for the input data.
25
26 dflg A switch for interpreting the value of d (as described
27 below). If dflg=0, then d is an array of length n (an
28 error estimate for each input data value); if dflg=1, then
29 d is a scalar that serves as an error estimate for every
30 single data item.
31
32 d A user-specified value containing the observed weights. D
33 may be either an array or a scalar, depending on the value
34 of dflg.
35
36 m The number of output values.
37
38 xl A lower limit for an interval of interpolation. The inter‐
39 val between zero and one interpolates the entire curve, any
40 value outside this range results in extrapolation. The
41 interval [xl,xr] is divided into m equal values to produce
42 the interpolated curve.
43
44 xr An upper limit for an interval of interpolation. The
45 interval between zero and one interpolates the entire
46 curve, any value outside this range results in extrapola‐
47 tion. The interval [xl,xr] is divided into m equal values
48 to produce the interpolated curve.
49
50 xo The interpolated X values.
51
52 yo The interpolated Y values.
53
55 c_ftcurvs1 returns an error value as per:
56
57 = 1 if n is less than 2.
58 = 2 if smt is negative.
59 = 3 if eps is negative or greater than 1.
60 = 5 if d is negative.
61
63 This function computes an interpolatory smoothing spline under tension
64 through a sequence of data values in the plane.
65
66 Two parameters and one function argument are used to control the degree
67 of smoothness -- the parameters are smt, and eps and the function argu‐
68 ment is d.
69
70 The argument d is a value indicating the degree of confidence in the
71 accuracy of the input function values -- it should be an approximation
72 of the standard deviation of error. Effectively the value of d controls
73 how close the smoothed curve comes to the input data points. If d is
74 small, then the interpolated curve will pass close to the input data.
75 The larger the value of d, the more freedom the smooth curve has in how
76 close it comes to the input data values.
77
78 The parameter smt is a more subtle global smoothing parameter; smt must
79 be non-negative. For small values of smt, the curve approximates the
80 tension spline and for larger values of smt, the curve is smoother. A
81 reasonable value for smt is (float) n. smt can be set with the proce‐
82 dure c_ftsetr.
83
84 The parameter eps controls the precision to which smt is interpreted;
85 eps must be between 0. and 1. inclusive. A reasonable value for eps
86 sqrt( 2./(float) n ). eps can be set with the procedure c_ftsetr.
87
88 c_ftcurvs1 is called after all of the desired values for control param‐
89 eters have been set using the procedures c_ftseti, c_ftsetr, c_ftsetc.
90 Control parameters that apply to c_ftcurvs are: sig, smt, eps, sf2.
91
92 The value for the parameter sig specifies the tension factor. Values
93 near zero result in a cubic spline; large values (e.g. 50) result in
94 nearly a polygonal line. A typical value is 1. (the default).
95
97 To use c_ftcurvs1, load the NCAR Graphics library ngmath.
98
100 fitgrid_params, c_ftseti, c_ftsetr, c_ftsetc.
101
102 Complete documentation for Fitgrid is available at URL
103 http://ngwww.ucar.edu/ngdoc/ng/ngmath/fitgrid/fithome.html
104
106 Copyright (C) 2000
107 University Corporation for Atmospheric Research
108
109 The use of this Software is governed by a License Agreement.
110
111
112
113UNIX August 2002 c_ftcurvs1(3NCARG)