[fitsbits] Bintable proposals

Clive Page cgp at star.le.ac.uk
Fri Nov 16 05:20:30 EST 2001


I sympathise with Mark and agree with him that it would be nice if FITS
did not require NAXIS2 to be fixed in advance of writing a binary
extension.   But I think I see another problem with his proposal:

On Fri, 16 Nov 2001, Mark Calabretta wrote:

> This raises another question: what should a general bintable reader do if
> it encounters an EOF before reading the number of rows specified by NAXIS2?
> Hopefully not crash!  So should it adjust its own value of the number of
> rows to reflect what it found (if it matters)?  If so, could we instead set
> NAXIS2 to some huge value and rely on the EOF?

The problem is that a FITS reader gets data in block of 2880 bytes and any
FITS file with an incomplete final block would surely crash a lot of FITS
readers.  So I assume the proposal is to have a final block which has the
standard length, but is incompletely filled with rows.  If you find an
unexpected EOF, therefore, how do you know how many rows there were?  The
last row might be anywhere in the final 2880-byte block (assuming the
row-length is less than 2880 bytes, it need not be of course).  One cannot
rely on the file beyond the last row being padded with zeros (or some
other pre-defined bit-pattern), because in general in a binary table (or
image) any bit-pattern might be legal.   Or have I missed something?


-- 
Clive Page,
Dept of Physics & Astronomy,
University of Leicester,    Tel +44 116 252 3551
Leicester, LE1 7RH,  U.K.   Fax +44 116 252 3311




More information about the fitsbits mailing list