bundles / astropy 7.0.1 / astropy / io / fits / hdu / base / _BaseHDU / writeto
function
astropy.io.fits.hdu.base:_BaseHDU.writeto
source: /astropy/io/fits/hdu/base.py :369
Signature
def writeto ( self , name , output_verify = exception , overwrite = False , checksum = False ) Summary
Write the HDU to a new file. This is a convenience method to provide a user easier output interface if only one HDU needs to be written to a file.
Parameters
name: path-like or file-likeOutput FITS file. If the file object is already opened, it must be opened in a writeable mode.
output_verify: strOutput verification option. Must be one of
"fix","silentfix","ignore","warn", or"exception". May also be any combination of"fix"or"silentfix"with"+ignore","+warn", or"+exception"(e.g."fix+warn"). Seeastropy:verifyfor more info.overwrite: bool, optionalIf
True, overwrite the output file if it exists. Raises anOSErrorifFalseand the output file exists. Default isFalse.checksum: boolWhen
Trueadds bothDATASUMandCHECKSUMcards to the header of the HDU when written to the file.
Notes
gzip, zip and bzip2 compression algorithms are natively supported. Compression mode is determined from the filename extension ('.gz', '.zip' or '.bz2' respectively). It is also possible to pass a compressed file object, e.g. gzip.GzipFile.
Aliases
-
astropy.io.fits.convenience._BaseHDU.writeto