Skip to main content
`Ctrl`+`K`

# Quantize

class astropy.io.fits.hdu.compressed._quantization.Quantize(*, row, dither_method, quantize_level, bitpix)

  Bases: `object`

  Quantization of floating-point data following the FITS standard.

  Methods Summary

  `decode_quantized`(buf, scale, zero) | Unquantize data.
  `encode_quantized`(buf) | Quantize data.

  Methods Documentation

  decode_quantized(buf, scale, zero)

    Unquantize data.

    Parameters:
      buf `bytes` or numpy:array_like

        The buffer to unquantize.

    Returns:
      `np.ndarray`

        The unquantized buffer.

  encode_quantized(buf)

    Quantize data.

    Parameters:
      buf `bytes` or numpy:array_like

        The buffer to quantize.

    Returns:
      `np.ndarray`

        A buffer with quantized data.