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

wgrib2: -ijbox


The -ijbox option takes a rectangular box of data from a rectanular grid an writes it out in either text, bin, or spread (sheet) format. The extracted box can have every point or every n-th point.


-ijbox i1:i2:di j1:j2:dj output_file format
     format = bin, text or spread   (format of output_file)

     The data in output_file is written out as
      do iy=j1, j2, dj
         do ix=i1, i2, di

    Note: -big_endian and -little_endian have no effect the bin type output


Wgrib2 when writing binary, can make a fortran header at the beginning of the grid and a fortran trailer at the end of the grid. I wanted to create a file with fortran header and trailer surrounding each row of the grid. I was able to do it with -ijox. The grid of rtgssthr_grb2 is 1041 x 441.

rm output
while [ $i -le 441 ] ; do
   wgrib2 rtgssthr_grb2 -append -header ijbox 1:1041 $i:$i output bin
   i=`expr $i + 1`

See also: -undefine, -small_grib, -text_col,

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 modified: Dec 30, 2016, 5/8/2019
Disclaimer Privacy Policy