Flexible Image Transport System (FITS)
FITS is a scientific data format that stores images and other data in header/data units with metadata describing their representation.
A FITS file is a sequence of 2880-byte blocks, or 23,040 bits each. Every header block holds 36 keyword records of 80 characters, and a header is followed by optional data blocks. Arrays may have from 1 to 999 dimensions. [5]
Stored array values map to physical values as BZERO + BSCALE × array value. Unsigned 16-bit integers are stored as signed values with BZERO = 32768 and BSCALE = 1, so preserving the data bytes alone does not preserve their meaning if the header changes. [5]
Under the checksum convention, the CHECKSUM keyword is a 16-character string chosen so that the 32-bit ones' complement sum over all 2880-byte records of the unit equals negative zero. Each record is summed as 720 32-bit integers, and DATASUM holds the checksum of the data records alone. Reordering 32-bit words leaves the sum unchanged. [6]
An archive migration must preserve interpreted values and missing-value locations, not just readable structure. Hesela's version-pinned Astropy 8.0.2 write-back experiment includes successful outputs whose exact values change while embedded checksums pass. An independent CFITSIO 4.7.0 read agrees with the exact byte oracle; requesting doubles can still conceal an integer change. Compare an immutable source contract using exact-enough values and a separate null mask. [7] [8]
Relations
Advantages
- Self-describing ASCII headers let a reader interpret the data without separate schema files. [5]
Limitations
- The checksum keywords are an optional convention, so a readable file need not carry them. [1, 6]
- An additive checksum detects many accidental changes but not every rearrangement, so it is not a cryptographic integrity check. [6]
Citations
- NASA FITS registry: Checksum Keyword Convention
- IAU FITS Working Group. Definition of the Flexible Image Transport System (FITS), version 4.0.
- Seaman, Pence and Rots. FITS Checksum Proposal, registered Checksum Keyword Convention.
- Hesela: FITS write-back and independent-reader evidence, exact-value acceptance
- CFITSIO C user's guide: image output types and null arrays
Further reading
- Astropy: verification using the FITS checksum keyword convention
- Astropy: FITS image scaling with BSCALE and BZERO
- FITS archive checks: reordered pixels can preserve both checksums
Sources & caveats
- fits40 is the FITS Standard version 4.0 from the IAU FITS Working Group, read on 2026-10-22 in sections 3 and 4 and the BSCALE and BZERO keyword definitions.
- The 2880-byte block, 23,040 bits, 36 records of 80 characters, 1 to 999 axes and BZERO = 32768 figures come from fits40.
- checksum-doc is the registered Checksum Keyword Convention document, read in full on 2026-10-22.
- The 16-character, 32-bit, negative zero and 720-integer figures come from checksum-doc.
- convention is the registry page that links checksum-doc, re-read on 2026-10-22.
- The acceptance supplement tests Astropy 8.0.2 / NumPy 2.3.4 output with CFITSIO 4.7.0. It excludes the merged upstream BLANK fix, compressed HDUs, tables, non-unit input scales and physical-media reliability.