CURVPS(3NCARG)
β¨ CURVPS β¨ (bestie edition, from the NCAR Graphics manual π)
okay so real talk: this one is CURVPS, and it lives in the NCAR Graphics docs. she's a Fortran-era queen and she's here to help you smooth out a periodic function. let's get into it π¦
π NAME π
CURVPS β calculate values for a smoothing spline for a periodic function.
periodt. that's the whole job.
πΈ SYNOPSIS πΈ
CALL CURVPS (N, X, Y, P, D, ISW, S, EPS, YS, YSP, SIGMA, TEMP, IER)
so here's the tea β β this subroutine calculates certain values that are used by CURVP2 in order to compute an interpolatory smoothing spline under tension through a sequence of functional values for a periodic function. and listen, because this part matters: the actual computation of the interpolated values must be done using CURVP2. CURVPS is the setup girlie, CURVP2 is the one who actually shows up to the party. two different jobs, both iconic. π
three parameters are used to control the degree of smoothness β D, S, and EPS. let's vibe check them one by one:
Dβ a value indicating the degree of confidence in the accuracy of the input function values, and it should be an approximation of the standard deviation of error. effectively the value ofDcontrols how close the smoothed curve comes to the input data points. ifDis small then the interpolated curve will pass close to the input data. the larger the value ofD, the more freedom the smooth curve has in how close it comes to the input data values. so likeβ¦ smallD= clingy, bigD= giving the curve space to breathe. π«ΆSβ a more subtle global smoothing parameter, okay? she's lowkey but highkey important.Smust be non-negative. for small values ofS, the curve approximates the tension spline, and for larger values ofS, the curve is smoother. a reasonable value forSisREAL(N). β¨EPSβ controls the precision to whichSis interpreted.EPSmust be between0.and1.inclusive. a reasonable value forEPSisSQRT(2./REAL(N)). no cap, that's literally what the docs say. π
π DESCRIPTION π
here come the arguments, bestie. every single one, no skipping, we do not gatekeep π
N(integer, input) β the number of input data values. (N > 1)X(integer, input) β an array containing the abscissae for the input function.Y(integer, input) β an array containing the functional values for the input function.Y(K)is the functional value atX(K)forK=1,N.P(real, input) β the period of the function.D(integer, input) β a user-specified value containing the observed weights.Dmay be either an array or a scalar, depending on the value ofISW(as described below). she's flexible like that πISW(integer, input) β a switch for interpreting the value ofD. ifISW=0, thenDis an array of lengthN(Dcontains an individual error estimate for each input data value); ifISW=1, thenDis a scalar that serves as an error estimate for every single data item. pick your fighter. π₯S(integer, input) β contains the value for smoothing.Smust be non-negative. larger values forSyield greater smoothing. a reasonable value isREAL(N).EPS(integer, input) β contains a tolerance value for the relative precision to whichSshould be interpreted.EPSmust be between0.and1.inclusive. a reasonable value isSQRT(2./REAL(N)).YS(integer, input) β an array of lengthN.YSP(integer, input) β an array of lengthN.SIGMA(integer, input) β tension factor. values near zero result in a cubic spline; large values (e.g.50) result in nearly a polygonal line. a typical value is1. soSIGMAis basically the drama meter π β tinySIGMA= soft and flowy, bigSIGMA= sharp and angular.TEMP(integer, input) β scratch space. she's just there to hold your stuff, no questions asked. πIER(integer, input) β an error return value. ifIERis returned as0, then no errors were detected. otherwise, she will tell on you:= 1ifNis less than 2.= 2ifSis negative.= 3ifEPSis negative or greater than 1.= 4ifXvalues are not strictly increasing.= 5ifDis negative.= 6ifPis less than or equal toX(N)-X(1).
not me coding IER checks into my personality π fr fr, read your error codes. she's not being dramatic, she's being informative.
π ACCESS π
to use CURVPS, load the NCAR Graphics library ngmath.
that's it. that's the access. go off. π«
π¦ SEE ALSO π¦
curvp2fitgrid_params
complete documentation for Fitgrid is available at URL http://ngwww.ucar.edu/ngdoc/ng/ngmath/fitgrid/fithome.html
iykyk, go read the whole Fitgrid saga if you want the lore. π
π COPYRIGHT π
Copyright (C) 2000 University Corporation for Atmospheric Research
the use of this Software is governed by a License Agreement.
and that's the whole page, bestie β this was CURVPS(3NCARG) from the UNIX manual, dated March 1998, and you absolutely ate by reading the whole thing. slay π
β¨ π π¦ πΈ π
π¦ where this page comes from
- debian bookworm: libncarg-dev 6.6.2.dfsg.1-1
- debian trixie: libncarg-dev 6.6.2.dfsg.1-10+b2
- ubuntu jammy: libncarg-dev 6.6.2-10build2
- ubuntu questing: libncarg-dev 6.6.2.dfsg.1-10build2
- ubuntu resolute: libncarg-dev 6.6.2.dfsg.1-12
- ubuntu stonking: libncarg-dev 6.6.2.dfsg.1-12build2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms