#!/usr/local/bin/perl require "../../cgi-lib.pl"; &ReadParse(*in); print "Content-type: text/html\n\n"; OPEN(/WWW/httpd/cgi-bin/cab/goesbrowse/whirl); #------------------------------------------------- # Variable input from web page #------------------------------------------------- $sat=$in{'sat'}; $chan=$in{'chan'}; $year=$in{'year'}; $month=$in{'month'}; $dom=$in{'dom'}; $time=$in{'time'}; #------------------------------------------------- # Set variables for satellite and channel #------------------------------------------------- if ($sat eq "GOES-8") { $sat2 = "g8"; } else { $sat2 = "g9"; } if ($chan eq "Infrared") { $chan = "ir"; } else { $chan = "vis"; } #------------------------------------------------- # Build .gif file name for browse image based on input from user #------------------------------------------------- $gif=$sat2 . $chan . $dom . $month . $year . $time; #------------------------------------------------- # Set variables for earliest valid GOES-8 and GOES-9 dates #------------------------------------------------- $g8begdate=961214; $g9begdate=970107; $skip=1; #------------------------------------------------- # Get current date (GMT) and set year, month, day and time variables #------------------------------------------------- $sdate = `date -u`; $syear = substr($sdate,26,2); $smon = substr($sdate,4,3); $sdom = substr($sdate,8,2); $stime = substr($sdate,11,2); #------------------------------------------------- # Convert current month from character to integer value #------------------------------------------------- if ($smon eq "Jan") { $snmon=1; } elsif ($smon eq "Feb") { $snmon=2; } elsif ($mon eq "Mar") { $snmon=3; } elsif ($mon eq "Apr") { $snmon=4; } elsif ($month eq "May") { $snmon=5; } elsif ($mon eq "Jun") { $snmon=6; } elsif ($mon eq "Jul") { $snmon=7; } elsif ($mon eq "Aug") { $snmon=8; } elsif ($month eq "Sep") { $snmon=9; } elsif ($month eq "Oct") { $snmon=10; } elsif ($mon eq "Nov") { $snmon=11; } elsif ($mon eq "Dec") { $snmon=12; } #------------------------------------------------- # Concatenate current date/time variables #------------------------------------------------- $syearmodati=($syear*1000000)+($snmon*10000)+($sdom*100)+($stime); #------------------------------------------------- # Convert user requested month from character to integer value #------------------------------------------------- if ($month eq "JAN") { $imon=1; } elsif ($month eq "FEB") { $imon=2; } elsif ($month eq "MAR") { $imon=3; } elsif ($month eq "APR") { $imon=4; } elsif ($month eq "MAY") { $imon=5; } elsif ($month eq "JUN") { $imon=6; } elsif ($month eq "JUL") { $imon=7; } elsif ($month eq "AUG") { $imon=8; } elsif ($month eq "SEP") { $imon=9; } elsif ($month eq "OCT") { $imon=10; } elsif ($month eq "NOV") { $imon=11; } elsif ($month eq "DEC") { $imon=12; } #------------------------------------------------- # Concatenate user inputted date/time values #------------------------------------------------- $iyearmoda=($year*10000)+($imon*100)+($dom); $iyearmodati=($year*1000000)+($imon*10000)+($dom*100)+($time); #------------------------------------------------- # If future date requested, send error message #------------------------------------------------- if ($iyearmodati > $syearmodati) { print <

Browse images for future dates and times are not yet available!

OUTPUT $skip=2; } #------------------------------------------------- # IF GOES-8 date requested is prior to earliest # available date, send error message #------------------------------------------------- if (($sat eq "GOES-8") and ($iyearmoda < $g8begdate)) { print <

GOES-8 images prior to December 14, 1996 are not yet available!

OUTPUT $skip=2; } #------------------------------------------------- # IF GOES-9 date requested is prior to earliest # available date, send error message #------------------------------------------------- if (($sat eq "GOES-9") and ($iyearmoda < $g9begdate)){ print <

GOES-9 images prior to January 07, 1997 are not yet available!

OUTPUT $skip=2; } #------------------------------------------------- # If .gif image is found, provide user with image information # and thumbnail link to full size image #------------------------------------------------- print <

Image Information:

Date: $dom $month $year
Approximate Time: $time UTC
Satellite: $sat
Channel: Infrared Channel 4

Please click on the thumbnail image below for full size image.....




OUTPUT #------------------------------------------------- # If image requested is within range of data holdings but is missing, # provide user with a list of possible reasons #------------------------------------------------- if ($skip eq 1) { print <

The browse image you have requested in not available. This could be due to several reasons, including:

- An operational problem with the GOES satellite on your requested date and time.
- Problems with NCDC's GOES Browse image production system.

Please contact the NCDC Satellite Services Group for more specific information.

OUTPUT }