Friday, June 14, 2019

How to Obtain Custom GRIB Files

We usually try to get all of the GRIB files we need from within the navigation program or GRIB viewer we are using.  This solves a key issue of being sure that the ones they let us request will indeed be viewable in their viewer.  All such sources of GRIB data offer a filter for Lat-Lon region and desired parameters, as well as resolution, and time intervals and duration (ie every 3h out to h72).

Some navigation programs, such as Expedition, have many of the top model products coded into their system so there is less reason for getting external data, others have limited products, and it is not uncommon that popular charting software might only offer GFS parameters internally, maybe with the addition of RTOFS for currents and WW3 for waves.

The popular OpenCPN can create email requests to Saildocs, but the packaged interface options do not include many important models Saildocs offers. OpenCPN can view some grib2 files, but not all. Some of the new high-res data come in a Lambert projection which takes new programming.  There are also new parameters to be included. The forthcoming version of OpenCPN (newer than present 5.0.0+9065270) will include simulated radar (composite reflectivity, REFC), which is available in several WRF models, as wells as the NBM, and now globally in the new GFS version that came into effect on June 12, 2019.

REFC is not yet available as part of a GFS request to Saildocs, but we have other ways to get the data underway from Saildocs, as shown below.  I understand that REFC will be added as a request parameter in XyGrib in July or August. XyGrib will show the files if you get them elsewhere, i.e., as outlined below.  It is already available in the European WRF models from https://openskiron.org/en/.  We can also get this parameter from several models using LuckGrib, and then export the file to be loaded into a navigation program. LuckGrib has the high-res regional versions of REFC as well as the global.

Sample of REFC over SW Pacific viewed in LuckGrib

The notes below go beyond the new REFC parameter and show how to request GRIB files in general directly from their primary source, NCEP.  The link we start from is:


The procedure is outlined below, followed by a video link demonstrating the process. 

Step 1. The main link takes you to a list of many models, with various ways to access the data.  We want to use here the "grib filter." The header name is also a link to the process we are outlining here. The other data sources are huge files of global coverage and hundreds of parameters.

Step 2. Choose a model.  For now we will use GFS 0.25 degree.  This is now the new GFS, and it will as of yesterday include the RECF.  Click "grib filter" for that one.

Step 3. This takes us to an index of data files, and we note (at least for now) that there is a format change yesterday when the new GFS went online.  We have to choose one newer than 20190613.  This is yyyymmdd. We choose 20190614.

Step 4. The next page shows the synoptic time computations: 00, 06, 12, 18. Normally we would want the latest model run. Let's say the latest is 12z. That will be the top one on the list.  Some hours  after 18z, the 18z file will appear at the top of the list.  (More on time delays and latency later on.)

Step 5. Now we are on the request page, where we select, valid forecast time, parameters, levels, and Lat-Lon region. At every synoptic time, there will be 364 forecasts made. Let's assume we want every 6h starting at the 12z run for the next 24h.  Thus we want 12zf000, 12zf006, 12zf0012, 12zf0018, and 12zf0024. This is 5 files and we have to ask for these individually.



Parameters

Let's say we want wind, pressure, and simulated radar. We could get others, as discussed below.

For the wind we ask for UGRD, VGRD, which are the E-W and N-S components of the wind; the grib viewer will make these into a wind vector.

For the Simulated radar we ask for REFC

For the pressure we could ask for PRMSL, which is the common one used, or we could ask for MSLET, which is actually a more precise pressure parameter, but some grib viewers might not be set up to recognize this.  We do not want PRES, which is a parameter used for weather on land.

Other useful parameters are discussed below.



Levels

For wind we need "10 m above the ground."  For PRMSL we need "mean sea level."  For REFC we need plain "entire atmosphere" and not "entire atmosphere (considered as a single layer)."



Step 6. After selecting a file, parameters, and levels—you will see online that they present this in a different order—put a check in the box "Make a sub region" and then enter the bounds. Lon West is negative (-);  Lat South is (-). We will get Cape Verde region for a small sample, -30 to -14, and 20 to 10.

Step 7. Put a check in the Box "Show URL only for web programming," then press enter and you will get this link:

URL=
https://nomads.ncep.noaa.gov/cgi-bin/filter_gfs_0p25.pl?file=gfs.t12z.pgrb2.0p25.f000&lev_10_m_above_ground=on&lev_entire_atmosphere=on&lev_mean_sea_level=on&var_PRMSL=on&var_REFC=on&var_UGRD=on&var_VGRD=on&subregion=&leftlon=-41&rightlon=-16&toplat=40&bottomlat=26&dir=%2Fgfs.20190614%2F12

If you are on land with an internet connection, you can then take away the "Show URL..." check mark, then when you press Download you will get the file called: 

gfs.t12z.pgrb2.0p25.f000

At this stage you might want to add a .grb to the file to get  gfs.t12z.pgrb2.0p25.f000.grb, then you know what you have, but this is not necessary. We have shown that both OpenCPN and XyGrib will open the files as downloaded without the .grb added, or with it.

