WESTERN REGION TECHNICAL ATTACHMENT
NO. 96-24
SEPTEMBER 24, 1996
CURRENT SATELLITE IMAGERY FOR HOMEPAGES
Elisa Brewerton - WRH/SSD, Salt Lake City, UT
Displaying current satellite images on the homepage can be a benefit to the public, especially those interested in aviation weather, fire weather, marine weather, or flash flood situations. This Technical Attachment (TA) will give the information needed to make these products available on a homepage.
To display current satellite images on the homepage, three things are needed for a UNIX workstation: a csh (pronounced c-shell) script, a crontab file, and HTML code. The csh script FTPs (file transfer protocol) the proper files from RAMSDIS to the homepage directory. The crontab file executes the csh script at a specified time interval. The HTML code allows the images to be displayed on the world wide web.
This TA gives you the script, the instructions on how to create a crontab file, and the HTML code.
The script is based on the getAREAfiles script, originally written by Ron Miller, SOO at NWSO Spokane. David Zaff NWSFO Salt Lake City modified the original script to perform the FTP desired. The script FTPs to RAMSDIS and then retrieves the latest gif satellite images. It then can FTP these files to the homepage.
The script is available via FTP from Nimbo.wrh.noaa.gov (title of the script: satellitescript, in the default directory: /users/http) or it may be copied from this TA. In any directory, save the script with a ".csh" extension.
The script requires some local information. The information to be added is indicated by a set of "<>" marks. Remove these marks when adding or changing the information, or giving user-names and passwords. The lines in the script beginning with "#" are comment lines. The comment lines include instruction on possible modifications to the script. There is one exception, the line "#!/bin/csh" is not a comment line, but is necessary for proper execution of the script. If the file names do not correlate with local RAMSDIS file names, then they must also be changed.
#Start of script #!/bin/csh set UNIX_GIFDIR=set RAMSDIS_GIFDIR=mcidas/data set WEBPAGE_DIR= set RAMSDIS_HOSTNAME= set WEBPAGE_HOSTNAME=nimbo.wrh.noaa.gov # start ftp job and collect files from RAMSDIS # if username and password are necessary for RAMSDIS, enter that # information where prompted, if not delete the entire line ftp -nv $RAMSDIS_HOSTNAME << _EOF_ user binary lcd $UNIX_GIFDIR cd $RAMSDIS_GIFDIR get ir4.gif get vis1.gif get wv8.gif get vis4.gif get visrad.gif get irrad.gif bye _EOF_ # send the images to the Web page ftp -nv $WEBPAGE_HOSTNAME << _EOF_ user cd $WEBPAGE_DIR lcd $UNIX_GIFDIR binary put ir4.gif put vis1.gif put wv8.gif put vis4.gif put visrad.gif put irrad.gif bye _EOF_ # copy new gif files to local httpd directory # uncomment (by removing "#") the following line if wanted for use on intranet #cp $GIFDIR/*gif / /$WEBPAGE_DIR #End of script
In a UNIX environment, periodic execution is handled by the cron daemon. Cron starts when the system is booted and will remain running as long as the system is up. Cron reads crontab configuration file(s) that have a list of commands and command execution times.
If the script is called from a crontab file, the system will update the satellite images at specified intervals.
Time field Range
minute (minute of the hour) 0 to 59
hour (hour of the day) 0 to 2
day (day of the month) 1 to 3
month (month of the year) 1 to 12
week (day of the week) 0 to 6 (0=Sun)
0,15,30,45 * 10-15 1,2,10,11,12 * command
Note: Every time this cronjob is executed, a message is mailed to the user.
On the Western Region homepage, the current satellite images are located in "Current Imagery".
Note: Real-time satellite imagery is a service to the public. So, when giving the Name_ of_image, be sure to denote which weather product it is associated with.
Displaying current satellite images on the homepage can be a benefit to the public, especially those interested in aviation weather, fire weather, marine weather, or flash flood situations. With the use of scripts and crontab files, real-time data are easily added to homepages.