compress_hdu

astropy.io.fits._tiled_compression.compress_hdu(hdu)[source]

Compress the data in a CompImageHDU.

The input HDU is expected to have a uncompressed numpy array as it’s .data attribute.

Parameters:
hduastropy.io.fits.CompImageHDU

Input HDU to compress the data for.

Returns:
nbytesint

The number of bytes of the heap.

heapbytes

The bytes of the FITS table heap.