astropy 5.0

ParametersBackRef
tofile(self, fileobj, sep='', endcard=True, padding=True, overwrite=False)

By default this writes the header exactly as it would be written to a FITS file, with the END card included and padding to the next multiple of 2880 bytes. However, aspects of this may be controlled.

Parameters

fileobj : path-like or file-like, optional

Either the pathname of a file, or an open file handle or file-like object.

sep : str, optional

The character or string with which to separate cards. By default there is no separator, but one could use '\\n' , for example, to separate each card with a new line

endcard : bool, optional

If :None:None:`True` (default) adds the END card to the end of the header string

padding : bool, optional

If :None:None:`True` (default) pads the string with spaces out to the next multiple of 2880 characters

overwrite : bool, optional

If True , overwrite the output file if it exists. Raises an OSError if False and the output file exists. Default is False .

versionchanged

overwrite replaces the deprecated clobber argument.

Writes the header to file or file-like object.

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.totextfile

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