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-stats, -mmax, -min

wgrib2: -stats, -max, -min


The -stats option writes a statistical summary of the field into the inventory. The -max option writes the maximum value and the -min option writes the minimum. These option are useful for quickly determining if the field has reasonable numbers.




$ wgrib2 test.grb2 -stats

ndata = number of grid points
undef = number of grid points with an undefined value
mean = grid point average (not area weighted)
min = minimum value
max = maximum value

$ wgrib2 test.grb2 -max

$ wgrib2 test.grb2 -min

The -stats option can be combined with the -undefine option to produce statistics for a box.
$ wgrib2 test.grb2 -stats
produces the global statistics. By setting grid points to undefined, we can produce the statistics for a box.
$ wgrib2 test.grb2 -undefine outobx 0:90 -10:10 -stats
Note, if we reverse the order of the -stats and -undefine options, we get the global mean. That is because the -stats option is excuted before the -undefine options. $ wgrib2 test.grb2 -stats -undefine out-box 0:10 -10:10 1:4:ndata=10512:undef=0:mean=77.5081:min=-370:max=340.2:cos_wt_mean=97.267

If all the data are undefined, the -stats option will produce values of zero for the the mean, min and max. The -min and -max options will yield a text string of "undefined".

See also: -undefine

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