g2cparams.c(3)
β¨ g2cparams.c(3) β¨
okay bestie, gather round, because this is a page from the Library Functions Manual and it's lowkey iconic. It's called g2cparams.c and it lives in the NCEPLIBS-g2c world, and it's all about serving up NOAA parameter abbreviations plus GRIB1/GRIB2 translations. no cap, that's the whole vibe. π
πΈ NAME πΈ
g2cparams.c β functions for serving up NOAA parameter abbreviations and GRIB1/GRIB2 translations. that's it, that's the girl. π
π¦ SYNOPSIS π¦
#include 'grib2_int.h'
π§ Macros
#define CSV_FILEβ'noaa_grib2_params.csv', aka the name of the CSV file which contains the NOAA abbreviations. bestie she's the source of truth, respect her. π
π Functions
int g2c_param_abbrev (int g2disc, int g2cat, int g2num, char *abbrev)β get the NOAA abbreviation for a GRIB2 parameter.int g2c_param_all (int param_idx, int *g1num, int *g1ver, int *g2disc, int *g2cat, int *g2num, char *abbrev)β return all the information about a parameter. yes, all of it. she's an overachiever and we love that. πint g2c_param_g1tog2 (int g1num, int g1ver, int *g2disc, int *g2cat, int *g2num)β translate a GRIB1 parameter to a GRIB2 parameter.int g2c_param_g2tog1 (int g2disc, int g2cat, int g2num, int *g1num, int *g1ver)β translate a GRIB2 parameter to a GRIB1 parameter. reverse uno, but make it meteorology. π
β Variables
static G2C_PARAM_T param [G2C_MAX_NOAA_PARAMS]β an array of parameter information. the main character, honestly. π
π Detailed Description π
Functions for serving up NOAA parameter abbreviations and GRIB1/GRIB2 translations. that's the mission statement, periodt. πΈ
Author Ed Hartnett
Date 9/19/22
Definition in file g2cparams.c.
π Macro Definition Documentation π
β¨ #define CSV_FILE 'noaa_grib2_params.csv'
The name of the CSV file which contains the NOAA abbreviations. she's holding all the lore. π
Definition at line 11 of file g2cparams.c.
π Function Documentation π
π«Ά int g2c_param_abbrev (int g2disc, int g2cat, int g2num, char * abbrev)
Get the NOAA abbreviation for a GRIB2 parameter. you hand her the numbers, she hands you the abbrev. slay. β¨
Parameters
g2discβ the GRIB2 discipline number.g2catβ the GRIB2 category number.g2numβ the GRIB2 parameter number.abbrevβ pointer that gets the abbreviation. ignored ifNULL. no drama, she just moves on. π
Returns
G2C_NOERRORβ no error. we love a clean run. πG2C_EFILEβ error reading CSV file. πG2C_ENOPARAMβ parameter not found. π
Author Ed Hartnett
Date 9/19/22
Definition at line 1430 of file g2cparams.c.
References G2C_MAX_NOAA_ABBREV_LEN, G2C_MAX_NOAA_PARAMS, G2C_NOERROR, LOG, and param.
Referenced by g2c_degrib2(), and g2c_log_section().
π¦ int g2c_param_all (int param_idx, int * g1num, int * g1ver, int * g2disc, int * g2cat, int * g2num, char * abbrev)
Return all the information about a parameter. literally everything. she does not gatekeep. π
Parameters
param_idxβ parameter index between0andG2C_MAX_NOAA_PARAMS.g1numβ pointer that gets the GRIB1 parameter. ignored ifNULL.g1verβ pointer that gets the GRIB1 parameter table version number. ignored ifNULL.g2discβ pointer that gets the GRIB2 discipline number. ignored ifNULL.g2catβ pointer that gets the GRIB2 category number. ignored ifNULL.g2numβ pointer that gets the GRIB2 parameter number. ignored ifNULL.abbrevβ pointer that gets the abbreviation.
Returns
G2C_NOERRORβ no error. πG2C_EINVALβ invalid input. not her fault, bestie. πG2C_EFILEβ error reading CSV file.G2C_ENOPARAMβ parameter not found.
Author Ed Hartnett
Date 9/19/22
Definition at line 1524 of file g2cparams.c.
References G2C_EINVAL, G2C_MAX_NOAA_ABBREV_LEN, G2C_MAX_NOAA_PARAMS, G2C_NOERROR, and param.
πΈ int g2c_param_g1tog2 (int g1num, int g1ver, int * g2disc, int * g2cat, int * g2num)
Translate GRIB1 parameter to GRIB2 parameter. glow-up translation service, no notes. β¨
Parameters
g1numβ the GRIB1 parameter.g1verβ the GRIB1 parameter table version number.g2discβ pointer that gets the GRIB2 discipline number. ignored ifNULL.g2catβ pointer that gets the GRIB2 category number. ignored ifNULL.g2numβ pointer that gets the GRIB2 parameter number. ignored ifNULL.
Returns
G2C_NOERRORβ no error. πG2C_EFILEβ error reading CSV file.G2C_ENOPARAMβ parameter not found. π
Author Ed Hartnett
Date 9/19/22
Definition at line 1390 of file g2cparams.c.
References G2C_ENOPARAM, G2C_MAX_NOAA_PARAMS, G2C_NOERROR, and param.
π§ int g2c_param_g2tog1 (int g2disc, int g2cat, int g2num, int * g1num, int * g1ver)
Translate GRIB2 parameter to GRIB1 parameter. going back in time but make it data. π°οΈ
Parameters
g2discβ the GRIB2 discipline number.g2catβ the GRIB2 category number.g2numβ the GRIB2 parameter number.g1numβ pointer that gets the GRIB1 parameter. ignored ifNULL.g1verβ pointer that gets the GRIB1 parameter table version number. ignored ifNULL.
Returns
G2C_NOERRORβ no error. πG2C_EFILEβ error reading CSV file.G2C_ENOPARAMβ parameter not found.
Author Ed Hartnett
Date 9/19/22
Definition at line 1475 of file g2cparams.c.
References G2C_ENOPARAM, G2C_MAX_NOAA_PARAMS, G2C_NOERROR, LOG, and param.
β Variable Documentation β
π G2C_PARAM_T param[G2C_MAX_NOAA_PARAMS] [static]
An array of parameter information. the whole roster, right there. π
Definition at line 14 of file g2cparams.c.
Referenced by g2c_param_abbrev(), g2c_param_all(), g2c_param_g1tog2(), and g2c_param_g2tog1().
π Author π
Generated automatically by Doxygen for NCEPLIBS-g2c from the source code. the robots did the homework, we just added the sparkle. π€β¨
ok that's the whole page bestie, you ate it, no crumbs. go forth and translate those GRIB parameters. π π¦
NCEPLIBS-g2c β Version 2.3.0 β g2cparams.c(3) π that's the version and the source, mwah, bye! π
π¦ where this page comes from
- ubuntu resolute: libg2c-dev 2.3.0-4 Β· LGPL-3.0-only
- ubuntu stonking: libg2c-dev 2.3.0-7 Β· LGPL-3.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms