#!/bin/sh
#
# this program extract the NE weather map from the US map
# and enlarges the area.

GRAPHICS="/afs/athena.mit.edu/contrib/graphics/decmipsbin/"

set KRBTKFILE="/tmp/gif"
/var/ti/local/krbtgp -s -keyfile /etc/ti_serve_key ti_serve
attach ti_data

KRBTKFILE=/tmp/pips_ticks
export KRBTKFILE

# let's use the map in the weather locker
USMAP="/afs/athena.mit.edu/project/weather/SURFACE/latest"

# create new england gif image
echo "Extracting New England Area file..."

${GRAPHICS}giftoppm ${USMAP} | ${GRAPHICS}pnmcut 536 116 249 161 | ${GRAPHICS}pnmenlarge 2 \
  | ${GRAPHICS}ppmtogif > /tmp/ne.gif
#
# echo "Copying gif files"
# we assume that we have tokens and valid tickets
cp /tmp/ne.gif /afs/athena.mit.edu/system/ti_data/images/ne.gif

#cleanup
rm /tmp/ne.gif
kdestroy

echo "Finished."




