|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectvec_math.DoubleHistogram
public class DoubleHistogram
From a list of doubles we calculate the histogram.
| Field Summary | |
|---|---|
private double |
av
The average intensity as a double. |
private int[] |
counts
The histogram bins. |
static double |
DEFBINWIDTH
Default bin width multiplicator in sigma. |
private double |
max
The maximum intensity as a double. |
private double |
median
The median intensity. |
private double |
min
The minimum intensity as a float. |
private double |
mode
The mode intensity. |
private int |
pixel
The total number of pixel. |
| Constructor Summary | |
|---|---|
protected |
DoubleHistogram()
Empty constructor. |
protected |
DoubleHistogram(double _min,
double _max,
double _av,
double _med,
double _mode,
int sum,
int[] band)
Counstructs with all specified. |
protected |
DoubleHistogram(double _min,
double _max,
double _av,
int sum,
int[] band)
Constructs a specified count histogram. |
| Method Summary | |
|---|---|
static Histogram |
createHistogram(double[] val,
double width)
Creates a histogram from a double array, specifying a bin width. |
protected static Histogram |
createHistogram(double[] val,
double width,
double min,
double max)
Creates a histogram from known min and max values. |
static Histogram |
createHistogram(Statistic s)
|
static Histogram |
createHistogram(Statistic s,
double stdevbin)
We create a histogram from the given statistic, calculating the bin width from the standard deviation of the statistic times the bin factor. |
boolean |
equals(Object what)
To histograms are equal, if their data are equal. |
static int |
findMedianIndex(int[] counts,
double total)
Scans a histogram array and returns the index, where half of the counts are to the left and half of the counts are to the right. |
private static int |
findMedianIndex(int[] counts,
double total,
Vector1D frac)
Scans a histogram array and returns the index, where half of the counts are to the left and half of the counts are to the right. |
static int |
findModeIndex(int[] counts)
Scans a histogram array and returns the most abundand index. |
static double |
fractionMedianIndex(int[] counts,
double sum)
From the median index, which is the lowest index where at least 50% of the values lie to the left of it, we estimate a better fractional median index by splitting the median bin into fractions according to the population therein and return the fractional index such that truely 50% are to the left and right. |
double |
getAverage()
Returns the intensity average. |
int[] |
getBinCounts()
Returns the histogram itself. |
double |
getBinWidth()
Return the bin width of the histogram in intensity. |
double |
getMax()
Returns the intensity maximum. |
double |
getMedian()
Returns the intensity median. |
double |
getMin()
Returns the intensity minimum. |
double |
getMode()
Returns the intensity mode. |
int |
getTotal()
Return the total number of samples in this histogram. |
static double |
parabolicModeIndex(int[] counts)
From the mode index, we use the bin height to the left and right of it and calculate the parabolic mid-point from there, resulting in a more accurate mode position. |
protected void |
setAverage(double _av)
Allows acces for daughter classes. |
protected void |
setBinCounts(int[] _counts)
Allows acces for daughter classes. |
protected void |
setMax(double _max)
Allows acces for daughter classes. |
protected void |
setMedian(double _median)
Allows acces for daughter classes. |
protected void |
setMin(double _min)
Allows acces for daughter classes. |
protected void |
setMode(double _mode)
Allows acces for daughter classes. |
protected void |
setTotal(int totalCount)
Allows acces for daughter classes. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final double DEFBINWIDTH
private double min
private double max
private double av
private double median
private double mode
private int pixel
private int[] counts
| Constructor Detail |
|---|
protected DoubleHistogram()
protected DoubleHistogram(double _min,
double _max,
double _av,
int sum,
int[] band)
protected DoubleHistogram(double _min,
double _max,
double _av,
double _med,
double _mode,
int sum,
int[] band)
| Method Detail |
|---|
public static Histogram createHistogram(Statistic s)
public static Histogram createHistogram(Statistic s,
double stdevbin)
s - The data, packed in a statisticstdevbin - Bin width is stddev(s) time this value.
public static Histogram createHistogram(double[] val,
double width)
protected static Histogram createHistogram(double[] val,
double width,
double min,
double max)
public double getMin()
Histogram
getMin in interface Histogrampublic double getMax()
Histogram
getMax in interface Histogrampublic double getAverage()
Histogram
getAverage in interface Histogrampublic double getMedian()
Histogram
getMedian in interface Histogrampublic double getMode()
Histogram
getMode in interface Histogrampublic double getBinWidth()
Histogram
getBinWidth in interface Histogrampublic int getTotal()
Histogram
getTotal in interface Histogrampublic int[] getBinCounts()
Histogram
getBinCounts in interface Histogram
public static int findMedianIndex(int[] counts,
double total)
private static int findMedianIndex(int[] counts,
double total,
Vector1D frac)
public static int findModeIndex(int[] counts)
public static double parabolicModeIndex(int[] counts)
public static double fractionMedianIndex(int[] counts,
double sum)
public String toString()
toString in class Objectpublic boolean equals(Object what)
equals in class Objectprotected void setMin(double _min)
protected void setMax(double _max)
protected void setAverage(double _av)
protected void setMedian(double _median)
protected void setMode(double _mode)
protected void setTotal(int totalCount)
protected void setBinCounts(int[] _counts)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||