View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

photometry data pre-reduced by idl cannot be opned by iraf

Poon Helen wrote on Mar 16, 2010

I've got some data pre-reduced by IDL(flat, bias and dark) and now I need to perform photometry on them using IRAF. The pre-reduced data is still in fit format and can be open directly using ds9. But the problem is that it cannot be opened by IRAF. It says "cannot open pixel file xxx.fit".

Mike Fitzpatrick wrote on Mar 16, 2010

Please post a sample image to the anonftp at ftp://iraf.noao.edu/pub Otherwise it is impossible to guess what might be going on.

-Mike

Poon Helen wrote on Mar 16, 2010

Thank you so much, Mike. I 've already posted the two files there. Please see china_108.fits, which is the original data and china_108.fit, which is the pre-reduced data done by idl.

Mike Fitzpatrick wrote on Mar 16, 2010

I think the problem is due to the current FITS kernel implementation: The original image is of type 'ushort', a 16-bit pix with a BZERO=32768 to make all values positive. Following the IDL processing the image is of type real (BITPIX=-32) however the BSCALE/BZERO keywords haven't been removed.

DS9 is apparently properly applying the scale value (even though I doubt they still apply), however the FITS kernel doesn't fully implement this. On an Intel system the pixels are of order -2e-9 to 2e9, on a PPC or Sun system I see the same truncation error, but I think this is bogus. What's likely happening is there is some sort of floating-point error and the error recovery is overwriting the real error with something generic about not being able to read the pixels.

In any case, the workaround is to use HSELECT or HFIX to remove the BSCALE/BZERO keywords from the IDL-processed image (this is something that should also be done by the IDL program).

-Mike

Poon Helen wrote on Mar 16, 2010

Thank you so much, Mike. Actually I checked your other replies to a similar problem. http://iraf.net/phpBB2/viewtopic.php?p=1461901

And iraf can now open the pre-reduced data with BZERO/BSCALE removed using HEDIT.

Last post on Mar 16, 2010