bundles / astropy latest / astropy / io / fits / convenience / update
function
astropy.io.fits.convenience:update
source: /astropy/io/fits/convenience.py :745
Signature
def update ( filename , data , * args , ** kwargs ) Summary
Update the specified HDU with the input data/header.
Parameters
filename: path-like or file-likeFile to update. If opened, mode must be update (rb+). An opened file object or GzipFile object will be closed upon return.
data: array, `~astropy.table.Table`, or `~astropy.io.fits.Group`The new data used for updating.
header: `Header` object, optionalThe header associated with
data. IfNone, an appropriate header will be created for the data object supplied.ext, extname, extverThe rest of the arguments are flexible: the 3rd argument can be the header associated with the data. If the 3rd argument is not a Header, it (and other positional arguments) are assumed to be the HDU specification(s). Header and HDU specs can also be keyword arguments. For example
update(file, dat, hdr, 'sci') # update the 'sci' extension update(file, dat, 3) # update the 3rd extension HDU update(file, dat, hdr, 3) # update the 3rd extension HDU update(file, dat, 'sci', 2) # update the 2nd extension HDU named 'sci' update(file, dat, 3, header=hdr) # update the 3rd extension HDU update(file, dat, header=hdr, ext=5) # update the 5th extension HDU
**kwargsAny additional keyword arguments to be passed to astropy.io.fits.open.
Aliases
-
astropy.io.fits.update