Author Topic: False FITS Support error?  (Read 3420 times)

Offline Turing

  • Newcomer
  • Posts: 1
    • View Profile
False FITS Support error?
« on: 2006 May 09 03:16:53 »
When opening a bunch of FITS files I got this error pane:

"PCL Exception

FITS Support:
Unable to open FITS file"

The offending file was called:


But I discovered that removing the "[3.0,2.4]" substring from the file name, PixIn. opened the file flawlessly.

Conclusion: the trouble should be on the Windows naming conventions not in the FITS header file conformance.

Note: some other Image processing packages have no problems openning that file (like AIP4WIN_V2, MaxIM_4, and Mira Pro 7.6, who's the responsible for that sort of name).



Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7089
    • View Profile
False FITS Support error?
« Reply #1 on: 2006 May 17 01:26:18 »
Hello Pedro,

Nice to meet you here :)

Yes, this is a bug. Excellent catch!

I have identified and fixed this problem. As you probably know, the PixInsight/PCL framework relies on the CFITSIO library from NASA/HEASARC for FITS support. The main CFITSIO routine for opening a FITS file, namely:

Code: [Select]
int fits_open_file( fitsfile** fptr, char* filename, int iomode, int* status )

uses an extended file naming convention to add some functionality to the basic file opening task. In particular, if a file name contains something between brackets, e.g. "[FOO]", CFITSIO will open the file and move directly to a FITS extension whose name is "FOO". Obviously, there is no "[3.0,2.4]" FITS extension in the FITS file that you've used, and hence CFITSIO has failed to open it.

Fortunately, CFITSIO has an alternative:

Code: [Select]
int fits_open_diskfile( fitsfile** fptr, char* filename, int iomode, int* status )

that does not make use of the extended naming syntax. So the cure to this problem is simply replacing all occurrences of fits_open_file() with fits_open_diskfile().

Thank you for your bug hunt. This one will be fixed (along with another that I'll report on a separate message) in build 202, which I'll upload in a couple of days.

Juan Conejero
PixInsight Development Team