c_dsgrid2d(3NCARG)

πŸ’– c_dsgrid2d β€” the NCAR GRAPHICS main character πŸ’–

okay so bestie, welcome to the 3NCARG manual section, where we meet c_dsgrid2d β€” the primary double precision C entry for 2D gridding. she's the one you call when you want your scattered little data points to become a whole entire grid. periodt. ✨


✨ NAME ✨

c_dsgrid2d β€” primary double precision C entry for 2D gridding πŸ¦‹


🌸 FUNCTION PROTOTYPE 🌸

double *c_dsgrid2d(int, double [], double [], double [],
                  int, int, double [], double [], int *);

πŸŽ€ SYNOPSIS πŸŽ€

double *c_dsgrid2d(int n, double x[], double y[], double z[],
                   int nx, int ny, double xo[], double yo[], int *ier)

πŸ’… DESCRIPTION πŸ’…

okay so here's the tea on every single argument, no skips, we're doing all of them 🫢

  • n β€” the number of input data points. that's it, that's the count. πŸ”’
  • x β€” an array holding the X coordinates of your input data points. πŸ“
  • y β€” an array holding the Y coordinates of your input data points. πŸ“
  • z β€” an array of size n with the functional values of the input data points. like, z[m] is the value of the input function at coordinate (x[m],y[m]), for 0 <= m < n. that's the vibe. ✨
  • nx β€” the number of X values in the output grid. πŸ“
  • ny β€” the number of Y values in the output grid. πŸ“
  • xo β€” an array of size nx with the X coordinates of the output data grid. the values in xo must be increasing, but they don't have to be equally spaced β€” she's flexible like that. 🌈
  • yo β€” an array of size ny with the Y coordinates of the output data grid. the values in yo must be increasing, but again, not required to be equally spaced. 🌈
  • ier β€” the error return value. if *ier comes back as 0, no errors were detected, we're slaying. if *ier is non-zero, go read the man page for dsgrid_errors β€” it will explain everything, iykyk. 🚨

πŸ‘‘ USAGE πŸ‘‘

so c_dsgrid2d returns a pointer to a linear array of data β€” that's your interpolated grid, stored in row-major order. if out is declared as

double *out;

and we set:

out = c_dsgrid2d(n, x, y, z, nx, ny, xo, yo, ier);

then out[i*ny+j] is the interpolated function value at coordinate point (xo[i],yo[j]) for 0 <= i < nx and 0 <= j < ny. no cap. πŸ”₯

the space for out is allocated internally to c_dsgrid2d and is nx*ny doubles in size. she handles it, bestie, you don't have to. πŸ’–


🌟 ACCESS 🌟

to use c_dsgrid2d, load the NCAR Graphics library ngmath. that's the whole assignment. πŸ’œ


πŸ¦‹ SEE ALSO πŸ¦‹

  • dsgrid
  • dsgrid_params
  • c_dsseti
  • c_dsgeti
  • c_dssetrd
  • c_dsgetrd
  • c_dssetc
  • c_dsgetc

complete documentation for Dsgrid is available at URL http://ngwww.ucar.edu/ngdoc/ng/ngmath/dsgrid/dshome.html 🧚


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 little icon dropped way back in September 1997-1998 on UNIX, and it lives forever in the c_dsgrid2d(3NCARG) era. go forth and grid, you absolute legend. πŸ’…βœ¨πŸŽ€πŸ«Ά