compress_image_data#

astropy.io.fits.hdu.compressed._tiled_compression.compress_image_data(image_data, compression_type, compressed_header, compressed_coldefs)[source]#

Compress the data in a CompImageHDU.

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

Parameters:
image_datandarray

The image data to compress

compression_typestr

The compression algorithm

compressed_headerHeader

The header of the compressed binary table

compressed_coldefsColDefs

The ColDefs object for the compressed binary table

Returns:
nbytesint

The number of bytes of the heap.

heapbytes

The bytes of the FITS table heap.