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-set_int
 

wgrib2: -set_int

Introduction

The -set_int option sets 4 octets to an signed integer value as commonly use by grib for signed integers. The integer must range from -2147483647 to 2147483647,

-set_int I J K
  I = 1..7
  J = 1..(section length-3)
  K = -(2**23-1) .. (2**23-1)
would set 
  Section I, Octet J+0:  if (K >= 0) (K >> 24) & 255
  Section I, Octet J+0:  if (K < 0) ((abs(K) >> 24) && 255) | 128
  Section I, Octet J+1:  (abs(K) >> 16) & 255
  Section I, Octet J+2:  (abs(K) >> 8) & 255
  Section I, Octet J+3:   abs(K) & 255;
 The above is using C syntax.

Multiple integers can be set by making the third argument a colon seperated list.

Usage

-set_int  SECTION STARTING_OCTET_LOCATION I-1:I-2:..:I-N
SECTION=0 .. 7
OCTET_LOCATION = 1..N
I-M = Mth integer

Example

See also: -get_int -set_byte -set_hex -set_ieee -set_int2


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