--- ray/src/px/falsecolor.csh 1991/05/23 13:45:18 1.1 +++ ray/src/px/falsecolor.csh 1991/05/24 17:23:01 1.4 @@ -8,6 +8,7 @@ onintr quit set mult=470 set label=Nits set scale=1000 +set decades=0 set redv='2*v-1' set grnv='if(v-.5,2-2*v,2*v)' set bluv='1-2*v' @@ -28,6 +29,10 @@ while ($#argv > 0) shift argv set label="$argv[1]" breaksw + case -log: + shift argv + set decades=$argv[1] + breaksw case -r: shift argv set redv="$argv[1]" @@ -50,7 +55,7 @@ while ($#argv > 0) breaksw case -ip: case -pi: - shiftargv + shift argv set picture="$argv[1]" set cpict="$argv[1]" breaksw @@ -61,11 +66,11 @@ while ($#argv > 0) set docont=b breaksw case -n: - shiftargv + shift argv set ndivs="$argv[1]" - breadsw + breaksw default: - echo bad option "'$argv[1]'" + echo bad option "'$argv[1]'" >/dev/tty exit 1 endsw shift argv @@ -76,6 +81,8 @@ scale : $scale ; mult : $mult ; ndivs : $ndivs ; +norm : if(nfiles-.5, mult/scale/le(1), 0); + or(a,b) : if(a,a,b); EPS : 1e-7; neq(a,b) : if(a-b-EPS,1,b-a-EPS); @@ -83,15 +90,16 @@ btwn(a,b) : if(a-x,-1,b-x); frac(x) : x - floor(x); boundary(a,b) : neq(floor(ndivs*a),floor(ndivs*b)); -red=$redv; -grn=$grnv; -blu=$bluv; +map(x) = x; +red = $redv; +grn = $grnv; +blu = $bluv; -v = li(1)*(mult/scale); -vleft = li(1,-1,0)*(mult/scale); -vright = li(1,1,0)*(mult/scale); -vabove = li(1,0,1)*(mult/scale); -vbelow = li(1,0,-1)*(mult/scale); +v = map(li(1)*norm); +vleft = map(li(1,-1,0)*norm); +vright = map(li(1,1,0)*norm); +vabove = map(li(1,0,1)*norm); +vbelow = map(li(1,0,-1)*norm); isconta = or(boundary(vleft,vright),boundary(vabove,vbelow)); iscontb = if(btwn(0,v,1),btwn(.4,frac(ndivs*v),.6),0); @@ -105,7 +113,7 @@ ba = bi(nfiles); in = 1; _EOF_ -set pcargs=(-o -f $tempdir/pc.cal) +set pcargs=(-f $tempdir/pc.cal) if ($?docont) then set pcargs=($pcargs -e "in=iscont$docont") endif @@ -114,14 +122,22 @@ if ("$cpict" == "") then else if ("$cpict" == "$picture") then set cpict= endif +if ($decades > 0) then + set pcargs=($pcargs -e "map(x)=log10(x)/$decades+1") + set imap="imap(y)=10^((y-1)*$decades)" +else + set imap="imap(y)=y" +endif pcomb $pcargs -e 'v=(y+.5)/200;vleft=v;vright=v' \ -e 'vbelow=(y-.5)/200;vabove=(y+1.5)/200' \ -e 'ra=0;ga=0;ba=0' -x 100 -y 200 \ > $tempdir/scol.pic -(echo $label; cnt $ndivs |rcalc -e '$1='"($scale)/$ndivs*($ndivs"'-.5-$1)') \ - | psign -cf 1 1 1 -cb 0 0 0 -h `ev "floor(200/$ndivs+.5)"` \ - > $tempdir/slab.pic +( echo $label; cnt $ndivs \ + | rcalc -e '$1='"($scale)*imap(($ndivs-.5-"'$1'")/$ndivs)" \ + -e "$imap" ) \ + | psign -cf 1 1 1 -cb 0 0 0 -h `ev "floor(2*200/$ndivs+.5)"` \ + | pfilt -1 -x /2 -y /2 > $tempdir/slab.pic pcomb $pcargs $picture $cpict \ - | pcompos $tempdir/scol.pic 0 0 -t .5 $tempdir/slab.pic 25 0 - 100 0 + | pcompos $tempdir/scol.pic 0 0 -t .2 $tempdir/slab.pic 25 0 - 100 0 quit: rm -rf $tempdir