#!/bin/bash # //hal/~bbartram/cron/campix # prelim version Tue Nov 10 23:41:41 UTC 2009\ # try double set-position 2009-11-12 # see also pixseq # 2009-11-23 add DIA # runs via cron at 32 mintes after the hour # it also picks up the data from pixseq # currently 0-59/10 one denver-z1 # into its campix*.zip file b=campix export PATH=/home/bbartram/bin:/usr/bin ymdh=`date '+%Y%m%d%H'` of=/cygdrive/c/outgoing cdir=/home/bbartram/cron/$b-tmp # Note: pan vs Az pan == 0 is about 245 degrees True # the 3rd Flatiron is at pan=9.0312 and Google # Earth shows bearing 254.3, so add 245.3 degress # to pan angle to get Azimuth. # # Delorme topo6 has Longs Peak at 113.43 == 293.43 # Pix is pan= 48.6701 # I take the somewhere in the middle and say 245 # # At zoom = 1, the field of view is like 55 degrees wide # so a 6 pix panorama would be 60, 9, -42, -93, -144, 165 # with 51 degrees steps from West to South to East. # such a full panorama could replace all the tilt=0 z=1 pix. pix_list='# pix_list 2009-11-10 prelim # blank lines or lines starting # ignored # # target name pan= tilt= zoom= # tower itself towerW-down -p 76.5733 -t -81.7905 -z 1 towerE-down -p 162.2838 -t -74.2054 -z 1 towerE-295 -p 148.8604 -t -2.1486 -z 1 # # site gate-z5000 -p -52.0811 -t -22.7571 -z 5014 visitor-z2547 -p -47.4899 -t -26.0906 -z 2547 # # distant NW W S longs-peak-z2000 -p 48.6701 -t 0.3926 -z 2000 3rd-flatiron -p 9.0312 -t 0.9080 -z 8940 denver-z1000 -p -69.7238 -t -0.1890 -z 1002 denver-z1 -p -69.7238 -t -0.1890 -z 1 DIA-295 -p -141.3896 -t -0.3182 -z 1 skaggs-z8940 -p 8.3930 -t -0.3182 -z 8940 skaggs-z1 -p 8.3930 -t -0.3182 -z 1 # end' # 2009-11-16 now pixseq also puts jpgs in $cdir # so clean it every pass after the zip if [ -d "$cdir" ] ; then mkdir -p "$cdir" fi cd "$cdir" echo "$pix_list" | grep -v -e '^[ ]*#' -e '^[ ]*$' | while read t l ; do set-position $l sleep 3 # try a second position set to reduce location uncertainty? set-position $l sleep 3 rm grab-jpg-[0-9-]*.jpg 2>/dev/null grab-jpg # creates file grab-jpg-2009-11-11-001789.jpg name is based on grab-jpg called name # Y Y Y Y m m d d H H M M S S j=`ls grab-jpg-[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]-[0-9][0-9][0-9][0-9][0-9][0-9].jpg` if [ -n "$j" ] ; then g=`echo "$j" | sed "s/^grab-jpg-\([0-9][0-9][0-9][0-9]\)-\([0-9][0-9]\)-/$t-\1\2/"` mv "$j" "$g" fi done # zip with --move moves the files into the zip, aka creates zip and deletes # those files moved into the zip. --test checks the created zip before nuking # directory is still $cdir zip --move --test "$of/$b-$ymdh.zip" *.jpg # nuke anything left do not want the zip file to grow like topsy rm * 2>/dev/null exit # end