[fitsbits] Is this legal FITS?

Thompson, William T. (GSFC-671.0)[ADNET SYSTEMS INC] William.T.Thompson at nasa.gov
Mon Jul 24 15:22:56 EDT 2017


Folks:

I was handed a couple of FITS files that our IDL software was having 
trouble reading.  I was told that these FITS files were produced by 
DS9.  Looking inside the files, I find the following keywords:

SIMPLE  =                    T / Fits standard
BITPIX  =                  -32 / number of bits per data pixel
NAXIS   =                    2 / number of data axes
NAXIS1  =                  360 / length of data axis 1
NAXIS2  =                  180 / length of data axis 2
NAXIS3  =                    0 / length of data axis

Our software was choking on the NAXIS3 = 0 entry.  We tried several IDL 
routines written by different people over the years, but all of them had 
problems.  My question is, is it even legal to have an NAXIS3 keyword if 
NAXIS=2?  The documentation states:

> If NAXIS is equal to 0, there
> shall not be any NAXISn keywords.

To my mind, that infers that there should never be any NAXISn keywords 
for values of n greater than NAXIS.

Also, according to the documentation,

> A value of zero for any of
> the NAXISn signifies that no data follow the header in the HDU
> (however, the random groups structure described in Sect. 6 has
> NAXIS1 = 0, but will have data following the header if the other
> NAXISn keywords are non-zero).

However, these files did contain image data after the header.  One can 
argue that the NAXIS3 keyword is meaningless, but the fact that it shows 
up in the header with a value of 0 does make it potentially look like 
there shouldn't be a data part to the HDU.

I was able to render these files readable in our software by changing 
the value of NAXIS3 to 1 instead of 0.  I can modify at least one IDL 
reader to work with these files without modification, but I do have 
doubts about these files being properly formatted.

Bill Thompson

-- 
William Thompson
NASA Goddard Space Flight Center
Code 671
Greenbelt, MD  20771
USA

301-286-2040
William.T.Thompson at nasa.gov



More information about the fitsbits mailing list