astropy 5.0

NotesBackRef

The header may be indexed by keyword and, like a dict, the associated value will be returned. When the header contains cards with duplicate keywords, only the value of the first card with the given keyword will be returned. It is also possible to use a 2-tuple as the index in the form (keyword, n)--this returns the n-th value with that keyword, in the case where there are duplicate keywords.

For example:

>>> header['NAXIS']
0
>>> header[('FOO', 1)]  # Return the value of the second FOO keyword
'foo'

The header may also be indexed by card number:

>>> header[0]  # Return the value of the first card in the header
'T'

Commentary keywords such as HISTORY and COMMENT are special cases: When indexing the Header object with either 'HISTORY' or 'COMMENT' a list of all the HISTORY/COMMENT values is returned:

>>> header['HISTORY']
This is the first history entry in this header.
This is the second history entry in this header.
...

See the Astropy documentation for more details on working with headers.

Notes

Although FITS keywords must be exclusively upper case, retrieving an item in a Header object is case insensitive.

FITS header class. This class exposes both a dict-like interface and a list-like interface to FITS headers.

Examples

See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

astropy.io.fits.header.Header.keys astropy.io.fits.convenience.update astropy.io.fits.diff._BaseDiff.__init__ astropy.io.fits.header.Header.__init__ astropy.io.fits.hdu.compressed.CompImageHeader astropy.io.fits.header.Header astropy.io.fits.diff.HeaderDiff

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /astropy/io/fits/header.py#43
type: <class 'type'>
Commit: