c_ftcurvs(3NCARG)
π c_ftcurvs β NCAR GRAPHICS β¨
okay bestie, welcome to the c_ftcurvs page from the NCAR GRAPHICS manual (that's section 3NCARG if you're keeping score) π
this is the one that computes a smoothing spline, and yes she eats, let's get into it
π NAME π
c_ftcurvs β compute a smoothing spline. that's it, that's the whole vibe π¦
πΈ FUNCTION PROTOTYPE πΈ
lowkey the glow-up version of the signature, in all its C-flavored glory:
int c_ftcurvs (int, float [], float [], int, float [], int, float [],
float []);
β¨ SYNOPSIS β¨
and here's how you actually call her, bestie:
int c_ftcurvs (n, xi, yi, dflg, d, m, xo, yo);
π DESCRIPTION π
here's the rundown on every single argument, no skips, no cap:
nβ the number of input data points. and btw she has requirements:n > 1. periodt.xiβ an array holding the abscissae for the input function.yiβ an array holding the functional values of the input function. so like,yi[k]is the functional value atx[k]fork=0,n-1.dflgβ a switch that decides how we read the value ofd(more on that below, stay with me π«Ά). ifdflg=0, thendis an array of lengthnβ meaning one error estimate for each input data value. ifdflg=1, thendis a scalar and it serves as the error estimate for every single data item. one number, all the data, iconic.dβ a user-specified value containing the observed weights.dcan be an array or a scalar, and which one it is depends on the value ofdflg. iykyk.mβ the number of output values.xoβ contains the abscissae for the output values.yoβ contains the functional values for the smoothing spline. (yo[k]is the functional value atxo[k]fork=0,n-1.)
π₯ RETURN VALUE π₯
c_ftcurvs hands you back an error value, and here's the whole chart, memorized so you don't have to:
= 1ifnis less than 2.= 2ifsmtis negative.= 3ifepsis negative or greater than 1.= 4ifxvalues are not strictly increasing.= 5ifdis negative.
heads up bestie: every one of those is a real "fix your input" moment, not a suggestion π
π¦ USAGE π¦
so what does she actually do? this function computes an interpolatory smoothing spline under tension through a sequence of functional values. chef's kiss.
two parameters and one function argument control the degree of smoothness β the parameters are smt and eps, and the function argument is d. three little knobs, so much power π
the argument d is a value indicating the degree of confidence in the accuracy of the input function values β it should be an approximation of the standard deviation of error. effectively, the value of d controls how close the smoothed curve comes to the input data points. if d is small, then the interpolated curve will pass close to the input data. the larger the value of d, the more freedom the smooth curve has in how close it comes to the input data values. so small d = clingy curve, big d = free-spirited curve π«
the parameter smt is a more subtle global smoothing parameter, and smt must be non-negative. for small values of smt, the curve approximates the tension spline; for larger values of smt, the curve is smoother. a reasonable value for smt is (float) n. noted π
the parameter eps controls the precision to which smt is interpreted, and eps must be between 0. and 1. inclusive. a reasonable value for eps is sqrt( 2./(float) n ).
c_ftcurvs is called after all of the desired values for control parameters have been set using the procedures c_ftseti, c_ftsetr, and c_ftsetc. order matters, don't skip ahead π«
control parameters that apply to c_ftcurvs are: sig, smt, eps, sf2.
the value for the parameter sig specifies the tension factor. values near zero result in a cubic spline; large values (e.g. 50) result in nearly a polygonal line. a typical value is 1. β which is also the default, conveniently β¨
π ACCESS π
to use c_ftcurvs, load the NCAR Graphics library ngmath. that's the whole assignment π
β SEE ALSO β
go read these next, bestie, they're the friend group:
fitgrid_paramsc_ftsetic_ftsetrc_ftsetc
complete documentation for Fitgrid is available at URL http://ngwww.ucar.edu/ngdoc/ng/ngmath/fitgrid/fithome.html π
π COPYRIGHT π
Copyright (C) 2000 University Corporation for Atmospheric Research
The use of this Software is governed by a License Agreement.
and that's the page!! this one came straight out of the UNIX manual, dated March 1998, filed under c_ftcurvs(3NCARG) β so if you ever need to cite her, that's the source, and that's the version. mwah π go smooth some splines, you got this π«ΆπΈ
π¦ where this page comes from
- epel 9: ncl-devel 6.6.2-59.el9 Β· LicenseRef-Callaway-BSD
- fedora 43: ncl-devel 6.6.2-58.fc43 Β· LicenseRef-Callaway-BSD
- fedora 44: ncl-devel 6.6.2-62.fc44 Β· LicenseRef-Callaway-BSD
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms