View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

creating NaN’s in a fits image

jkrick wrote on Jul 06, 2006

This may be strange, but I would like to make some of the pixels in some mosaic images have the value "NaN". I have tried imarith and imexpr, using either log of a negative number or dividing images by 0, but the tasks quit with errors and won't write NaN's.

any hints how to fool iraf?

thanks

Mike Fitzpatrick wrote on Jul 06, 2006

As far as I know there isn't a way for an IRAF task to write a NaN to the file: On input FITS NaNs are mapped to zero (or maybe INDEF) and while there is no mapping on output the generation of a NaN from a task would trigger an FPE.

If what you want in to flag certain pixels as bad values then setting the value to something clearly outside the data range is the usual course, otherwise there are a number of tasks for creating bad pixel masks that can be used with various tasks. If you could explain more about why you want to do this I might have other suggestions.

Cheers,
-Mike

Last post on Jul 06, 2006