[fitsbits] where should END keyword be placed?

William Pence pence at tetra.gsfc.nasa.gov
Mon Apr 24 14:52:05 EDT 2000


Michal Szymanski wrote:
> 
> The latest release of IRAF package (2.11.3) introduced (I'm not quite
> sure if it has not appeared earlier but surely was not so in 2.10.x)
> a change in the way the header of a FITS file is written. The END
> keyword is placed not directly after the last record of the header but
> in the last 80-bytes record of current 2880-bytes chunk. In other words,
> the "empty" space in the last 2880 bytes is filled up not after END
> record but before it.
> 
> This has broken some of my applications which add new keywords (in a
> sense that they start to add new 2880 bytes block although there is
> still space for new keywords). I had to change the code to check
> for "free" records before END record.
> 
> At first I thought this is a (new?) requirement of FITS standard but
> when I downloaded latest (v. 2.0.36) "cfitsio" library and made a simple
> test I found that the library routines place END record in a
> "traditional" way, right after last header record and fill it up to next
> 2880 bytes *after* END.
> 
> The question is: are both approaches standard-conformant?

Both approaches conform to the FITS Standard, but I think it is cleaner to
put the blanks after the END keyword, rather than putting the END keyword at
the end of the last 2880 block in the header. The CFITSIO library has always
treated any blank keywords just before the END keyword to be non-significant
'fill' space which gets overwritten if additional keywords are added to the
header.

Bill Pence
-- 
____________________________________________________________________
Dr. William Pence                          pence at tetra.gsfc.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