Skip to main content
`Ctrl`+`K`

# Gzip1

class astropy.io.fits.hdu.compressed._codecs.Gzip1

  Bases: `Codec`

  The FITS GZIP 1 compression and decompression algorithm.

  The Gzip algorithm is used in the free GNU software compression utility of the same name. It was created by J. L. Gailly and M. Adler, based on the DEFLATE algorithm (Deutsch 1996), which is a combination of LZ77 (Ziv & Lempel 1977) and Huffman coding.

  Attributes Summary

  `codec_id` |

  Methods Summary

  `decode`(buf) | Decompress buffer using the GZIP_1 algorithm.
  `encode`(buf) | Compress the data in the buffer using the GZIP_1 algorithm.

  Attributes Documentation

  codec_id = 'FITS_GZIP1'

  Methods Documentation

  decode(buf)

    Decompress buffer using the GZIP_1 algorithm.

    Parameters:
      buf `bytes` or numpy:array_like

        The buffer to decompress.

    Returns:
      buf `np.ndarray`

        The decompressed buffer.

  encode(buf)

    Compress the data in the buffer using the GZIP_1 algorithm.

    Parameters:
      buf _like

        The buffer to compress.

    Returns:
      `bytes`

        The compressed bytes.