#!/bin/sh # UDRESPATH=/weather/ldm/unidata/etc/Wxp.res PATH=/usr/local/bin:/bin:/usr/bin:/weather/ldm/unidata/bin LD_LIBRARY_PATH=/usr/lib:/usr/ucblib:/usr/openwin/lib TDATE=`date +%j%H%M%S` TFILE=img$TDATE.gif TFFILE=/home/system/gopher/htdocs/images/$TFILE export UDRESPATH PATH LD_LIBRARY_PATH # **** **** **** **** CONFIGURABLE VARIABLES **** **** **** **** WEATHER=/weather/ldm/unidata/bin/sfcwx # **** **** **** **** NO CONFIGURATION NEEDED BELOW **** **** **** **** # # if [ -x $WEATHER ]; then # #.. To support an ISINDEX type search, set query string if given # an argument on the command line # if [ $# -gt 0 ]; then PREFIX="query=" fi # #.. Check that a query has been made # if [ $QUERY_STRING ]; then # #.. Strip the variables out from the query string, # and assign them into the environment, prefixed by 'QS_' # # o sed removes any ' that would upset quoted assignment # # o awk ensures that # - all variables passed have legal names # - special characters are not interpreted by sh # eval `echo $PREFIX$QUERY_STRING | sed -e 's/'"'"'/%27/g' | \ awk 'BEGIN{RS="&";FS="="} $1~/^[a-zA-Z][a-zA-Z0-9_]*$/ { printf "QS_%s=%c%s%c\n",$1,39,$2,39}' ` # #.. Set the search type # case $QS_region in Continental+United+States) OPT_reg='us' ;; New+England+States) OPT_reg='ne' ;; Atlantic+States) OPT_reg='at' ;; Southeastern+States) OPT_reg='se' ;; Midwestern+States) OPT_reg='mw' ;; Southern+Plains) OPT_reg='sp' ;; Northwestern+States) OPT_reg='nw' ;; Southwestern+States) OPT_reg='sw' ;; *) OPT_reg='us' ;; esac # #.. Set the server address # case $QS_var in Station+Plot) OPT_prog='all' ;; Temperature) OPT_prog='st' ;; Dewpoint) OPT_prog='td' ;; Relative+Humidity) OPT_prog='rh' ;; Sea+Level+Pressure) OPT_prog='pr' ;; Present+Weather) OPT_prog='wx' ;; Wind+Speed) OPT_prog='ws' ;; Wind+Direction) OPT_prog='wd' ;; Wind+Barbs) OPT_prog='wb' ;; *) OPT_prog='all' ;; esac # #.. Output header # cat << EOM Content-type: text/html Observation Map for $QS_region

Observation Map for $QS_region

Filename: $TFILE


EOM /weather/ldm/unidata/bin/sfcwx -current l -region $OPT_reg -variable $OPT_prog \ -plot_param gif:$TFFILE \ -data_path /weather/ldm/data/surface/sao \ -con_path /weather/ldm/data/decoded \ -file_path /weather/ldm/unidata/etc \ -device d,vortex\:1 -icon > /dev/null echo '' echo '' else # #.. The script was called without a query. # Provide an ISINDEX type response for browsers # without form support. # cat << EOM Content-type: text/html Current Map Search

Current Map Search


Enter Region

Enter Variable to Plot

Press Here when Finished

EOM fi else # # Brendan Kehoe's Archie Client was not found # Report a useful message # cat << EOM Content-type: text/html WX Program not found

WX Program not found

don@weather.brockport.edu
EOM fi