[fitsbits] Maximum number of extensions

William Pence pence at tetra.gsfc.nasa.gov
Tue May 20 16:23:54 EDT 2003


Clive Page wrote:
> 
> I really think the use of huge numbers of HDUs
> ought to be discouraged.  There is no index to them, so the only way a
> reading program has of finding a specific HDU is to scan the header lines
> of every preceding HDU.  Similarly the only way of finding the total
> number of HDUs in a FITS file is to move to the "next" HDU and find that,
> after a few thousand or whatever, it doesn't exist. 

I was also skeptical about using FITS files containing many HDUs, but in
fact the inefficiencies are not too bad.  Timing tests on a fairly new Linux
box using a FITS file containing 50000 HDUs showed that CFITSIO can scan the
headers of every HDU and move to the last HDU in that file in about 2
seconds (using about 1 second of CPU time). 

Bill Pence
-- 
____________________________________________________________________
Dr. William Pence                          William.D.Pence at nasa.gov
NASA/GSFC Code 662         HEASARC         +1-301-286-4599 (voice)     
Greenbelt MD 20771                         +1-301-286-1684 (fax)




More information about the fitsbits mailing list