g2_info.c(3)
β¨ NAME β¨
g2_info.c β bestie, this one searches through a GRIB2 message and hands you back the number of gridded fields it found in there, plus the number (and the maximum size) of Local Use Sections. π
πΈ SYNOPSIS πΈ
#include 'grib2_int.h'
#include <stdio.h>
#include <stdlib.h>
π¦ Functions
g2int g2_info (unsigned char *cgrib, g2int *listsec0, g2int *listsec1, g2int *numfields, g2int *numlocal)β Search through a GRIB2 message and return the number of gridded fields found in the message and the number (and maximum size) of Local Use Sections.
π Detailed Description π
Okay so literally what this does: it searches through a GRIB2 message and returns the number of gridded fields found in the message, plus the number (and maximum size) of Local Use Sections. π
Author Stephen Gilbeert
Date 2002-10-28
Definition in file g2_info.c.
π₯ Function Documentation π₯
β g2int g2_info (unsigned char * cgrib, g2int * listsec0, g2int * listsec1, g2int * numfields, g2int * numlocal)
Search through a GRIB2 message and return the number of gridded fields found in the message and the number (and maximum size) of Local Use Sections. Other checks are performed too, to see if the message is a valid GRIB2 message. vibe check on your GRIB2, basically. π«Ά
π Parameters
cgribβ Pointer to a buffer containing the GRIB2 message.listsec0β Pointer to an array that gets the information decoded from GRIB Indicator Section 0. Must be allocated with>= 3elements (seeG2C_SECTION0_LEN).listsec0(0)β Discipline-GRIB Master Table Number ([Code Table 0.0] β the docs live athttps://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_table0-0.shtml).listsec0[1]β GRIB Edition Number (currently2).listsec0[2]β Length of GRIB message.
listsec1β Pointer to an array that gets the information read from GRIB Identification Section 1. Must be allocated with>= 13elements (seeG2C_SECTION1_LEN).listsec1[0]β Id of orginating centre ([Table 0] βhttps://www.nco.ncep.noaa.gov/pmb/docs/on388/table0.html).listsec1[1]β Id of orginating sub-centre ([Table C] βhttps://www.nco.ncep.noaa.gov/pmb/docs/on388/tablec.html).listsec1[2]β GRIB Master Tables Version Number ([Table 1.0] βhttps://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_table1-0.shtml).listsec1[3]β GRIB Local Tables Version Number ([Table 1.1] βhttps://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_table1-1.shtml).listsec1[4]β Significance of Reference Time ([Table 1.2] βhttps://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_table1-1.shtml).listsec1[5]β Reference Time - Year (4 digits).listsec1[6]β Reference Time - Month.listsec1[7]β Reference Time - Day.listsec1[8]β Reference Time - Hour.listsec1[9]β Reference Time - Minute.listsec1[10]β Reference Time - Second.listsec1[11]β Production status of data ([Table 1.3] βhttps://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_table1-3.shtml).listsec1[12]β Type of processed data ([Table 1.4] βhttps://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_table1-4.shtml).
numfieldsβ A pointer that gets the number of gridded fields found in the GRIB message. That is, the number of occurences of Sections 4 - 7.numlocalβ A pointer that gets the number of Local Use Sections (section 2) found in the GRIB message.
π Returns
0 for success. Otherwise, bestie, you get one of these:
G2_INFO_NO_GRIBβ Beginning characters"GRIB"not found.G2_INFO_GRIB_VERSIONβ GRIB message is not Edition 2.G2_INFO_NO_SEC1β Could not find Section 1, where expected.G2_INFO_WRONG_ENDβ End string"7777"found, but not where expected.G2_INFO_BAD_ENDβ End string"7777"not found at end of message.G2_INFO_INVAL_SECβ Invalid section number found.
Author Stephen Gilbeert
Date 2002-10-28
Definition at line 70 of file g2_info.c.
References G2_INFO_BAD_END, G2_INFO_GRIB_VERSION, G2_INFO_INVAL_SEC, G2_INFO_NO_GRIB, G2_INFO_NO_SEC1, G2_INFO_WRONG_END, gbit(), and LOG.
π Author π
Generated automatically by Doxygen for NCEPLIBS-g2c from the source code.
and that's the whole page, no cap. π§π
NCEPLIBS-g2c, Version 2.3.0 β okay slay, that's the version and the source right there, and the date on this whole thing is the manpage date up top. mwah. π β¨π
π¦ 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