#!/bin/sh # $Header: map_gen_cron,v 1.15 2008/01/08 00:38:14 ghz Exp $ # the goes.gsfc.nasa.gov people used to put up a neat graphic of the north north pacific # here: http://goes.gsfc.nasa.gov/goeswest/pacific_north2/ but then they stopped. # they did however put up a neat link here: # http://goes.gsfc.nasa.gov/goeswest-lzw/fulldisk/3band_color/3band_color_readme.txt # explaining how they used to generate said graphic. so now i do it using a very very similar # but not quite identical process so i can have my pretty picture back. cd /home/ghz/wx/goes.gsfc.nasa.gov/pacific_north2/ || exit 1 VIS="http://goes.gsfc.nasa.gov/goeswest-lzw/pacific_north2/vis/latest.tif" IR4="http://goes.gsfc.nasa.gov/goeswest-lzw/pacific_north2/ir4/latest.tif" IR2="http://goes.gsfc.nasa.gov/goeswest-lzw/pacific_north2/ir2/latest.tif" INFO="http://goes.gsfc.nasa.gov/goeswest-lzw/pacific_north2/vis/latest.info" SERVER="goes.gsfc.nasa.gov" ROOT="http://goes.gsfc.nasa.gov/goeswest-lzw/pacific_north2/maps/" COUNTRIES="pacific_north2_0801031800_G11I04_countries.tif" STATES="pacific_north2_0801031800_G11I04_states.tif" NAV_UPD_NOTIFY="echo \"May need to update weather map maps.\"| mail -s \"pacific_north2 navmap update\" ghz" FAIL="(echo \"Check cron logs for more info. =D; date)\"| mail -s \"===========WEATHER MAP SAD===========\" ghz; exit 1" wget --limit-rate=50k $VIS -O vis_latest.tif wget --limit-rate=50k $IR4 -O ir4_latest.tif wget --limit-rate=50k $IR2 -O ir2_latest.tif wget --limit-rate=50k $INFO -O latest.info # the nav maps update infrequently. http://goes.gsfc.nasa.gov/goeswest-lzw/pacific_north2/maps/readme.nav.txt # ping cuz sometimes the server is down # wget $ROOT/$COUNTRIES -O countries.tif # wget $ROOT/$STATES -O states.tif ping -c 1 $SERVER > /dev/null && { wget -q $ROOT -O - |grep -c $COUNTRIES || eval $NAV_UPD_NOTIFY wget -q $ROOT -O - |grep -c $STATES || eval $NAV_UPD_NOTIFY } stat -f "%Sm" -t "%a %b %e %T %Z %Y" vis_latest.tif | \ convert vis_latest.tif ir4_latest.tif ir2_latest.tif -combine -pointsize 20 -annotate +8+20 @- latenomap.tif \ && echo "Convert OK" || eval $FAIL composite latenomap.tif countries.tif states.tif -compose multiply -quality 80 latest.jpg && echo "Composite OK" || eval $FAIL cp latest.jpg latest.info map_gen_cron /wx/pacific_north2/ date