Tim's Fetch Macro

Discuss any other weather software not covered above, including data feeds, weather web pages, and more!
Post Reply
Weasel

Tim's Fetch Macro

Post by Weasel »

Since Wingridds is probably going to generate a lot of interest I thought I would remind everybody about the macro Tim wrote for downloading and ingesting grib data. Basically this is exactly the same as what was originally posted, the only differences are a change to ftp, elimination of the pub subdirectory and 80km instead 0f 40km (this server still isn't the fastest).

Remember you need to download and install url2file to get it to work:
http://www.chami.com/free/url2file_wincon.html
------------------------------------------------------------------------------------

Below is a MS-DOS batch file that can be used to retrieve RUC data for PCGRIDDS32. Anyone is welcome to rewrite it and/or share it.

Note that you may have to change the paths to work with your system, and it WILL delete any existing data unless you remove the DEL statements.


@echo off
::
::
:: PCGRIDDS32 Downloader
:: (c) 2003 Tim Vasquez / All Rights Reserved
:: Version 1.0
::
::
if "%4"=="" goto Usage
::
:: Begin download
::
echo Please wait... this will take a few moments... accessing datasets...
::
:: Download each forecast hour from NWSTG server
::
cd c:\pcgridds32\grib\nws
del ruc*
echo Downloading 00h...
url2file ftp://weather.noaa.gov/SL.us008001/ST.o ... _gr.us80km ruc00.dat
echo Downloading 03h...
url2file ftp://weather.noaa.gov/SL.us008001/ST.o ... _gr.us80km ruc03.dat
echo Downloading 06h...
url2file ftp://weather.noaa.gov/SL.us008001/ST.o ... _gr.us80km ruc06.dat
echo Downloading 09h...
url2file ftp://weather.noaa.gov/SL.us008001/ST.o ... _gr.us80km ruc09.dat
echo Downloading 12h...
url2file ftp://weather.noaa.gov/SL.us008001/ST.o ... _gr.us80km ruc12.dat
echo Postprocessing...
cd c:\pcgridds32
::
:: Build GRIBNAMES.DAT file which tells NGRB2PCG32 which GRIB files
:: it needs to decode
::
echo ruc00.dat > gribnames.dat
echo ruc03.dat >> gribnames.dat
echo ruc06.dat >> gribnames.dat
echo ruc09.dat >> gribnames.dat
echo ruc12.dat >> gribnames.dat
::
:: Now run NGRB2PCG32 to convert all this data to PCGRIDDS32 format.
::
call ngrb2pcg32
::
:: All done!
::
echo.
echo Downloading and processing complete. You can now run PCGRIDDS.
echo.
goto :End
::
:Usage
::
ECHO.
ECHO PCGRIDDS DOWNLOADER
ECHO (c) 2003 Tim Vasquez
ECHO Version 1.0
ECHO.
ECHO REQUIREMENTS: You MUST have PCGRIDDS installed in C:\PCGRIDDS32
ECHO and you MUST have URL2FILE (available at http://www.chami.com). If you
ECHO type URL2FILE at the command line and get an error, it is not
ECHO installed.
ECHO.
ECHO This version only does ruc data but can be adapted by the user
ECHO for Eta data and other grids. When completed, the outputted
ECHO grid is available in \PCGRIDDS32\GRIDDATA and you can then run
ECHO PCGRIDDS. It can be deleted when no longer needed.
ECHO.
ECHO Usage: GETDATA year month day hour
ECHO year = always 4 digits
ECHO month = always 2 digits
ECHO day = always 2 digits
ECHO hour = forecast base hour (always 2 digits) (usually 00 or 12)
ECHO.
ECHO Example:
ECHO GETDATA 2003 07 04 12
ECHO.
::
:End
Weasel

Post by Weasel »

This is just a simple modification of the above that retrieves NAM 211 grid data out to 24 hours.

@echo off
::
::
:: PCGRIDDS32 Downloader
:: (c) 2003 Tim Vasquez / All Rights Reserved
:: Version 1.0
::
::
if "%4"=="" goto Usage
::
:: Begin download
::
echo Please wait... this will take a few moments... accessing datasets...
::
:: Download each forecast hour from NWSTG server
::
cd c:\pcgridds32\grib\nws
del nam*
echo Downloading 00h...
url2file ftp://weather.noaa.gov/SL.us008001/ST.o ... _gr.awp211 nam00.dat
echo Downloading 06h...
url2file ftp://weather.noaa.gov/SL.us008001/ST.o ... _gr.awp211 nam06.dat
echo Downloading 12h...
url2file ftp://weather.noaa.gov/SL.us008001/ST.o ... _gr.awp211 nam12.dat
echo Downloading 18h...
url2file ftp://weather.noaa.gov/SL.us008001/ST.o ... _gr.awp211 nam18.dat
echo Downloading 24h...
url2file ftp://weather.noaa.gov/SL.us008001/ST.o ... _gr.awp211 nam24.dat
echo Postprocessing...
cd c:\pcgridds32
::
:: Build GRIBNAMES.DAT file which tells NGRB2PCG32 which GRIB files
:: it needs to decode
::
echo nam00.dat > gribnames.dat
echo nam03.dat >> gribnames.dat
echo nam06.dat >> gribnames.dat
echo nam09.dat >> gribnames.dat
echo nam12.dat >> gribnames.dat
::
:: Now run NGRB2PCG32 to convert all this data to PCGRIDDS32 format.
::
call ngrb2pcg32
::
:: All done!
::
echo.
echo Downloading and processing complete. You can now run PCGRIDDS.
echo.
goto :End
::
:Usage
::
ECHO.
ECHO PCGRIDDS DOWNLOADER
ECHO (c) 2003 Tim Vasquez
ECHO Version 1.0
ECHO.
ECHO REQUIREMENTS: You MUST have PCGRIDDS installed in C:\PCGRIDDS32
ECHO and you MUST have URL2FILE (available at http://www.chami.com). If you
ECHO type URL2FILE at the command line and get an error, it is not
ECHO installed.
ECHO.
ECHO This version only does nam data but can be adapted by the user
ECHO for other grids. When completed, the outputted
ECHO grid is available in \PCGRIDDS32\GRIDDATA and you can then run
ECHO PCGRIDDS. It can be deleted when no longer needed.
ECHO.
ECHO Usage: GETDATA year month day hour
ECHO year = always 4 digits
ECHO month = always 2 digits
ECHO day = always 2 digits
ECHO hour = forecast base hour (always 2 digits) (usually 00 or 12)
ECHO.
ECHO Example:
ECHO GETDATA 2003 07 04 12
ECHO.
::
:End
wxforecaster
Senior Member
Posts: 252
Joined: Mon May 02, 2005 4:13 pm
Contact:

Post by wxforecaster »

Very nice.. Thanks for this script! It will REALLY come to use!
Weasel

Post by Weasel »

&quot wrote:Very nice.. Thanks for this script! It will REALLY come to use!
Tim Vasquez wrote the batch file. I only modified it to work with what I feel is the fastest NOAA server at present.

Pat
Post Reply