Skip Navigation Links 
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-set_sec_size

wgrib2: -set_sec_size


The -set_sec_size option is DANGEROUS. Grib messages are made of sections where the section number varies from 0 to 8. Suppose you want to modify a grib message by changing section 4 (Product Definition Section). You would use -set_sec_size to change the size of section 4 if necessary and then use -set_byte to change the contents of your new section 4. This is not pretty but when testing a new template, you have to do ugly things.

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.


-set_sec_size  SECTION SIZE
SECTION=0 .. 8
SIZE=integer, size of new section
     can be zero for a missing section
     generally greater than 5


The -set_sec_size option expands or contracts a section. For expansions, the new octets are filled with 255. This option puts the size of the new section in octets 1..4 and the section number in octet 5 assuming the size is greater than equal to 5. Some sections can be missing.

See also: -set_byte

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