Download latest PDF - Read the Docs
Transcript
PyFITS Documentation, Release 3.4.dev Parameters fileobj : file path, file object or file-like object Output header parameters file. clobber : bool When True, overwrite the output file if it exists. tofile(fileobj, sep=’‘, endcard=True, padding=True, clobber=False) Writes the header to file or file-like object. 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 : str, file, 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 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 clobber : bool, optional If True, overwrites the output file if it already exists tostring(sep=’‘, endcard=True, padding=True) Returns a string representation of the header. 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 s : string A string representing a FITS header. totextfile(fileobj, endcard=False, clobber=False) Equivalent to: >>> Header.tofile(fileobj, sep='\n', endcard=False, ... padding=False, clobber=clobber) 140 Chapter 1. Introduction