Grib Filter Help

Purpose:

The Grib Filter is used to access a subset of a NOMADS Grib2 data file.

Description:

Grib Filter is a web application that repackages Grib2 files based on the user-selected area subset. Using Grib Filter, you may:

download a subset of a Grib2 dataset, or

generate the URL query to download a subset of a Grib2 dataset.

This
URL can be used as the quoted object of an interactive web download
command, like wget or cURL. Using variables and looping, data
acquisition may be customized and automated. If your script contains loops, then be sure to include a 10 second wait between fetches
to protect against runaway loops and ensure responsible sharing of the
server resources. Without waits between fetches, the server may mistake
excessive requests as denial-of-service attack and block the user.

This application is best used for creating regional subsets of
the Grib2 file. If a selection of variable(s) and/or level(s) are needed, instead of the entire file, you
are encouraged to use the partial-http transfer method to better utilize server resources.

Procedure:

Begin by following the "grib filter" link for the chosen model data on the main NOMADS page

Choose the date

You will then be presented with choices to traverse the directories in
order to locate the desired data file. The directory structure is
not identical for each model.

First, you must choose from a list of dated
directories. For most datasets, the directory is for an
entire day. For GFS, the directory is for a single cycle of that
day. Next, you may be asked to choose a cycle.

Choose a subdirectory

For the GEFS, you are required to choose the pgrb2 directory (even though this is the only choice available).

Choose a data file

You will then be asked to choose a file from a list. Only one file may be chosen.

Choose the Levels, Variables, and Region

You may then choose the level and variables you desire to be
extracted from the file. You may choose all, several, or none of
of the displayed choices.

To define a regional subset, you may fill in the left longitude, right longitude, top latitude, and bottom latitude.

Choose to display the URL

If
you want to generate the URL that describes the dataset you
have defined, click the "Show the URL only for web programming"
box. When this is chosen, the filtered data file will not
download, instead the URL will be displayed. This URL can then be
edited and used in a script to automate downloading the desired dataset.

Download the file (or display the URL)

Finally, the user clicks on the "Start download" button to either begin the download or display the URL.

Scripting file retrievals

You may use the URL generated in the above procedure in a script to automate your downloads using a program such as cURL. or wget

The command line to download file to "my_file" using cURL is:
curl
"http://nomads.ncep.noaa.gov/cgi-bin/filter_gfs.pl?file=gfs.t12z.pgrbf12.grib2&lev_500_mb=on&var_TMP=on&leftlon=0&rightlon=360&toplat=90&bottomlat=-90&showurl=&dir=%2Fgfs.2009020612"
-o my_file

You may then replace parts of the command, such as the date and cycle,
with a variable to build another download string in your script.

WARNING: when you loop web retrievals, please use the sleep command
after every failed attempt. If the file is not available, the odds
of it being available 1 millisecond later are very remote. However,
polling for a file takes resources. An out of control program may
poll for a files several times per second. This makes the system
unavailable to people who want to do real work.