View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

imexpr file name parsing problems

Doug Mink wrote on Feb 06, 2007

This is either a shell bug or an imexpr bug. When you give imexpr a command
such as the following:

im > imexpr "a-b" out.fits a.fits b.fits

it fails with the message

Error: bad image parameter reference b.fits

but

im > imexpr "a-b" out.fits ./a.fits ./b.fits

works just fine. From further testing, it looks like a.fits and b.fits are taken to be
references to files assigned to imexpr.a and imexpr.b if not preceded by "/" and
the self-reference crashes the program. Can this be fixed?

-Doug

Mike Fitzpatrick wrote on Feb 06, 2007

Hi Doug,

The confusion is because the task allows an expression parameter to be referenced as a keyword in an image, e.g. "a.itime" means the ITIME keyword from the image 'a'. The task is seeing your "a.fits" an looking for a FITS keyword of the image 'a'. In general, avoid simple single-char image names like this, but specifying the image without the extension will also work.

Can this be fixed?


Yes, rename your images 8-) Modifying the task to allow the keyword syntax and a special case of 26 filenames is a little more difficult.

Cheers,
-Mike

Doug Mink wrote on Feb 06, 2007

It's actually a bit more complicated than single character file names. Any file
with the format [a-z].nnnn.fits fails in the same way. We realize that this would
not be an easy problem to fix, so we're working around it, but it's not just single
character file names.

-Doug

Last post on Feb 06, 2007