astropy 5.0

BackRef
update(self, *args, **kwargs)

update accepts either a dict-like object or an iterable. In the former case the keys must be header keywords and the values may be either scalar values or (value, comment) tuples. In the case of an iterable the items must be (keyword, value) tuples or (keyword, value, comment) tuples.

Arbitrary arguments are also accepted, in which case the update() is called again with the kwargs dict as its only argument. That is,

>>> header.update(NAXIS1=100, NAXIS2=100)

is equivalent to:

header.update({'NAXIS1': 100, 'NAXIS2': 100})
warning

As this method works similarly to :None:None:`dict.update` it is very different from the Header.update() method in Astropy v0.1. Use of the old API was deprecated for a long time and is now removed. Most uses of the old API can be replaced as follows:

See also :None:meth:`Header.set` which is a new method that provides an interface similar to the old Header.update() and may help make transition a little easier.

Update the Header with new keyword values, updating the values of existing keywords and appending new keywords otherwise; similar to :None:None:`dict.update`.

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.add_history astropy.io.fits.header.Header.update astropy.io.fits.header.Header.add_blank astropy.io.fits.header.Header.add_comment

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#1060
type: <class 'function'>
Commit: