#!/bin/csh

# This c-shell script uses the GET command.
# The lwp-download command was added as another option on 20100304.

# It downloads national radar composite images from 29 June to 1 July, 2006.
# As an example of selective downloading, the script only requests even hours 
# with a time stamp of 30 minutes past the hour. 

# Modify the dates and times to suit your needs. 
# Request a different type of image by changing the variable "img_path".

set baseURL = "http://www.mmm.ucar.edu/imagearchive1/"

# Dates are specified between the parentheses below, separated by spaces.
# Their format is MMdd, where MM is 2-digit month and dd is 2-digit day.
foreach date (20060629 20060630 20060701)
   # Hours are specified beween the parentheses below (2-digit format)
   foreach hour (00 02 04 06 08 10 12 14 16 18 20 22)
     # minute loop - (2-digit format)
     foreach min (30)
       set img_path = RadarComposites/national/${date}/national_${date}${hour}${min}.gif 
       GET ${baseURL}$img_path > `basename $img_path`
       # If GET command is not availble on your system,
       # try lwp-download instead.
       # To try lwp-download, comment out the GET line above 
       # and uncomment the following line:
       # lwp-download ${baseURL}$img_path `basename $img_path`
     end
   end
end

