java.lang.Object
nom.tam.fits.compression.algorithm.quant.Quantize

public class Quantize extends Object
Deprecated.
(for internal use) This class sohuld have visibility reduced to the package level
(for internal use) Determines the optimal quantization to use for floating-point data. It estimates the noise level in the data to determine qhat quantization should be use to lose no information above the noise level.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Quantize(QuantizeOption quantizeOption)
    Deprecated.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    computeMedianOfValuesEachRow(int nrows, int nrows2, double[] diffs2, double[] diffs3, double[] diffs5)
    Deprecated.
     
    protected int
    findNextValidPixelWithNullCheck(int nx, nom.tam.fits.compression.algorithm.quant.Quantize.DoubleArrayPointer rowpix, int ii)
    Deprecated.
     
    protected double
    Deprecated.
     
    protected double
    Deprecated.
     
    protected double
    Deprecated.
     
    protected boolean
    isNull(double d)
    Deprecated.
     
    boolean
    quantize(double[] fdata, int nxpix, int nypix)
    Deprecated.
    arguments: long row i: tile number = row number in the binary table double fdata[] i: tiledImageOperation of image pixels to be compressed long nxpix i: number of pixels in each row of fdata long nypix i: number of rows in fdata nullcheck i: check for nullvalues in fdata? double in_null_value i: value used to represent undefined pixels in fdata float qlevel i: quantization level int dither_method i; which dithering method to use int idata[] o: values of fdata after applying bzero and bscale double bscale o: scale factor double bzero o: zero offset int iminval o: minimum quantized value that is returned int imaxval o: maximum quantized value that is returned The function value will be one if the input fdata were copied to idata; in this case the parameters bscale and bzero can be used to convert back to nearly the original floating point values: fdata ~= idata * bscale + bzero.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Quantize

      public Quantize(QuantizeOption quantizeOption)
      Deprecated.
  • Method Details

    • computeMedianOfValuesEachRow

      protected void computeMedianOfValuesEachRow(int nrows, int nrows2, double[] diffs2, double[] diffs3, double[] diffs5)
      Deprecated.
    • findNextValidPixelWithNullCheck

      protected int findNextValidPixelWithNullCheck(int nx, nom.tam.fits.compression.algorithm.quant.Quantize.DoubleArrayPointer rowpix, int ii)
      Deprecated.
    • getNoise2

      protected double getNoise2()
      Deprecated.
    • getNoise3

      protected double getNoise3()
      Deprecated.
    • getNoise5

      protected double getNoise5()
      Deprecated.
    • isNull

      protected boolean isNull(double d)
      Deprecated.
    • quantize

      public boolean quantize(double[] fdata, int nxpix, int nypix)
      Deprecated.
      arguments: long row i: tile number = row number in the binary table double fdata[] i: tiledImageOperation of image pixels to be compressed long nxpix i: number of pixels in each row of fdata long nypix i: number of rows in fdata nullcheck i: check for nullvalues in fdata? double in_null_value i: value used to represent undefined pixels in fdata float qlevel i: quantization level int dither_method i; which dithering method to use int idata[] o: values of fdata after applying bzero and bscale double bscale o: scale factor double bzero o: zero offset int iminval o: minimum quantized value that is returned int imaxval o: maximum quantized value that is returned The function value will be one if the input fdata were copied to idata; in this case the parameters bscale and bzero can be used to convert back to nearly the original floating point values: fdata ~= idata * bscale + bzero. If the function value is zero, the data were not copied to idata.

      In earlier implementations of the compression code, we only used the noise3 value as the most reliable estimate of the background noise in an image. If it is not possible to compute a noise3 value, then this serves as a red flag to indicate that quantizing the image could cause a loss of significant information in the image.

      At some later date, we decided to take the more conservative approach of using the minimum of all three of the noise values (while still requiring that noise3 has a defined value) as the best estimate of the noise. Note that if an image contains pure Gaussian distributed noise, then noise2, noise3, and noise5 will have exactly the same value (within statistical measurement errors).

      Parameters:
      fdata - the data to quantinize
      nxpix - the image width
      nypix - the image hight
      Returns:
      true if the quantification was possible