fits
What is a .fits file?
application/fits
FITS (.fits, Flexible Image Transport System) is the standard binary format in astronomy. It pairs human-readable 80-character header cards (in 2880-byte blocks) with binary image or table data, storing pixel arrays, coordinates, and instrument metadata. It has been the astronomical archive format for decades.
How to use a .fits file
Use an example .fits file to test FITS readers (astropy, CFITSIO, DS9), header-card parsing, and image or table extraction, or to verify block-alignment handling.
Download example .fits files
- FITS Image (.fits)A minimal but valid FITS image — a primary header of 80-character cards padded to a 2880-byte block, followed by a 16x16 unsigned-byte pixel gradient — for testing FITS readers and header-card parsers.
- FITS Image — BITPIX 8 Unsigned Bytes (.fits)The baseline rung of the BITPIX ladder: a 24x16 synthetic star field stored as unsigned bytes, the one integer width FITS holds without a BZERO shift. Every image in this family carries the same scene so a decoder can be scored across data types.
- FITS Image — BITPIX 16 with BZERO Unsigned Trick (.fits)FITS has no unsigned 16-bit type, so unsigned data is stored signed with BZERO = 32768 and recovered as BZERO + BSCALE * stored. Every stored value in this image is negative, so a reader that ignores the scaling returns an entirely negative frame while parsing the file perfectly.
- FITS Image — float32 with NaN and Inf Pixels (.fits)Single-precision FITS pixels including two NaNs, which is the only way the standard marks undefined data for floating BITPIX, plus one +Inf. Statistics computed without NaN-aware reductions come back as NaN for the entire frame.
- FITS Image — float64 Double Precision (.fits)The top rung of the BITPIX ladder, carrying the identical synthetic scene as IEEE-754 doubles with DATAMIN and DATAMAX declared. It is the reference against which the 8-, 16- and 32-bit members of the family are scored for precision loss.
- FITS with World Coordinate System — Tangent Plane (.fits)A 32-bit integer image carrying a complete tangent-plane WCS: 1-based CRPIX reference pixels, a deliberately negative CDELT1 so right ascension runs the other way, and an ICRS frame. It targets the two mistakes every WCS implementation makes first, the 1-based origin and the flipped axis.
- FITS Multi-Extension — Empty Primary plus SCI and MASK (.fits)A three-HDU FITS file whose primary unit is header-only (NAXIS = 0) with the real data in named SCI and MASK extensions. A reader that only ever looks at HDU 0 reports an empty file, which is exactly the bug this fixture is built to catch.
- FITS BINTABLE — Typed Columns with TUNIT (.fits)A FITS binary table with four typed columns, big-endian numerics packed with no inter-field padding and TUNIT declaring milli-jansky on the two flux columns. It is the fixture for a table reader that has to build a row struct from TFORM codes rather than guess widths.
and 4 more in the library.