NDFD GRIB2 Decoder

The NDFD (National Digital Forecast Database) is an effort by the NWS (National Weather Service) to provide forecasts on a grid across the US, instead of at stations (typically located at airports). For more information about the NDFD, how and why it was created, please see:


The NDFD (National Digital Forecast Database) is available for the conus (continuous U.S.) on both the anonymous ftp site (tgftp.nws.noaa.gov) and the web site (http://weather.noaa.gov). The currently available sectors are "CONUS", all sectors in the "CONUS", and "Puerto Rico". All sectors should have (MaxT, MinT, PoP12, Sky, Td, Temp, Wdir, Wspd, SnowAmount, QPF, Wx, and Waveh).

The data is distributed in GRIB2 (Gridded Binary Edition 2) format, which is outlined in the WMO (World Meteorological Organization) document: The WMO GRIB2 Document FM92-X11 GRIB. A web friendly version of which is available here

In order to take advantage of this data, MDL (Meteorological Development Laboratory) created and maintains the official GRIB2 Decoder library. The GRIB2 Decoder library does a very good job of unpacking GRIB2 messages, but in order to understand how to use it, and what is returned, one needs a working knowledge of "The WMO GRIB2 Document FM92-X11 GRIB".

MDL felt that in order to make it easier for people to use NDFD data, a "driver" for the library should be provided. The main purposes for the driver are:

  1. Provide an example of how to call the Decoder library.
  2. Provide software to convert from GRIB2 to a simpler (albeit larger) file format.
  3. Provide a means to view the "meta" data without needing to reference "The WMO GRIB2 Document FM92-X11 GRIB" document.

So how do I get/use the Driver?





To satisfy requirement (2), the driver converts a particular grid in the GRIB2 file to a ".flt" file. The ".flt" file is N by M floats (4 byte Real numbers), where N and M are the dimensions of the grid. In particular, the grid starts in the Upper Left Corner, traverses across a row, and then continues at the left on the next row (similar to refreshing a TV screen). This format was chosen because it happens to match the binary format required by ESRI ArcView's Spatial Analyst.

It was felt that the simplicity of the ".flt" file format would allow the user to write code to convert to their particular GIS (Geographical Information System) package, if it was not ESRI. The program can also create "point .shp" or "polygon .shp" files, for use in ESRI ArcView, when one does not have Spatial Analyst.

To satisfy requirement (3), the driver creates a .txt file in which it has already looked up the parameters in the various tables in the GRIB2 document. The .txt file is a | separated file, because both ':' and ',' could be part of a variable description.

In addition, it was felt that the program should be able to be run either via a GUI (Graphical User Interface) or from a command line. For portability sake, the GUI part relies on Tcl/Tk. (More specifically, it was designed for version 8.3.2, although it has been tested on a system with version 8.0.4.)


Ok, but how do I get/use it?