The Weather Forecasting Forum

Discussions about the latest in meteorology, programs, tools, and techniques
It is currently Sat Dec 16, 2017 11:15 am

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: PCGRIDDS32 fetch macro
PostPosted: Wed Jun 16, 2004 4:38 am 
Offline
Administrator

Joined: Sat Nov 22, 2003 10:47 pm
Posts: 511
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. Jeff may want to point out any suggestions that makes it work better... I've only used it with the beta version (and it works great). If it gets popular I can 'sticky' it on the forum so more people can use 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.

Tim

Code:
@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\final
del eta*
del ruc*
echo Downloading 00h...
url2file http://weather.noaa.gov/pub/SL.us008001/ST.opnl/MT.ruc_CY.%4/RD.%1%2%3/PT.grid_DF.gr1/fh.anal_tl.press_gr.us40km ruc00.dat
echo Downloading 03h...
url2file http://weather.noaa.gov/pub/SL.us008001/ST.opnl/MT.ruc_CY.%4/RD.%1%2%3/PT.grid_DF.gr1/fh.0003_tl.press_gr.us40km ruc03.dat
echo Downloading 06h...
url2file http://weather.noaa.gov/pub/SL.us008001/ST.opnl/MT.ruc_CY.%4/RD.%1%2%3/PT.grid_DF.gr1/fh.0006_tl.press_gr.us40km ruc06.dat
echo Downloading 09h...
url2file http://weather.noaa.gov/pub/SL.us008001/ST.opnl/MT.ruc_CY.%4/RD.%1%2%3/PT.grid_DF.gr1/fh.0009_tl.press_gr.us40km ruc09.dat
echo Downloading 12h...
url2file http://weather.noaa.gov/pub/SL.us008001/ST.opnl/MT.ruc_CY.%4/RD.%1%2%3/PT.grid_DF.gr1/fh.0012_tl.press_gr.us40km 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 [url]www.chami.com)[/url].  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


Top
 Profile  
 
 Post subject: Fetch Macro...
PostPosted: Thu Jun 17, 2004 1:02 am 
Tim,

Thanks for the macro...I've always wanted to do this but wasn't quite sure how to go about it. That URL2FILE utility is handy!!

A few quick things...
1. The destination directory should be "c://pcgridds32/grib/nws/" and not "c://pcgridds32/grib/final/"

2. NGRB2PCG32 does not need the GRIBNAMES.DAT file. The program reads the directory and gets the file names directly.

Questions:
1. Which version if URL2FILE is better...Java or Active-X?

2. What is GETDATA and how is it used? The batch routines don't work without it. Getting the date into the directory string to download proper data has been my biggest problem in doing routines like this.

Thanks,
Jeff


Top
  
 
 Post subject: Re: Fetch Macro...
PostPosted: Mon Jun 21, 2004 9:44 pm 
Offline
Administrator

Joined: Sat Nov 22, 2003 10:47 pm
Posts: 511
Jeff Krob wrote:
1. Which version if URL2FILE is better...Java or Active-X?


Neither... I use the Win32 version. Maybe this is the version that is needed: http://www.chami.com/free/url2file_wincon.html . It's really just a little standalone EXE and I put it in the Windows directory so it's available systemwide. I haven't been to that site in a long time so I've forgotten a lot about it.

Jeff Krob wrote:
What is GETDATA and how is it used? The batch routines don't work without it. Getting the date into the directory string to download proper data has been my biggest problem in doing routines like this.


Actually the entire batch file is called getdata.bat. You'd run it by typing getdata. There should be no calls to itself.

Tim


Top
 Profile  
 
 Post subject: PCGRIDDS32 FETCH MACRO
PostPosted: Mon Jul 05, 2004 5:08 pm 
Offline
Member

Joined: Mon Jul 05, 2004 5:02 pm
Posts: 13
COULD BE MY DOS IGNORANCE, BUT I CANNOT GET THE FETCH MACRO TO WORK. FOR STARTERS, I CANNOT EVEN CHANGE INTO THE PCGRIDDS32 DIRECTORY ONCE IN COMMAND MODE. I SUSPECT THIS HAS SOMETHING TO DO WITH THE 10 CHARACTER LENGTH OF THE DIRECTORY NAME. WHEN I PUT URL2FILE INTO THE WINDOWS DIRECTORY AND RUN IT MANUALLY FROM THERE, THE LENGTH OF THE COMMAND TO GET THE RUC DATA EXCEEDS THE LIMIT FOR THE LENGTH OF A COMMAND. ANY ASSISTANCE WOULD BE APPRECIATED. THANKS!


Top
 Profile  
 
 Post subject: PCGRIDDS32 fetch macro
PostPosted: Tue Jul 06, 2004 1:30 am 
Offline
Member

Joined: Sun Nov 30, 2003 1:26 am
Posts: 79
Dear Greg;

I am about as MS-DOS unskilled as you, but I think I might be able to offer some help. First off, if you are in Command mode, you are already in the PCGRIDDS32 directory, so that is probably why you cannot switch to it. I have run the fetch macro successfully by starting Command Prompt (Windows XP) then typing CD\PCGRIDDS32>getdata, instead of >P32. My copy of the macro ran fine after that. Hope this helps.

Cordially,
Carl Sidor


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 09, 2004 2:45 pm 
Offline
Member

Joined: Mon Jul 05, 2004 5:02 pm
Posts: 13
Carl,

Thanks for your help-the fetch routine is working fine now!


Greg


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: Bing [Bot] and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group