# Quick program to fetch NWM raw output. # Logan Karsten # National Center for Atmospheric Research # Research Applications Laboratory import datetime import subprocess hoursBack = 30 hoursLag = 6 bDate = datetime.datetime.now() for step in range(1,0,-1): dCurrent = bDate - datetime.timedelta(hours=step*24) for fcstHr in range(3,243,3): fcstHrStr = str(fcstHr) fcstHrStr = fcstHrStr.zfill(3) mediumPath = "http://www.ftp.ncep.noaa.gov/data/nccf/com/nwm/prod/nwm." + \ dCurrent.strftime('%Y%m%d') + '/medium_range/nwm.t06z.medium_range.channel_rt.f' + \ fcstHrStr + '.conus.nc.gz' cmd = 'wget ' + mediumPath subprocess.call(cmd,shell=True) mediumPath = "http://www.ftp.ncep.noaa.gov/data/nccf/com/nwm/prod/nwm." + \ dCurrent.strftime('%Y%m%d') + '/medium_range/nwm.t06z.medium_range.land.f' + \ fcstHrStr + '.conus.nc.gz' cmd = 'wget ' + mediumPath subprocess.call(cmd,shell=True) mediumPath = "http://www.ftp.ncep.noaa.gov/data/nccf/com/nwm/prod/nwm." + \ dCurrent.strftime('%Y%m%d') + '/medium_range/nwm.t06z.medium_range.terrain_rt.f' + \ fcstHrStr + '.conus.nc.gz' cmd = 'wget ' + mediumPath subprocess.call(cmd,shell=True)