This file will then load into OpenCPN, but you won't see the REFC until the next version of OpenCPN. The latest version at the moment  (5.0.0+9065270) does not have the REFC implemented in the GRIB plugin, but the developers have it working in the next version, as shown in the video.

To get these files from Saildocs when underway you would send a mail to query@saildocs.com with the message being

send https://nomads.ncep.noaa.gov/cgi-bin/filter_gfs_0p25.pl?file=gfs.t12z.pgrb2.0p25.f000&lev_10_m_above_ground=on&lev_entire_atmosphere=on&lev_mean_sea_level=on&var_PRMSL=on&var_REFC=on&var_UGRD=on&var_VGRD=on&subregion=&leftlon=-41&rightlon=-16&toplat=40&bottomlat=26&dir=%2Fgfs.20190614%2F12

send https://nomads.ncep.noaa.gov/cgi-bin/filter_gfs_0p25.pl?file=gfs.t12z.pgrb2.0p25.f006&lev_10_m_above_ground=on&lev_entire_atmosphere=on&lev_mean_sea_level=on&var_PRMSL=on&var_REFC=on&var_UGRD=on&var_VGRD=on&subregion=&leftlon=-41&rightlon=-16&toplat=40&bottomlat=26&dir=%2Fgfs.20190614%2F12

send https://nomads.ncep.noaa.gov/cgi-bin/filter_gfs_0p25.pl?file=gfs.t12z.pgrb2.0p25.f012&lev_10_m_above_ground=on&lev_entire_atmosphere=on&lev_mean_sea_level=on&var_PRMSL=on&var_REFC=on&var_UGRD=on&var_VGRD=on&subregion=&leftlon=-41&rightlon=-16&toplat=40&bottomlat=26&dir=%2Fgfs.20190614%2F12

You could request as many as you like. These are about 56 kB each as returned by regular email (~twice actual size).  Using special satcom email they could get reduced quite a bit. They will come back as individual emails with the files attached.

The video below shows how to get these by email, and then view them in XyGrib and in a forthcoming edition of OpenCPN, along with some discussion of this new REFC parameter.  

With this method of requesting specific parameters and levels, navigators may also find it useful to look into the 850 mb level for both wind and relative humidity (RH). This is the boundary layer level at about 1000 m, where the winds become less, if at all, affected by surface friction. About the altitude of low clouds. These winds are a good indication of the direction of squall motion (compare with REFC forecasts), and in the tropics, the streamline view at this elevation can give indication of wind flow on the surface that does not show up in the actual wind data. We watched a prominent example of this off the coast of Queensland, AU earlier this month. The RH at this level can also show a good outline frontal systems, which are not always easy to discern from wind and pressure.  

____________________

To obtain a HRRR CONUS  wind and pressure (surface analysis, h0 forecast = f00) on Feb 4, 2020 at 18z from saildocs, it would be:

send https://nomads.ncep.noaa.gov/cgi-bin/filter_hrrr_2d.pl?file=hrrr.t18z.wrfsfcf00.grib2&lev_10_m_above_ground=on&lev_mean_sea_level=on&var_MSLMA=on&var_UGRD=on&var_VGRD=on&subregion=&leftlon=-131&rightlon=-120&toplat=42&bottomlat=33&dir=%2Fhrrr.20200204%2Fconus

Adjust Lat, Lon and times as needed

____________________





Video demo of getting the files.




Video demo of viewing REFC in XyGrib.




Video demo of viewing REFC in OpenCPN.


On the list is to add a video devoted to the practical use of REFC and data we have to confirm it... which is easy to test because we have archived real weather radar online.... and  you can go to squally waters in real radar view, forecast some pattern and then see if it pans out.

We also want to add a short article and video note on use of the 850 mb data, as outlined above, which you can obtain with the methods outlined here.


4 comments:

Unknown said...

Hi David,
Do you have a video or tutorial on how to create a new parameter from two or more existing parameters in a GRIB2 file? In my particular case I download and use the HRRR GRIB2 files from Nomads. I'm a student pilot and weather enhusiast. The HRRR file has the ceiling and visibility as parameters but I want to calculate and visualize the flight rules (as defined by the Federal Aviation Administration) and create a new field/parameter in the GRIB2 file. Please advise.
Hendrik Graulus
rgraulus@yahoo.com

David Burch said...

I do not follow exactly the goal. Please send your question to helpdesk@starpath.com and we will send you access to our online discussion group where we can pursue this.

Anonymous said...

I'm struggling with the lat/long sub region. In your article, it's the only thing you didn't post an example image.

David Burch said...

Sorry for long delay. My notices were not working for a year or two! That is set in the Extract subregion section, shown in the text above, noting that west longitudes and south latitudes are negative. Top means most north; Left means most west (ie -80 is more west than -70. In east longitude, 30 is more west than 50.)