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

wgrib2: -undefine_val


The -undefine_val option sets the grid points to undefined depending on the value of the grid point. If a single value is specified, grid values within 0.1 percent are set to undefined. If two values are specified, the values that are within that range are set to undefined.

Note: the ability to handle ranges was always available but undocumented. My mistake. That's what you get when you delay writing the documentation.


-undefine_val value
   grid values within 0.1 percent are set to undefined

-undefine_val "value1:value2"
   grid value that are within the rage are set to undefined
   i.e.,   value1 <= grid_value <= value2


Suppose a non-standard grib file uses -999.9 as special value to indicate an undefined grid point value. This is unfortunate as grib readers will not know that -999.9 is a special value for undefined values. (Grib2 uses a bitmap, NaN or out-of-range values.) The best way to deal with these files is to convert values of -999.9 to undefined values and then write them out.

$ wgrib2 IN.grb2 -undefine_val -999.9 -set_grib_type same -grib_out OUT.grb

See also: -undefine, -ijundefine, -rpn,

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: Aug 8, 2017
Disclaimer Privacy Policy