c_dsgrid3d(3NCARG)

๐Ÿ’– c_dsgrid3d โ€” bestie, it's the 3D gridding girlie ๐Ÿ’–

okay so this is a page from the NCAR GRAPHICS manual, and today we're talking about c_dsgrid3d(3NCARG) โ€” the primary double precision C entry point for 3D gridding. yes she does the whole "scattered points in, pretty grid out" thing. no cap. โœจ


๐ŸŒธ NAME ๐ŸŒธ

c_dsgrid3d โ€” the primary double precision C entry for 3D gridding. that's her. that's the whole job description. ๐Ÿซถ


๐ŸŽ€ FUNCTION PROTOTYPE ๐ŸŽ€

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

โœจ SYNOPSIS โœจ

double *c_dsgrid3d(int n, double x[], double y[], double z[],
          double u[], int nx, int ny, int nz, double xo[],
          double yo[], double zo[], int *ier);

๐Ÿ’… DESCRIPTION ๐Ÿ’…

okay bestie, here's the tea on every single argument. nothing skipped, we're being thorough because we love being thorough ๐Ÿ’œ

  • n โ€” how many input data points you're feeding her. the count. the headcount. ๐Ÿ“
  • 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 holding the Z coordinates of your input data points.
  • u โ€” an array of size n with the functional values of the input data points. so like, z[m] is the value of the input function at coordinate (x[m],y[m],z[m]), for 0 <= m < n. (yes, that's exactly how the original says it, i'm not touching it, it's iconic ๐Ÿ˜ญ)
  • nx โ€” the number of X values in the output grid.
  • ny โ€” the number of Y values in the output grid.
  • nz โ€” the number of Z 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 lowkey they don't have to be equally spaced. ๐Ÿ“ˆ
  • yo โ€” an array of size ny with the Y coordinates of the output data grid. values in yo must be increasing, equally spaced not required. ๐Ÿ’ซ
  • zo โ€” an array of size nz with the Z coordinates of the output data grid. values in zo must be increasing, equally spaced not required either. ๐Ÿ‘‘
  • ier โ€” the error return value. if *ier comes back as 0, then no errors were detected, we're slaying, nothing to see here โœจ. if *ier is non-zero, then run don't walk to the man page for dsgrid_errors. ๐Ÿ’€

๐ŸŒˆ USAGE ๐ŸŒˆ

c_dsgrid3d returns a pointer to a linear array of data that is the interpolated grid, stored in row-major order. that's the vibe. ๐Ÿ’ซ

so if out is declared as

double *out;

and we set:

out = *c_dsgrid3d(n, x, y, z, u, nx, ny, nz, xo, yo, zo, ier);

then out[nz*ny*i + nz*j + k] is the interpolated function value at coordinate point (xo[i],yo[j],zo[k]) for 0 <= i < nx, 0 <= j < ny, and 0 <= k < nz. ๐Ÿงฎ

and the space for out? it's allocated internal to c_dsgrid3d and it's nx*ny*nz doubles in size. she provides. periodt. ๐Ÿ’…


๐Ÿฆ‹ ACCESS ๐Ÿฆ‹

to use c_dsgrid3d, load the NCAR Graphics library ngmath. that's the whole access situation, bestie. ๐ŸŽ€


๐Ÿ‘‘ SEE ALSO ๐Ÿ‘‘

go read these too, they're all part of the family:

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

and fr fr, 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.


โš ๏ธ heads up bestie: that license agreement line is not decoration, it's real. use of this software is governed by it. respect the paperwork. ๐Ÿ“œ

and that's the whole page!! ๐Ÿ’– this one's from the UNIX manual, dated September 1997-1998, and it lives under the name c_dsgrid3d(3NCARG). go forth and grid in 3D, you absolute main character ๐Ÿซถโœจ๐ŸŽ€