bundles / astropy 7.0.1 / astropy / io / fits / header / Header / fromfile
classmethod
astropy.io.fits.header:Header.fromfile
source: /astropy/io/fits/header.py :467
Summary
Similar to Header.fromstring, but reads the header string from a given file-like object or filename.
Parameters
fileobj: str, file-likeA filename or an open file-like object from which a FITS header is to be read. For open file handles the file pointer must be at the beginning of the header.
sep: str, optionalThe string separating cards from each other, such as a newline. By default there is no card separator (as is the case in a raw FITS file).
endcard: bool, optionalIf True (the default) the header must end with an END card in order to be considered valid. If an END card is not found an
OSErroris raised.padding: bool, optionalIf True (the default) the header will be required to be padded out to a multiple of 2880, the FITS header block size. Otherwise any padding, or lack thereof, is ignored.
Returns
: `Header`A new Header instance.
Aliases
-
astropy.io.fits.Header.fromfile