pcomb functions

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.

--
Randolph Fritz

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.

Cheers,
Thomas

···

On Tue, Apr 20, 2010 at 8:02 PM, R Fritz <[email protected]> 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.

BTW: I will release a Python version of falsecolor2 any day now, plus
a wx GUI frontend.

Well, then, would you like some help? Because I was just starting on one and there's no point in duplicating your efforts.

I've got a short writeup on command line argument processing, but it is rather technical, and I think I will put it up on the developer's list instead.

Meantime, Greg, how would you feel about adding:

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.

to the "falsecolor" man page? It would have helped me, anyway.

Randolph