Author Topic: New Bug Found/Fixed in PixInsight's FITS Support  (Read 6510 times)

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
New Bug Found/Fixed in PixInsight's FITS Support
« on: 2006 May 17 01:50:03 »
With the help of Thomas W. Earle, we have detected a problem with PixInsight/PCL integrated FITS format support. This problem affects both the freeware LE and Standard beta applications.

The problem consists in bad decoding of pixel sample values from unsigned 16-bit FITS files that don't use the standard BZERO=32768 convention.

Some software packages generate unsigned 16-bit FITS with BZERO=32767. This is questionable in our opinion, since the required offset to map the signed range [-32768,+32767] to the unsigned [0,65535] range is precisely +32768, not +32767. However, the FITS standard permits arbitrary BZERO and BSCALE header keyword values, so the problem is ours.

In particular, the LE application identifies such exotic files as 16-bit FITS, but pixel values are incorrectly read. The Standard beta application improperly identifies these files as 32-bit integer FITS, and pixel values are also incorrect.

This problem has been fixed in both the PixInsight Standard application 1.0.1.202 beta 1 and PCL 1.0.1.65 RC3, which will be released in a few days.

There is no planned bug fix for the PixInsight LE application. This is because the current LE version will be replaced with a freeware limited version derived from the Standard application.

A work around to open these FITS files in PixInsight LE is as follows:

    Rename the file from .fit to .bin

    Load it into a binary editor. For example, Microsoft Visual C++ .NET 2003 or 2005 can be used.

    Change the incorrect 32767 value to 32768. You'll find this value very easily at the beginning of the file. You just have to replace the ending 7 by an 8.

    Save the .bin file and rename it to .fit

    Load it in PixInsight LE, and all will be fine.


Regards
Juan Conejero
PixInsight Development Team
http://pixinsight.com/