Skip to content

Evidence methods guide

FITS Header and Array Metadata Review: Check HDUs Before Reading an Array

Review FITS header cards, HDU boundaries, BITPIX, NAXIS, axis lengths, padding, scaling metadata, and extension structure before interpreting pixels.

A FITS file is a sequence of Header Data Units, and each header describes the data that follows it. The mandatory cards establish the array type and shape, while optional cards can describe units, dates, coordinate systems, scaling, or history. Start with fixed card and block boundaries, then validate SIMPLE or XTENSION, BITPIX, NAXIS, NAXISn, END, and the following data span. This guide is format guidance, not an astronomy interpreter, calibration assessment, privacy decision, or permission claim.

Updated

On this page

Validate 80-character cards and 2880-byte HDU boundaries

Record a neutral file ID, digest, file offset, header block count, data block count, and the reader version. The HEASARC, (opens in a new tab) says headers consist of 80-character keyword records and that headers and data are padded to exact 2880-byte multiples. A parser that finds END but skips padding can begin the next HDU at the wrong offset.

The NASA FITS source record carries the verified Version 4.0 date 13 August 2018. The HEASARC overview uses 22 October 2026 as retrieval evidence because no publication date is asserted; that checked day is not a publication claim.

Validate 80-character cards and 2880-byte HDU boundaries (table)
Boundary evidenceRecordStop if
Card width80-character card spansCard boundaries depend on line wrapping
END cardPosition and trailing card bytesEND is missing or has a value field
Header paddingBlank cards to the block boundaryPadding is treated as a data card
Data spanExpected bytes from BITPIX and axesData reaches beyond the file
HDU startOffset and source sequenceReader skips an extension
HDU countObserved and parsed countA truncated tail is ignored

Keep a raw card snapshot and a normalized table. If a library repairs nonstandard spacing or accepts a truncated header, record the repair and do not present the normalized header as the source bytes.

Match BITPIX, NAXIS, and every axis length

The NASA Science Office of Standards and Technology, (opens in a new tab) requires the mandatory primary cards in order. Record SIMPLE or XTENSION, BITPIX, NAXIS, every NAXISn card in sequence, PCOUNT and GCOUNT where an extension requires them, and the computed raw data size. For an ordinary primary array or standard image extension, a zero-length axis means no data follows. Check GROUPS = T, NAXIS1 = 0, PCOUNT, GCOUNT, and the random-groups data rule before applying that shortcut.

Match BITPIX, NAXIS, and every axis length (table)
CardRecordInterpretation boundary
SIMPLE or XTENSIONHDU kind and conformance claimClaim is not independent validation
BITPIXSigned value and byte widthType is not calibration or unit
NAXISNumber of axesRank is not scientific meaning
NAXISnLength for each ordered axisShape is not coverage
GROUPSRandom-groups marker and scopeNAXIS1 = 0 is treated as no data without checking GROUPS
PCOUNT and GCOUNTExtension-specific countsDefaults are applied without record
ENDCard position and block paddingReader ends at a non-card boundary

Synthetic HDU ledger

Match BITPIX, NAXIS, and every axis length code example, JSON
{"hdu":"fixture-primary","header":{"simple":"fixture-boolean","bitpix":"fixture-type","naxis":"fixture-rank","naxisn":["fixture-axis-1","fixture-axis-2"],"end":"fixture-card"},"data":{"expected_bytes":"fixture-product-times-width","state":"not-read"}}

Keep optional metadata, scaling, and missing values explicit

Optional cards may describe units, dates, coordinate systems, scaling, blank values, comments, and history. Record keyword, value type, exact source text, normalized value, and whether it affects the data read. Do not treat a card named BUNIT, DATE, CRVAL, or BSCALE as proof that values have the intended physical meaning. A scaled display value is a derivative of stored pixels.

Keep optional metadata, scaling, and missing values explicit (table)
Metadata fieldRecordStop if
BSCALE and BZEROStored type and scaling formulaStored values are replaced in the report
BLANK or missing stateValue and scopeBlank becomes numeric zero
BUNITExact unit string and sourceUnit is inferred from keyword spelling
WCS cardsAxis and transform fieldsCoordinate system is assumed
DATE and historyRaw values and card positionsTime precision is normalized silently
COMMENT and HISTORYPresence and bounded summaryPrivate notes enter the packet

Reconcile extensions and array evidence

The FITS overview lists image, ASCII table, and binary table extensions. Inventory each HDU, extension name, version, schema cards, data size, and link to the previous or next unit. Compare declared shape and type with a bounded read or table schema, but keep sampled observations separate from the full array claim.

Reconcile extensions and array evidence (table)
ComparisonRecordHold when
Header to data sizeExpected and observed byte spansPadding or PCOUNT is unresolved
HDU sequencePrimary and extension orderAn extension is omitted from export
Axis metadataNames, units, and shapeAxis order changes in a reader
Array sampleSynthetic or bounded sample onlySample is presented as full coverage
Table columnsTTYPE, TFORM, and row widthRow size does not match data span
Round tripChanged cards and bytesWriter rewrites source metadata silently

Stop before interpreting pixels or tables

Stop conditions

  • Stop if card width, END, padding, HDU offset, or data span is inconsistent.
  • Stop if BITPIX, NAXIS, NAXISn, PCOUNT, or GCOUNT cannot be matched to the data unit, including the random-groups exception.
  • Stop if scaling, blank values, units, dates, or WCS cards are normalized without source text.
  • Stop if an extension is skipped, a table row width differs, or an array sample is treated as coverage.
  • Stop if a reader repairs the header and the original bytes are not retained.
  • Stop before opening real pixels when headers expose private locations, project names, or notes.

Pair this worksheet with the data provenance log for file and transform history and the data card template for collection context. A conforming header does not prove calibration, completeness, ownership, privacy clearance, or permission.

For a supported non-health collection, after the owner has authority to describe the scope and a controlled metadata packet, the qualified physical-data appraisal request path may be a preparation step. It does not read FITS arrays, interpret astronomy, assess calibration, create a quote, match a buyer, or grant a license.

Sources

  1. HEASARC: FITS Overview (opens in a new tab)
  2. NASA Science Office of Standards and Technology: Definition of the Flexible Image Transport System, FITS Standard (opens in a new tab)

Use the physical-data appraisal path after the FITS packet is organized.

It does not read FITS arrays, interpret astronomy, assess calibration, create a quote, match a buyer, or grant a license.