CPSPS1(3NCARG)

πŸ“¦ version 6.6.2, in epel 9, fedora 43, fedora 44

πŸ’– CPSPS1 πŸ’–

okay bestie, welcome to the NCAR GRAPHICS manual, and this one is a whole vibe. it's CPSPS1, and it lives in section 3NCARG of the manual. pull up a chair, we're doing splines today. πŸŽ€


✨ NAME ✨

CPSPS1 interpolates from an array of data on a "sparse" rectangular grid β€” one that's regularly spaced in X and Y β€” onto an array of data on a "dense" rectangular grid, and it also initializes contouring from the array on that dense grid. and like, what do we mean by "sparse"? we mean a grid whose dimensions are smaller than you'd ideally want, so that contour lines built directly on it are just long straight segments. it's giving connect-the-dots. 😭 CPSPS1 can honestly be viewed as a data smoothing routine, no cap. πŸ’…

CPSPRS is an alternate name for the routine. same girl, different name tag. 🫢


✨ SYNOPSIS ✨

 CALL CPSPS1 (ZSPS, KSPS, MSPS, NSPS, RWRK, LRWK, IWRK,
+ LIWK, ZDAT, LZDT)

πŸ¦‹ C-BINDING SYNOPSIS πŸ¦‹

#include <ncarg/ncargC.h>

void c_cpsps1 (float *zsps, int ksps, int msps, int nsps,
float *rwrk, int lrwk, int *iwrk, int liwk, float *zdat,
int lzdt)

🌸 DESCRIPTION 🌸

so here's the whole cast, one by one, and yes we're doing all of them because every single one matters. ⭐

  • ZSPS β€” (REAL array, dimensioned KSPS x n, where n is greater than or equal to NSPS, input) this is the "sparse" array of data, like the raw material, and it's the thing the "dense" array gets generated from. ✨
  • KSPS β€” (INTEGER, input) the first dimension of the array ZSPS.
  • MSPS β€” (INTEGER, input) the first dimension of the "sparse" array of data in ZSPS. and listen: MSPS must be less than or equal to KSPS. rule is the rule. πŸ’…
  • NSPS β€” (INTEGER, input) the second dimension of the "sparse" array of data in ZSPS. NSPS must be less than or equal to the declared second dimension of the array ZSPS. πŸŽ€
  • RWRK β€” (REAL array, dimensioned LRWK, input/output) the real work array. it works. that's its job.
  • LRWK β€” (INTEGER, input) the length of RWRK.
  • IWRK β€” (INTEGER array, dimensioned LIWK, input/output) the integer work array. twin of RWRK but for integers, slay.
  • LIWK β€” (INTEGER, input) the length of IWRK.
  • ZDAT β€” (REAL array, dimensioned LZDT, output) the array where the interpolated "dense" array of data comes back to you. πŸ’– the dimensions of the interpolated array may be supplied by you, the user, or determined by Conpack, depending on the value of the parameter 'ZDS'. and heads up bestie: if the size of the dense array is not a product of the size of the sparse array and some perfect square, the aspect ratio of the dense grid may end up slightly different from that of the sparse grid. it's giving "close enough". πŸ™ˆ
  • LZDT β€” (INTEGER, input) the length of ZDAT.

πŸ’œ C-BINDING DESCRIPTION πŸ’œ

the C-binding argument descriptions are the same as the FORTRAN argument descriptions, with the following exceptions, and you know we're listing them:

  • zsps(l,ksps) β€” dimensioned l by ksps, where l β‰₯ nsps.
  • ksps β€” the second dimension of the array zsps.
  • msps β€” the second dimension of the sparse array of data in zsps. msps ≀ ksps.
  • nsps β€” the first dimension of the sparse array of data in zsps. nsps ≀ l, where l is the declared first dimension of the array zsps.

πŸ”₯ USAGE πŸ”₯

okay so this is the part where it gets real. CPSPS1 performs the same functions as CPRECT, but in addition it interpolates from a sparse array of data to a dense array of data. it does this by using the routines BSURF1 and BSURF2, from the package Fitpack, by Alan K. Cline β€” icon behavior, honestly β€” to fit bicubic splines under tension to the sparse array of data, and to compute the dense grid of data that gets returned to you. πŸ¦‹

the tension on the spline surfaces is specified by the parameter 'T3D'. by default, CPSPS1 selects the dimensions of the dense array of data; if you want, you can specify these dimensions yourself by setting the parameter 'ZDS' non-zero and the parameters 'ZD1', 'ZDM', and 'ZDN' to the values you want. either way, once 'ZD1', 'ZDM', and 'ZDN' are set, you should not reset them until the contour plot is complete and a different contour plot is about to be drawn. don't be chaotic about it. πŸ’…

and now, the special-value tea β˜• because the routines BSURF1 and BSURF2 do not have a built-in special value feature: if the special value parameter 'SPV' is set non-zero and the sparse array contains occurrences of that value, special action must be taken. here's what happens β€” the indices of the special values in the sparse array are saved in a part of the integer workspace array; the special values are then replaced by values interpolated from adjacent grid points, and the resulting array is used to obtain the dense array; then, the special values in the sparse array are restored, and the corresponding elements of the dense array are also given the special value. it's a whole glow-up and un-glow-up, in that order. πŸ’–


πŸŽ€ EXAMPLES πŸŽ€

use the ncargex command to see the following relevant examples: ccpline, ccpsps1. go look, they're cute. ✨


🌈 ACCESS 🌈

to use CPSPS1 or c_cpsps1, load the NCAR Graphics libraries ncarg, ncarg_gks, and ncarg_c, preferably in that order. order matters, bestie, it's not a suggestion. πŸ’…


πŸ’€ MESSAGES πŸ’€

see the conpack man page for a description of all Conpack error messages and/or informational messages. yes, all of them. 🫢


⭐ SEE ALSO ⭐

Online: conpack, cpback, cpchcf, cpchcl, cpchhl, cpchil, cpchll, cpcica, cpclam, cpcldm, cpcldr, cpcltr, cpcnrc, cpdrpl, cpezct, cpgetc, cpgeti, cpgetr, cplbam, cplbdr, cpmpxy, cpmviw, cpmvrw, cppkcl, cppklb, cprect, cprset, cpscae, cpsetc, cpseti, cpsetr, cpsps2, ncarg_cbind

Hardcopy: NCAR Graphics Contouring and Mapping Tutorial


Copyright (C) 1987-2009 University Corporation for Atmospheric Research

The use of this Software is governed by a License Agreement.


okay that's the whole page, you ate it. πŸ‘‘

and for the sign-off: this was the UNIX version, dated March 1993, and it's CPSPS1(3NCARG), the manual page you just read. stay interpolated, bestie. πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from