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

-get_byte
 
HOME > Monitoring_and_Data > Oceanic and Atmospheric Data > Reanalysis: Atmospheric Data > wgrib2-set_byte
 

wgrib2: -set_byte

Introduction

The -set_byte option set the values of selected bytes in the current grib message. For example if you want to set 20 and 21 octet (byte in WMO speak) of section 4 to zero and one, you would use -get_byte 4 20 0:1. The first argument is the section number. The second is the byte (octet) number starting from 1 (consistent with WMO documentation) and the third a colon separated list of values.

After you have altered the grib message, you can save the message by either -grib or the -grib_out. You need to use the latter option if the grid values were altered because the data section needs to be updated.

Usage

-get_byte SECTION OCTET_LOCATION I-1:I-2:..:I-N
SECTION=0 .. 7
OCTET_LOCATION = 1..N
I = integer between 0 and 255

Example

$ wgrib2 f.grb2
1:0:d=2008120200:TMP:800 mb:anl:
$ wgrib2 f.grb2 -set_byte 0 7 3
1:0:d=2008120200:SRAD:800 mb:anl:
In the above example, the dicipline is changed to 3.

See also:


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: May 15, 2005
Disclaimer Privacy Policy