Skip Navigation Links www.nws.noaa.gov 
NOAA logo - Click to go to the NOAA home page National Weather Service   NWS logo - Click to go to the NWS home page
Climate Prediction Center
 
 

 
About Us
   Our Mission
   Who We Are

Contact Us
   CPC Information
   CPC Web Team

 
HOME > Monitoring_and_Data > Oceanic and Atmospheric Data > Reanalysis: Atmospheric Data > wgrib2 py_wgrib2api
 

wgrib2: py_wgrib2api

Introduction:

Pywgrib2_s calls the C library, wgrib2lib. It is limited to calling these wgrib2 routines specific routines. Sure the python code could call other routines in wgrib2lib but it is not advised. The other routines in wgrib2lib should be considered internal routines that may change or even disappear.

Convention: pywgrib2_s only uses routines that start with wgrib2.


int wgrib2(int argc, char **argv)
  call to wgrib2 routine

int wgrib2_free_file(char *filename)
  frees the file, filename


REGISTER

int wgrib2_get_regsize(int i)
  return number of elements in register i

int wgrib2_get_reg_data(float *data, size_t size, int i)
  size = number of elements of data
  gets contents of register i

int wgrib2_set_reg(float *data, size_t size size, int i)
  size = number of elements of data
  sets contents of register i
  

MEMORY BUFFER


int wgrib2_get_mem_buffer_size(int i)
  return size in bytes of buffer i

int wgrib2_set_mem_buffer(unsigned char *buffer, size_t size, int ii)
  size = size of buffer (bytes)
  i = buffer number

int wgrib2_get_mem_buffer(unsigned char *buffer, size_t size, int i)
  size = size of buffer (bytes)
  i = buffer number


NOAA/ National Weather Service
National Centers for Environmental Prediction
Climate Prediction Center
5830 University Research Court
College Park, Maryland 20740
Climate Prediction Center Web Team
Page last modified: Dec 29, 2016.
Disclaimer Privacy Policy