--- ray/src/util/dayfact.csh 1991/11/28 11:49:12 2.2 +++ ray/src/util/dayfact.csh 2005/02/16 05:40:12 2.6 @@ -1,5 +1,5 @@ #!/bin/csh -f -# SCCSid "$SunId$ LBL" +# RCSid: $Id: dayfact.csh,v 2.6 2005/02/16 05:40:12 greg Exp $ # # Interactive script to calculate daylight factors # @@ -28,9 +28,9 @@ a contour plot from the result. The input is a Radian (and octree) and the output is one or more color Radiance pictures. _EOF_ -echo -n "Have you already calculated an illuminance picture with dayfact? " -if ( "$<" =~ [yY]* ) then - readvar illumpic +echo "Have you already calculated an illuminance picture using dayfact?" +readvar illumpic +if ( $illumpic != $nofile ) then if ( ! -r $illumpic ) then echo "Cannot read $illumpic" exit 1 @@ -74,18 +74,18 @@ if ( $genskyf == $nofile ) then echo "You will not be able to compute daylight factors" echo "or energy savings since there is no gensky file." else - xform -e $genskyf > /usr/tmp/gsf$$ - grep '^# gensky ' /usr/tmp/gsf$$ + xform -e $genskyf > /tmp/gsf$$ + grep '^# gensky ' /tmp/gsf$$ if ( $status ) then echo "The file $genskyf does not contain a gensky command\!" - rm -f /usr/tmp/gsf$$ + rm -f /tmp/gsf$$ goto getgenskyf endif - set title=$title\ `sed -n 's/^# gensky *\([0-9][0-9]* *[0-9][0-9]* *[0-9][0-9.]*\).*$/\1/p' /usr/tmp/gsf$$` - set extamb=`sed -n 's/^# Ground ambient level: //p' /usr/tmp/gsf$$` - grep -s '^# gensky .* -c' /usr/tmp/gsf$$ + set title=$title\ `sed -n 's/^# gensky *\([0-9][0-9]* *[0-9][0-9]* *[0-9][0-9.]*\).*$/\1/p' /tmp/gsf$$` + set extamb=`sed -n 's/^# Ground ambient level: //p' /tmp/gsf$$` + grep -s '^# gensky .* -c' /tmp/gsf$$ set nodaysav=$status - rm -f /usr/tmp/gsf$$ + rm -f /tmp/gsf$$ if ( $nodaysav ) then echo "The gensky command was not done for an overcast sky" echo "(-c option), so energy savings cannot be calculated." @@ -115,17 +115,17 @@ if ( $ilpict == $nofile && $dfpict == $nofile && $dspi endif echo "Title for output picture" readvar title -set sctemp=/usr/tmp/sc$$.csh +set sctemp=/tmp/sc$$.csh cat <<'_EOF_' > $sctemp if ( $illumpic != $nofile ) then set iltemp="" else - set iltemp=/usr/tmp/il$$.pic + set iltemp=/tmp/il$$.pic set illumpic=$iltemp endif -set tltemp=/usr/tmp/tl$$.pic -set dstemp=/usr/tmp/ds$$.pic -set temp1=/usr/tmp/tfa$$ +set tltemp=/tmp/tl$$.pic +set dstemp=/tmp/ds$$.pic +set temp1=/tmp/tfa$$ set tempfiles=($iltemp $sctemp $tltemp $dstemp $temp1) echo "Your dayfact job is finished." echo "Please check for error messages below." @@ -136,8 +136,8 @@ if ( ! $?gotillumpic ) then | rcalc -e '$1=($2+.5)/'"$wpres[1]*$wpsize[1]+$wporig[1]" \ -e '$2=(1-($1+.5)/'"$wpres[2])*$wpsize[2]+$wporig[2]" \ -e '$3='"$wporig[3]" -e '$4=0;$5=0;$6=1' \ - | rtrace $rtargs -h+ -I+ -ov -faf $octree \ - | pvalue -r -y $wpres[2] +x $wpres[1] -df > $temp1 + | rtrace $rtargs -h+ -I+ -ov -fac -x $wpres[1] -y $wpres[2] $octree \ + > $temp1 pfilt -h 20 -n 0 -x 300 -y 300 -p 1 -r 1 $temp1 > $illumpic endif set maxval=`getinfo < $illumpic | rcalc -i 'EXPOSURE=${e}' -e '$1=3/e'`