bundles / astropy 7.0.1 / astropy / io / fits / hdu / hdulist / HDUList / fromstring
classmethod
astropy.io.fits.hdu.hdulist:HDUList.fromstring
source: /astropy/io/fits/hdu/hdulist.py :499
Summary
Creates an HDUList instance from a string or other in-memory data buffer containing an entire FITS file. Similar to HDUList.fromfile, but does not accept the mode or memmap arguments, as they are only relevant to reading from a file on disk.
Extended Summary
This is useful for interfacing with other libraries such as CFITSIO, and may also be useful for streaming applications.
Parameters
data: str, buffer-like, etc.A string or other memory buffer containing an entire FITS file. Buffer-like objects include
~bytes,~bytearray,~memoryview, and ndarray. It should be noted that if that memory is read-only (such as a Python string) the returned HDUList's data portions will also be read-only.**kwargs: dictOptional keyword arguments. See astropy.io.fits.open for details.
Returns
hdul: HDUListAn HDUList object representing the in-memory FITS file.
Aliases
-
astropy.io.fits.HDUList.fromstring