wgrib2api: undefined values
Introduction
In grib2, the grid points can have undefined values. Grib doesn't
doesn't use a special value to indicate an undefined but uses one
of 3 methods.
- a bitmap (used by jpeg2000, simple, ieee and by complex packing)
- the IEEE 754 format undefined (ieee packing)
- a special bit pattern by complex packing (prefered)
However, users usually find a special value the easiest method to indicate an undefined value.
Wgrib2api, like wgrib2, uses the value 9.999e20 to indicate a special value.
There are one symbolic values and two functions
in wgrib2api (v2.0.8) to handle undefined values.
- grb2_UNDEFINED: symbolic value for 9.999e20
- grb2_UNDEFINED_VAL(x): returns true if x is the undefined values otherwise false
- grb2_DEFINED_VAL(x): returns true if x is a defined values otherwise false
Usage
grid(i,j) = grb2_UNDEFINED
set grid(i,j) to the special undefined values 9.999e20
if (grb2_UNDEFINED(grid(i,j)) then
if grid(i,j) is undefined than
if (grb2_DEFINED(grid(i,j)) then
if grid(i,j) is defined than
|