#! /bin/csh # #.file meteorun #.purpose calls the meteoli MeteoMonitor program, # converts the result in appropriate format, and # loops forever #.usage # Debug: meteorun # Real operation: meteorun >& /dev/null & # # who when what # ---------------------------------------------------------------- # fselman 2005-01-23 After changeover of web system this script # needed some modifications. See program. # ohainaut 2003-09-04 cleaned # fgutierr 2000-10-02 The new asm machine for La Silla is wlsasm.ls.eso.org # ohainaut 1997-11-00 creation # # #------------------------------------------------------------------------------ # #- definitions: set asmWs = wlsasm.ls.eso.org #- Initializations: @ i = 1 set path=( . .. /scisoft/bin /vlt/gnu/bin /usr/local/bin /bin /usr/bin $path) cp dimm.dat dimm.bup @ lastStored = 0 while(1) echo "--$i--------------" date #-- get the last data echo "ftp" #wget -N ftp://$asmWs/pub/meteo.last #wget -N ftp://$asmWs/pub/dimm.last #wget -N ftp://$asmWs/pub/log/longexp.log #-- Build the meteo.last file -- /export/diskwa/webdocs/lasilla/lasilla/dimm/meteo_build.csh #get meteo.last meteo.last ftp -n $asmWs <! ut.last #-- create the new page and graphs. echo "meteoli" meteoli #-- converts the PS into GIFs echo '(current.ps)run' | gs -q -dNOPAUSE -dNO_PAUSE -sDEVICE=ppmraw -dTextAlphaBits=4 -sOutputFile=current.ppm pnmcrop < current.ppm | ppmquant 256 | ppmtogif > currentTmp.gif mogrify -rotate 90 currentTmp.gif mv currentTmp.gif current.gif echo '(current_zoom.ps)run' | gs -q -dNOPAUSE -dNO_PAUSE -sDEVICE=ppmraw -dTextAlphaBits=4 -sOutputFile=current_zoom.ppm pnmcrop < current_zoom.ppm | ppmquant 256 | ppmtogif > current_zoomTmp.gif mogrify -rotate 90 current_zoomTmp.gif mv current_zoomTmp.gif current_zoom.gif #-- create the earth map echo "xearth" xearth -proj merc -pos fixed,0,0 -gif -size 320,150 -nostars -night 35 -ncolors 16 -term 100 >! xearth.gif #-- housekeeping: delete old files # # we added the egrep to protect certain files. # @ i = `ls -1 *gif | wc -l` if ( $i > 18 ) then @ i = $i - 18 rm `ls -1t {current,xearth}*gif | egrep -v 'current_zoom.gif|xearth_zoom.gif|current.gif|xearth.gif' | tail -$i` endif rm -f ps_* >& /dev/null #-- store ps in archive if ( `date -u +%d` != lastStored ) then if ( `date -u +%H` == 10 ) then cp meteomonitor.ps Archive/end`date -u +%y%m%d`.ps @ lastStored = `date -u +%d` endif endif # the link creation was moved here so that the current_hhmm links got created # ln -s current.gif current_`cat ut.last`.gif ln -s current_zoom.gif current_zoom_`cat ut.last`.gif ln -s xearth.gif xearth_`cat ut.last`.gif #-- wait for next iteration /export/diskwa/webdocs/lasilla/lasilla/dimm/fool.csh echo "done, sleeping" sleep 81 @ i ++ end