Package pamMaths
Class PamLogHistogram
java.lang.Object
java.util.Observable
PamUtils.TimedObservable
pamMaths.PamHistogram
pamMaths.PamLogHistogram
- All Implemented Interfaces:
Cloneable
-
Constructor Summary
ConstructorDescriptionPamLogHistogram
(double minVal, double maxVal, int nBins) PamLogHistogram
(double minVal, double maxVal, int nBins, boolean binCentres) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addData
(double newData) Add a single point of data to the histogram but don't notify observersvoid
addData
(double newData, boolean notify) Add a single unit value to the histogram and optionally notify all observersvoid
addData
(double newData, double weight) Add weighted data to the histogramint
getBin
(double dataValue) Work out which bin a particular value will call into.double
getBinCentre
(int iBin) double[]
Get the centre value of every bindouble[]
Get an array of bin edges.double
Get the maximum range value of the histogramdouble
getMean()
Calculate the mean of the histogram datadouble
Get the minimum range value of the histogramdouble
Where to plot to if bin centres were specified.double
Where to plot from if bin centres were specified.Methods inherited from class pamMaths.PamHistogram
clear, getData, getHiBin, getKurtosis, getLoBin, getMaxContent, getMode, getName, getNBins, getSkew, getSTD, getStep, getTotalContent, getVariance, isBinCentres, printSummary, printSummary, scaleData, setBinCentres, setData, setName, setRange, toString
Methods inherited from class PamUtils.TimedObservable
getDelay, notifyObservers, notifyObservers, notifyObservers, setDelay
Methods inherited from class java.util.Observable
addObserver, countObservers, deleteObserver, deleteObservers, hasChanged
-
Constructor Details
-
PamLogHistogram
public PamLogHistogram(double minVal, double maxVal, int nBins) -
PamLogHistogram
public PamLogHistogram(double minVal, double maxVal, int nBins, boolean binCentres) - Parameters:
minVal
-maxVal
-nBins
-binCentres
-
-
-
Method Details
-
getBin
public int getBin(double dataValue) Description copied from class:PamHistogram
Work out which bin a particular value will call into. N.B. This may return invalid input: '<' 0 or >= getNBins() if the data fall outsied the range of the histogram- Overrides:
getBin
in classPamHistogram
- Returns:
- bin Bumber
-
getBinCentre
public double getBinCentre(int iBin) - Overrides:
getBinCentre
in classPamHistogram
-
addData
public void addData(double newData, boolean notify) Description copied from class:PamHistogram
Add a single unit value to the histogram and optionally notify all observers- Overrides:
addData
in classPamHistogram
- Parameters:
newData
- value of the new data
-
addData
public void addData(double newData) Description copied from class:PamHistogram
Add a single point of data to the histogram but don't notify observers- Overrides:
addData
in classPamHistogram
- Parameters:
newData
- new data point
-
addData
public void addData(double newData, double weight) Description copied from class:PamHistogram
Add weighted data to the histogram- Overrides:
addData
in classPamHistogram
- Parameters:
newData
- value of the dataweight
- weight to apply
-
getMean
public double getMean()Description copied from class:PamHistogram
Calculate the mean of the histogram data- Overrides:
getMean
in classPamHistogram
- Returns:
- mean value
-
getMaxVal
public double getMaxVal()Description copied from class:PamHistogram
Get the maximum range value of the histogram- Overrides:
getMaxVal
in classPamHistogram
- Returns:
- max value
-
getMinVal
public double getMinVal()Description copied from class:PamHistogram
Get the minimum range value of the histogram- Overrides:
getMinVal
in classPamHistogram
- Returns:
- min value
-
getScaleMinVal
public double getScaleMinVal()Description copied from class:PamHistogram
Where to plot from if bin centres were specified.- Overrides:
getScaleMinVal
in classPamHistogram
- Returns:
- minimum value for plot axis
-
getScaleMaxVal
public double getScaleMaxVal()Description copied from class:PamHistogram
Where to plot to if bin centres were specified.- Overrides:
getScaleMaxVal
in classPamHistogram
- Returns:
- maximum value for plot axis
-
getBinCentreValues
public double[] getBinCentreValues()Description copied from class:PamHistogram
Get the centre value of every bin- Overrides:
getBinCentreValues
in classPamHistogram
- Returns:
- array of bin centres.
-
getBinEdgeValues
public double[] getBinEdgeValues()Description copied from class:PamHistogram
Get an array of bin edges. This will be one longer than the number of bins- Overrides:
getBinEdgeValues
in classPamHistogram
- Returns:
- array of bin edge values.
-