[Radiance-general] pcomb functions
Thomas Bleicher
tbleicher at googlemail.com
Tue Apr 20 12:19:10 PDT 2010
On Tue, Apr 20, 2010 at 8:02 PM, R Fritz <randolph+LD at panix.com> wrote:
> I've been working on a Python version of falsecolor, and I've found that I
> really don't understand pcomb. Is the following summary correct?
>>
>> The -e option reads a script from its argument and -f reads a script
>> from a file. -e and -f may be given multiple times and are processed in
>> the order they appear on the command line, The scripts are then used to
>> combine the images.
In general that is correct. The devil, as always, is in the detail.
So far I found out:
1) on Windows use double quotes (") to quote a -e expression
2) in Python don't quote at all but pass the expression as a single
argument to subprocess.Popen(). Example:
from subprocess import Popen, PIPE
args = ["pcomb", "-e",
"ro=if(ri(1),ri(1),ri(2));go=if(gi(1),gi(1),gi(2));bo=if(bi(1),bi(1),bi(2));",
"-", "img2.hdr"]
p = Popen(args, stdin=PIPE, stdout=PIPE, stderr=PIPE)
comb_data, err = p.communicate(img1_data)
3) if you use a file for the expression, add a newline at the end
BTW: I will release a Python version of falsecolor2 any day now, plus
a wx GUI frontend.
http://code.google.com/p/pyrat/source/browse/#svn/trunk/wxfalsecolor
Cheers,
Thomas
More information about the Radiance-general
mailing list