{ } Raw JSON

bundles / astropy latest / astropy / io / fits / convenience / append

function

astropy.io.fits.convenience:append

source: /astropy/io/fits/convenience.py :669

Signature

def   append ( filename data header = None checksum = False verify = True ** kwargs )

Summary

Append the header/data to FITS file if filename exists, create if not.

Extended Summary

If only data is supplied, a minimal header is created.

Parameters

filename : path-like or file-like

File to write to. If opened, must be opened for update (rb+) unless it is a new file, then it must be opened for append (ab+). A file or GzipFile object opened for update will be closed after return.

data : array, :class:`~astropy.table.Table`, or `~astropy.io.fits.Group`

The new data used for appending.

header : `Header` object, optional

The header associated with data. If None, an appropriate header will be created for the data object supplied.

checksum : bool, optional

When True adds both DATASUM and CHECKSUM cards to the header of the HDU when written to the file.

verify : bool, optional

When True, the existing FITS file will be read in to verify it for correctness before appending. When False, content is simply appended to the end of the file. Setting verify to False can be much faster.

**kwargs

Additional arguments are passed to:

  • writeto if the file does not exist or is empty. In this case output_verify is the only possible argument.

  • open if verify is True or if filename is a file object.

  • Otherwise no additional arguments can be used.

Aliases

  • astropy.io.fits.append