{ } Raw JSON

bundles / astropy 7.0.1 / astropy / io / fits / hdu / base / _BaseHDU / fromstring

classmethod

astropy.io.fits.hdu.base:_BaseHDU.fromstring

source: /astropy/io/fits/hdu/base.py :296

Summary

Creates a new HDU object of the appropriate type from a string containing the HDU's entire header and, optionally, its data.

Extended Summary

Note: When creating a new HDU from a string without a backing file object, the data of that HDU may be read-only. It depends on whether the underlying string was an immutable Python str/bytes object, or some kind of read-write memory buffer such as a memoryview.

Parameters

data : str, bytes, memoryview, ndarray

A byte string containing the HDU's header and data.

checksum : bool, optional

Check the HDU's checksum and/or datasum.

ignore_missing_end : bool, optional

Ignore a missing end card in the header data. Note that without the end card the end of the header may be ambiguous and resulted in a corrupt HDU. In this case the assumption is that the first 2880 block that does not begin with valid FITS header data is the beginning of the data.

**kwargs : optional

May consist of additional keyword arguments specific to an HDU type--these correspond to keywords recognized by the constructors of different HDU classes such as PrimaryHDU, ImageHDU, or BinTableHDU. Any unrecognized keyword arguments are simply ignored.

Aliases

  • astropy.io.fits.convenience._BaseHDU.fromstring