g2cparams.c(3)

πŸ“¦
version 2.3.0 Β· 2 versions
, in ubuntu resolute, ubuntu stonking

✨ 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 if NULL. 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 between 0 and G2C_MAX_NOAA_PARAMS.
  • g1num β€” pointer that gets the GRIB1 parameter. ignored if NULL.
  • g1ver β€” pointer that gets the GRIB1 parameter table version number. ignored if NULL.
  • g2disc β€” pointer that gets the GRIB2 discipline number. ignored if NULL.
  • g2cat β€” pointer that gets the GRIB2 category number. ignored if NULL.
  • g2num β€” pointer that gets the GRIB2 parameter number. ignored if NULL.
  • 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 if NULL.
  • g2cat β€” pointer that gets the GRIB2 category number. ignored if NULL.
  • g2num β€” pointer that gets the GRIB2 parameter number. ignored if NULL.

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 if NULL.
  • g1ver β€” pointer that gets the GRIB1 parameter table version number. ignored if NULL.

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