|
Dear IRAF,I have just spent two hours trying to locate a problem my colleague
had with imexpr, which when she used it gave output images which were
identically one.The problem was that she did: imexpr "(a > 20) ? 1 : O" foo.pl a=bar.fits
instead of : imexpr "(a > 20) ? 1 : 0" foo.pl a=bar.fitsi.e. using an upper case O instead of a zero! While one has to ask oneself
how she could make this typo, it would nevertheless have been a great help
if imexpr has given an error or warning message that operand o was undefined.Cheers, Bo
|
|
Hi Bo,Thanks for the very interesting quirk! My first inclination was to
agree that this is a bug. However, looking into it this looks like
a "feature". It is NOT treating the "O" as referring to the value
specified by the "o" parameter. In other words this is case
sensitive. Instead there is the feature that I, J, K, ... refer to
the coordinate of the particular axis. In this case it is the
coordinate for axis 7. In IRAF tasks it is allowed to refer to axes
beyond the dimension of the image and the value of that axis is then
1. In other words an image that is [512,512] is equivalently the
same as [512,512,1,1,1,1,1].So while it might be a good idea to protect against this I'm not sure
what the right change would be. So my inclination is to do nothing.
If you want to argue differently I would be glad to hear your view.Cheers,
Frank
On Sep 15, 2005, at 6:51 AM, Bo Milvang-Jensen wrote:> Dear IRAF,
>
> I have just spent two hours trying to locate a problem my colleague
> had with imexpr, which when she used it gave output images which were
> identically one.
>
> The problem was that she did: imexpr "(a > 20) ? 1 : O" foo.pl
> a=bar.fits
> instead of : imexpr "(a > 20) ? 1 : 0" foo.pl
> a=bar.fits
>
> i.e. using an upper case O instead of a zero! While one has to ask
> oneself
> how she could make this typo, it would nevertheless have been a
> great help
> if imexpr has given an error or warning message that operand o was
> undefined.
>
> Cheers, Bo
>
|