Note:  While we are transitioning our web pages, products marked with an (*) link to product pages on the old system. Products on those pages are up-to-date, but links on those pages may go to old information or may be broken. Thank you for your patience!

Table of Contents (Shortcut Navigation)


Introduction

The concept is that for a given state, say Pennsylvania, the user would need to download two or more NDFD sectors. The problem with this is that they would overlap, and they would contain more information than the user would be interested in. It is also inconvenient for the user to have to mosaic the images together.

What the custom grid service does, is it grabs a specified rectangle out of the NDFD and returns it as a GRIB2 message to the user. One thing to keep in mind is that the rectangle is on the NDFD map projection. It will not appear to be a rectangle unless you project the map.

For more information on the product see: https://products.weather.gov/PDD/User_Defined_Grib2_OFFICIAL.pdf (pdf)


Sample Form

The form below allows the entry of opposite corners of a defined area no more than 15 degrees apart. If you are interested in large areas of NDFD area, you may find the predefinded data sectors available from a ftp transfer to be better suited for your task.





Choosing lower left and upper right lat/lon points

Most likely you have a specific lat/lon area that you want to cover. You find the lower left, and upper right corners, enter that into the form, it returns a grid, you display it, and you find that it is a parallelogram instead of a rectangle! What is going on?

What is going on, is that the CGI code has to return the data on a grid. To do so, it uses the projected space of the NDFD, since it is just returning a subgrid of the NDFD. The grid it returns is a rectangle on the correct projection, but a parallelogram if there is no projection.

But this is not what you wanted! How does one choose the lower left and upper right lat/lon's so that all the desired points are included?

  • Find out the grid cell locations of all your border corner points.
    To do this, degrib provides 2 ways of converting lat/lon points to grid cell locations.
    1. "degrib -Sector -pnt 37,-76 -cells 2"
      should return the X/Y value of 37,-76 in all the Major NDFD sectors. The conus one should look like: "conus, 37.000000, -76.000000, 886.893847, 319.270960, 1", which again tells us that lat=37, Lon=-76 goes to X=886.893847, Y=319.270960.
    2. "degrib maxt.bin -P -pnt 36,-76 -nLabel -pntStyle 1"
      where maxt.bin is the NDFD conus maxt GRIB2 file. This should return something which looks like: (886.893847,319.270960,36.000000,-76.000000). This tells us that lat=36, Lon=-76 goes to X=886.893847, Y=319.270960.
  • Find the min / max grid values of all your points.
    After you have converted all the corner points along your borders, you should have a set of X, Y values. In my example case, I'll use lat/lon pairs of: (36,-76), (46,-76), (46,-86), (36,-86), which become X/Y pairs of: (886.893847,319.270960), (854.963117,545.617171), (692.198981,528.749312), (707.362546,300.665456). The min and max of the X/Y pairs are: minX=692, maxX=887, minY=300, maxY=546.
  • Find the lower left and upper right X/Y of your rectangle
    The lower left X/Y would be (minX, minY), and the upper right X/Y would be (maxX, maxY). So the lower left X/Y would be (692,300), and upper right X/Y would be (887,546).
  • Convert the lower left X/Y and upper right X/Y to lat/lon.
    degrib provides 2 ways of converting grid cell locations to lat/lon.
    1. "degrib -Sector -pnt 300,692 -cells 1"
      should return that x/y value converted to lat/lon in all the Major NDFD sectors. The conus one should look like: "conus, 36.013749, -86.851635, 692.000000, 300.000000, 1" which again tells us that X=692, Y=300 goes to Lat=36.013749, Lon=-86.851635.
    2. "degrib maxt.bin -P -pnt 300,692 -nLabel -pntStyle 1 -cells true"
      where maxt.bin is the NDFD conus maxt GRIB2 file. This should return something that looks like: (692.000000,300.000000,36.013749,-86.851635) which tells us that X=692, Y=300 goes to Lat=36.013749, Lon=-86.851635.
  • After doing the same thing for the upper right corner, I can now request the CGI program for the data defined by "lower left = 36.013749,-86.851635" and "upper right = 45.816392,-74.062261" (in the conus sector).