how to automate ftp dwnld

Discuss any other weather software not covered above, including data feeds, weather web pages, and more!
Post Reply
arubawx
Member
Posts: 21
Joined: Sun Jun 20, 2004 3:33 am
Location: Aruba DWI
Contact:

how to automate ftp dwnld

Post by arubawx »

hi,
I am trying to automate my ftp dwnlds but Ncep changes the dates of the files everyday. I was wondering if someone knows how to automate this file. I am using a scheduler to dwnld the files but because the dates change everday, I have to manually change the date the day before. Any help will be appreciated.

shorthend version of dos batch file: (ftp site: ftp weather.noaa.gov)

bin
get us008_gf096_04070706_HxLBx
quit

The 0707 has to be changed ... since wildcards dont work and ncep changes it everyday

Any help will be useful thanks
marck :wink:
arubawx
Member
Posts: 21
Joined: Sun Jun 20, 2004 3:33 am
Location: Aruba DWI
Contact:

Never Might I figured it out already

Post by arubawx »

Alright after trying a couple of stuf, I have figured out how to manipulate the batch processing to auto update the dates ... afterwards one can use any scheduler to let the program run automatically here are the codes:
@echo off
ECHO THIS WORKS ONLY FOR WINXP !!!!
FOR /F "tokens=1-4 delims=/ " %%I IN ('DATE /t') DO SET mydate=%%J%%K%%L

ECHO Today is "%mydate%"

Set M=%DATE:~7,2%
Set O=%DATE:~4,2%
::
::
::
:: Begin download process
echo Please wait... this will take a few moments... depending on your isp access .. viola..
cd d:\pcgridds32\grib\nws
del *eta*
echo Downloading 06z data...while you're waiting did you know that NGM=NoGoodModel.. ;-)

url2file ftp://ftpprd.ncep.noaa.gov/pub/data/ncc ... grd00.tm00 d:\pcgridds32\grib\nws\eta1.dat
url2file ftp://ftpprd.ncep.noaa.gov/pub/data/ncc ... grd06.tm00 d:\pcgridds32\grib\nws\eta2.dat
url2file ftp://ftpprd.ncep.noaa.gov/pub/data/ncc ... grd12.tm00 d:\pcgridds32\grib\nws\eta3.dat
url2file ftp://ftpprd.ncep.noaa.gov/pub/data/ncc ... grd18.tm00 d:\pcgridds32\grib\nws\eta4.dat
url2file ftp://ftpprd.ncep.noaa.gov/pub/data/ncc ... grd24.tm00 d:\pcgridds32\grib\nws\eta5.dat
url2file ftp://ftpprd.ncep.noaa.gov/pub/data/ncc ... grd30.tm00 d:\pcgridds32\grib\nws\eta6.dat
url2file ftp://ftpprd.ncep.noaa.gov/pub/data/ncc ... grd36.tm00 d:\pcgridds32\grib\nws\eta7.dat
url2file ftp://ftpprd.ncep.noaa.gov/pub/data/ncc ... grd42.tm00 d:\pcgridds32\grib\nws\eta8.dat
url2file ftp://ftpprd.ncep.noaa.gov/pub/data/ncc ... grd48.tm00 d:\pcgridds32\grib\nws\eta9.dat
url2file ftp://ftpprd.ncep.noaa.gov/pub/data/ncc ... grd60.tm00 d:\pcgridds32\grib\nws\eta10.dat
url2file ftp://ftpprd.ncep.noaa.gov/pub/data/ncc ... grd72.tm00 d:\pcgridds32\grib\nws\eta11.dat

echo Done Downloading
cd d:\pcgridds32\grib\temp
::
::
::
echo.
echo Downloading and processing complete. You can now run PCGRIDDS32.
echo Pcgridds batch processing with automatic date updater.
echo Sorry I noticed that WINXP is the only O/S that can handle this feature. :-(
echo Tim's url2file program is actually real good .... makes life easier...
echo These Eta files covers the Caribbean too..
::End


Enjoy !!!! this is an example for auto dwnlding eta files that include the Caribbean (~8mb each file)
marck :wink:
stevek
Junior Member
Posts: 1
Joined: Sat Nov 29, 2003 7:46 pm

Post by stevek »

I have a few questions about this ftp script.

I had to change all references about cd d:\pcgridds32\... to cd c:\pcgridds32\...

Why do you have cd d:\pcgridds32\grib\temp after you are finished downloading? I do not even have the temp directory.

Why in Tim's script does he build a GRIBNAMES.DAT file?

How does NGRB2PCG32 run to convert the data to PCGRIDDS32 format or is that not required for ETA data?

Steve
arubawx
Member
Posts: 21
Joined: Sun Jun 20, 2004 3:33 am
Location: Aruba DWI
Contact:

Post by arubawx »

hum ... depends how you installed pcgridds32 .... i always partition my hdisk and have windows o/s sitting alone on the c partition ...(system runs faster)... now if you have pcgridds32 on your c partion, then you have to change the scirpt to reference c: ... about the temp subdir... I am running the script from the temp dir ... thats why i have it ending there ... you dont need to do this ... just remove the line ...

cheers marck
arubawx
Member
Posts: 21
Joined: Sun Jun 20, 2004 3:33 am
Location: Aruba DWI
Contact:

Post by arubawx »

oh on the gridnames.dat .... this has to do with the old pcgridds ... you dont need it anymore
Post Reply