{ } Raw JSON

bundles / astropy latest / astropy / io / fits / header / Header / update

function

astropy.io.fits.header:Header.update

source: /astropy/io/fits/header.py :1020

Signature

def   update ( self * args ** kwargs )

Summary

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

Extended Summary

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})

Aliases

  • astropy.io.fits.Header.update