--- ray/src/px/falsecolor.pl 2012/03/30 16:44:18 2.7 +++ ray/src/px/falsecolor.pl 2014/04/15 21:34:31 2.10 @@ -1,12 +1,12 @@ #!/usr/bin/perl -w -# RCSid $Id: falsecolor.pl,v 2.7 2012/03/30 16:44:18 greg Exp $ +# RCSid $Id: falsecolor.pl,v 2.10 2014/04/15 21:34:31 greg Exp $ use warnings; use strict; use File::Temp qw/ tempdir /; use POSIX qw/ floor /; -my @palettes = ('def', 'spec', 'pm3d', 'hot'); +my @palettes = ('def', 'spec', 'pm3d', 'hot', 'eco'); my $mult = 179.0; # Multiplier. Default W/sr/m2 -> cd/m2 my $label = 'cd/m2'; # Units shown in legend @@ -37,6 +37,8 @@ while ($#ARGV >= 0) { $legheight = shift; } elsif (m/-m/) { # Multiplier $mult = shift; + } elsif (m/-spec/) { + die("depricated option '-spec'. Please use '-pal spec' instead."); } elsif (m/-s/) { # Scale $scale = shift; if ($scale =~ m/[aA].*/) { @@ -150,6 +152,10 @@ hot_red(x) = clip(3*x) ^ gamma; hot_grn(x) = clip(3*x - 1) ^ gamma; hot_blu(x) = clip(3*x - 2) ^ gamma; +eco_red(x) = clip(2*x) ^ gamma; +eco_grn(x) = clip(2*(x-0.5)) ^ gamma; +eco_blu(x) = clip(2*(0.5-x)) ^ gamma; + interp_arr2(i,x,f):(i+1-x)*f(i)+(x-i)*f(i+1); interp_arr(x,f):if(x-1,if(f(0)-x,interp_arr2(floor(x),x,f),f(f(0))),f(1)); @@ -277,7 +283,9 @@ if (($legwidth > 20) && ($legheight > 40)) { $value =~ s/(\.[0-9]{3})[0-9]*/$1/; $text .= "\n$value"; } - system "psign -s -.15 -cf 1 1 1 -cb 0 0 0 -h $sheight $text > $slabpic"; + open PSIGN, "| psign -s -.15 -cf 1 1 1 -cb 0 0 0 -h $sheight > $slabpic"; + print PSIGN "$text\n"; + close PSIGN; # Legend: Create the background colours $cmd = qq[pcomb $pc0args]; @@ -309,7 +317,8 @@ system $cmd; my $loff1 = $loff - 1; # Command line without extrema -$cmd = qq[pcomb $pc0args $pc1args $picture $cpict]; +$cmd = qq[pcomb $pc0args $pc1args "$picture"]; +$cmd .= qq[ "$cpict"] if ($cpict); $cmd .= qq[ | pcompos $scolpic 0 0 +t .1 $slabinvpic 2 $loff1]; $cmd .= qq[ -t .5 $slabpic 0 $loff - $legwidth 0];