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_int2
 

wgrib2: -set_int2

Introduction

The -set_int2 option sets 2 octets to a signed integer value which is commonly used by grib. The integer must range from -32767 to 32767.

-set_int2 I J K
  I = 1..7
  J = 1..(section length-1)
  K = -(2**15-1) .. (2**15-1)
would set 
  Section I, Octet J+0:  if (K >= 0) (K >> 8) & 255
  Section I, Octet J+0:  if (K < 0) ((abs(K) >> 8 ) && 255) | 128
  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_int2  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_int


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