jfits
Class FitsHistogram

java.lang.Object
  extended by vec_math.DoubleHistogram
      extended by jview.CountHistogram
          extended by jfits.FitsHistogram
All Implemented Interfaces:
JHistogram, Histogram

public class FitsHistogram
extends CountHistogram

This class is based on the IVOA Fits package.

   Current Version
   ===============
   ID:            $Id: Histogram.java,v 1.12 2004/07/23 21:54:11 carliles Exp $
   Revision:      $Revision: 1.12 $
   Date/time:     $Date: 2004/07/23 21:54:11 $
   


Nested Class Summary
 
Nested classes/interfaces inherited from class jview.CountHistogram
CountHistogram.CountBounds
 
Nested classes/interfaces inherited from interface jview.JHistogram
JHistogram.Bounds
 
Field Summary
protected  double[] _cdf
           
protected  double _range
           
 
Fields inherited from class vec_math.DoubleHistogram
DEFBINWIDTH
 
Constructor Summary
FitsHistogram(double min, double max, int totalCount, int[] counts)
          We do not need average and median, thus ignore them.
FitsHistogram(nom.tam.fits.ImageHDU hdu)
           
 
Method Summary
protected static double[] calculateCdf(int[] counts, int totalCount)
           
 double estimateSigma()
           
 double getEqualized(double val)
          A histogram equalized value for val.
 double getEqualizedIndex(int val)
          A histogram equalized value for val.
 double getRange()
           
static String revision()
           
protected  void setRange(double range)
           
 String toString()
           
 
Methods inherited from class jview.CountHistogram
createHistogram, createHistogramFromBandArray, createHistogramFromByteData, createHistogramFromUShortData, getBounds, getModeBounds, getNonsaturatedBounds, getUpperBounds
 
Methods inherited from class vec_math.DoubleHistogram
createHistogram, createHistogram, createHistogram, createHistogram, equals, findMedianIndex, findModeIndex, fractionMedianIndex, getAverage, getBinCounts, getBinWidth, getMax, getMedian, getMin, getMode, getTotal, parabolicModeIndex, setAverage, setBinCounts, setMax, setMedian, setMin, setMode, setTotal
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface vec_math.Histogram
getAverage, getBinCounts, getBinWidth, getMax, getMedian, getMin, getMode, getTotal
 

Field Detail

_range

protected double _range

_cdf

protected double[] _cdf
Constructor Detail

FitsHistogram

public FitsHistogram(nom.tam.fits.ImageHDU hdu)

FitsHistogram

public FitsHistogram(double min,
                     double max,
                     int totalCount,
                     int[] counts)
We do not need average and median, thus ignore them.

Method Detail

toString

public String toString()
Overrides:
toString in class DoubleHistogram

getRange

public double getRange()

getEqualizedIndex

public double getEqualizedIndex(int val)
A histogram equalized value for val. val must be in the range [0, count.length] and is scaled to represent a double in the range from zero to one.

Returns:
A double in the range of 0-1

getEqualized

public double getEqualized(double val)
A histogram equalized value for val. val must be in the range min, max and is scaled to represent a double in the range from zero to one.

Returns:
A double in the range of 0-1

estimateSigma

public double estimateSigma()
Returns:
A reasonable guess at a good sigma value for the inverse hyperbolic sine scaling. The estimate is made by finding the mode value of the histogram, then moving to the next bin and returning the value (in the original data range with bZero and bScale applied) at the "bottom" of that bin. The current implementation is actually a mangled implementation which happens to produce better sigmas than the correct implementation. An explanation for this behavior is currently being investigated.

revision

public static String revision()
Returns:
CVS Revision number.

calculateCdf

protected static double[] calculateCdf(int[] counts,
                                       int totalCount)

setRange

protected void setRange(double range)