{ } Raw JSON

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

function

astropy.io.fits.header:Header.tostring

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

Signature

def   tostring ( self sep = '' endcard = True padding = True )

Summary

Returns a string representation of the header.

Extended Summary

By default this uses no separator between cards, adds the END card, and pads the string with spaces to the next multiple of 2880 bytes. That is, it returns the header exactly as it would appear in a FITS file.

Parameters

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 True (default) adds the END card to the end of the header string

padding : bool, optional

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

Returns

: str

A string representing a FITS header.

Aliases

  • astropy.io.fits.Header.tostring