View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

imexpr question

svensk wrote on Jul 08, 2010

IRAF newbie here.

I am trying to use imexpr to do some pixel replacements.

My function:

cl> imexpr "(a > 70000) ? 10*b : a" c

simply replaces an overexposed pixel from "a" with a properly exposed and scaled pixel from "b". This works as expected on a single image set, assuming they are named "a" and "b" but I'd like imexpr to do this to a list of files.

So I thought:

cl> imexpr "(a > 70000) ? 10*b : a" @final
operand a: @long
operand b: @short

but I get an error after the operand a prompt that says

ERROR: Cannot open image (@long)

Can operands not be lists? How should I be rethinking this? Any help is greatly appreciated.

Thanks!

Mike Fitzpatrick wrote on Jul 08, 2010

Right, operands must be single images or values. To work on lists you'll need to write a small script to process the list with repeated calls to imexpr, e.g.


cl> list = "myfile.txt"
cl> while (fscan (list, s1) != EOF) {
>>      imexpr ( ....., a=s1, .... )
>> }

svensk wrote on Jul 08, 2010

fitz

Right, operands must be single images or values. To work on lists you'll need to write a small script to process the list with repeated calls to imexpr, e.g.


cl> list = "myfile.txt"
cl> while (fscan (list, s1) != EOF) {
>>      imexpr ( ....., a=s1, .... )
>> }


How should my long and short exposure list be delimited in the txt file?

Mike Fitzpatrick wrote on Jul 08, 2010

How should my long and short exposure list be delimited in the txt file?


As separate files? Like I said, IMEXPR does one image at a time, it doesn't know what you think is a 'long' vs a 'short' exposure so it all depends on how you write the loops.

Last post on Jul 08, 2010