Skip to main content
`Ctrl`+`K`

# PLIO1

class astropy.io.fits.hdu.compressed._codecs.PLIO1(*, tilesize)

  Bases: `Codec`

  The FITS PLIO1 compression and decompression algorithm.

  The IRAF PLIO (pixel list) algorithm was developed to store integer-valued image masks in a compressed form. Such masks often have large regions of constant value hence are highly compressible. The compression algorithm used is based on run-length encoding, with the ability to dynamically follow level changes in the image, allowing a 16-bit encoding to be used regardless of the image depth.

  Attributes Summary

  `codec_id` |

  Methods Summary

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

  Attributes Documentation

  codec_id = 'FITS_PLIO1'

  Methods Documentation

  decode(buf)

    Decompress buffer using the PLIO_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 PLIO_1 algorithm.

    Parameters:
      buf `bytes` or numpy:array_like

        The buffer to compress.

    Returns:
      `bytes`

        The compressed bytes.