--- ray/src/px/falsecolor.csh 1992/08/21 15:46:11 2.3 +++ ray/src/px/falsecolor.csh 2003/02/22 02:07:27 2.8 @@ -1,5 +1,5 @@ -#!/bin/csh -f -# SCCSid "$SunId$ LBL" +#!/bin/csh -fe +# RCSid: $Id: falsecolor.csh,v 2.8 2003/02/22 02:07:27 greg Exp $ # # Create false color image with legend # @@ -15,6 +15,7 @@ set bluv='1-8/3*v' set ndivs=8 set picture='-' set cpict= +set loff=0 set legwidth=100 set legheight=200 while ($#argv > 0) @@ -63,9 +64,11 @@ while ($#argv > 0) breaksw case -cl: set docont=a + set loff=12 breaksw case -cb: set docont=b + set loff=13 breaksw case -e: set doextrem @@ -139,7 +142,7 @@ if ($?needfile && "$picture" == '-') then cat > $td/picture set picture=$td/picture endif -if ($decades > 0) then +if ("$decades" != "0") then set pc1args=($pc1args -e "map(x)=if(x-10^-$decades,log10(x)/$decades+1,0)") set imap="imap(y)=10^((y-1)*$decades)" else @@ -150,23 +153,23 @@ pcomb $pc0args -e 'v=(y+.5)/yres;vleft=v;vright=v' \ -x $legwidth -y $legheight > $td/scol.pic ( echo $label; cnt $ndivs \ | rcalc -e '$1='"($scale)*imap(($ndivs-.5-"'$1'")/$ndivs)" \ - -e "$imap" ) \ + -e "$imap" | sed -e 's/\(\.[0-9][0-9][0-9]\)[0-9]*/\1/' ) \ | psign -s -.15 -cf 1 1 1 -cb 0 0 0 \ -h `ev "floor($legheight/$ndivs+.5)"` > $td/slab.pic if ( $?doextrem ) then pextrem -o $picture > $td/extrema set minpos=`sed 2d $td/extrema | rcalc -e '$2=$2;$1=$1+'"$legwidth"` - set minval=`rcalc -e '$1=($3*.3+$4*.59+$5*.11)*'"$mult" $td/extrema | sed -e 2d -e 's/\(.....\).*$/\1/'` + set minval=`rcalc -e '$1=($3*.27+$4*.67+$5*.06)*'"$mult" $td/extrema | sed -e 2d -e 's/\(\.[0-9][0-9][0-9]\)[0-9]*/\1/'` set maxpos=`sed 1d $td/extrema | rcalc -e '$2=$2;$1=$1+'"$legwidth"` - set maxval=`rcalc -e '$1=($3*.3+$4*.59+$5*.11)*'"$mult" $td/extrema | sed -e 1d -e 's/\(.....\).*$/\1/'` + set maxval=`rcalc -e '$1=($3*.27+$4*.67+$5*.06)*'"$mult" $td/extrema | sed -e 1d -e 's/\(\.[0-9][0-9][0-9]\)[0-9]*/\1/'` psign -s -.15 -a 2 -h 16 $minval > $td/minv.pic psign -s -.15 -a 2 -h 16 $maxval > $td/maxv.pic pcomb $pc0args $pc1args $picture $cpict \ - | pcompos $td/scol.pic 0 0 -t .2 $td/slab.pic 0 20 \ + | pcompos $td/scol.pic 0 0 -t .2 $td/slab.pic 0 $loff \ - $legwidth 0 $td/minv.pic $minpos $td/maxv.pic $maxpos else pcomb $pc0args $pc1args $picture $cpict \ - | pcompos $td/scol.pic 0 0 -t .2 $td/slab.pic 0 20 - $legwidth 0 + | pcompos $td/scol.pic 0 0 -t .2 $td/slab.pic 0 $loff - $legwidth 0 endif quit: rm -rf $td