c_dsgrid3s(3NCARG)
π c_dsgrid3s β the 3D gridding bestie π
okay so real talk, this is a page from the NCAR GRAPHICS manual, and today we're getting into c_dsgrid3s β the primary single precision C entry for 3D gridding. she's the main character of 3D grids, no cap. π¦
β¨ NAME β¨
c_dsgrid3s β primary single precision C entry for 3D gridding
π FUNCTION PROTOTYPE π
float *c_dsgrid3s(int, float [], float [], float [], float [],
int, int, int, float [], float [], float [], int *);
π SYNOPSIS π
float *c_dsgrid3s(int n, float x[], float y[], float z[],
float u[], int nx, int ny, int nz, float xo[],
float yo[], float zo[], int *ier);
π DESCRIPTION π
okay bestie, here's the whole cast of characters, one by one. every single one matters. π«Ά
nβ the number of input data points. like, how many little guys you're feeding her.xβ an array holding the X coordinates of the input data points.yβ an array holding the Y coordinates of the input data points.zβ an array holding the Z coordinates of the input data points.uβ an array of sizenholding the functional values of the input data points. That is,z[m]is the value of the input function at coordinate(x[m],y[m],z[m]), for0 <= m < n.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 sizenxholding the X coordinates of the output data grid. the values inxomust be increasing, but they don't have to be equally spaced, periodt.yoβ an array of sizenyholding the Y coordinates of the output data grid. the values inyomust be increasing, but need not be equally spaced. same energy. β¨zoβ an array of sizenzholding the Z coordinates of the output data grid. the values inzomust be increasing, but need not be equally spaced. she's consistent like that. πierβ the error return value. if*iercomes back as0, then no errors were detected, we ate and left no crumbs. if*ieris non-zero, then run, don't walk, to the man page fordsgrid_errors. π
π₯ USAGE π₯
c_dsgrid3s returns a pointer to a linear array of data β that's your interpolated grid, stored in row-major order. so if out is declared as:
float *out;
and we set:
out = *c_dsgrid3s(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. the space for out is allocated internal to c_dsgrid3s and is nx*ny*nz floats in size. she handles it. you don't gotta. π
okay but fr, that indexing math is the whole vibe check of this function β nz*ny*i + nz*j + k. memorize her. iykyk. π
π ACCESS π
to use c_dsgrid3s, load the NCAR Graphics library ngmath. that's it, that's the door code. πͺβ¨
π SEE ALSO π
dsgriddsgrid_paramsc_dssetic_dsgetic_dssetrc_dsgetrc_dssetcc_dsgetc
complete documentation for Dsgrid is available at URL http://ngwww.ucar.edu/ngdoc/ng/ngmath/dsgrid/dshome.html β go read her, she's iconic. π
π 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 one came from the UNIX manual, dated September 1997-1998, and she's filed under c_dsgrid3s(3NCARG) β go forth and grid in 3D, you absolute legend. 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