|
| | HistAcc (const uInt nBuff) |
| | Constructors and destructor. More...
|
| |
| | HistAcc (const uInt nBuff, const T width) |
| |
| | HistAcc (const T low, const T high, const T width) |
| |
| | HistAcc (const HistAcc &) |
| |
| | ~HistAcc () |
| |
| void | copy (const HistAcc &) |
| | Copy operations. More...
|
| |
| HistAcc & | operator= (const HistAcc &) |
| |
| void | put (const T v) |
| | Accumulate (put) value(s) into the histogram. More...
|
| |
| void | put (const Array< T > &vv) |
| |
| void | put (const Block< T > &vv) |
| |
| void | reset () |
| | Reset the contents of the bins to zero, but retain the current bin definition. More...
|
| |
| void | emptyBinsWithLessThan (const uInt nmin) |
| | Empty all bins whose contents is < nmin (e.g. More...
|
| |
| Fallible< T > | getPercentile (const Float p) |
| | The median is the 50-percentile (getPercentile(50)), i.e. More...
|
| |
| Fallible< T > | getMedian () |
| |
| Fallible< T > | getBinWidth () const |
| | All bins have the same width. More...
|
| |
| const StatAcc< T > & | getStatistics () |
| | Get the internal Statistics accumulator (see StatAcc,h). More...
|
| |
| Fallible< uInt > | getHistogram (Block< uInt > &bins, Block< T > &values) |
| | The return value is the nr of histogram bins, and is invalid if the number is zero. More...
|
| |
| uInt | getSpurious (uInt &tooSmall, uInt &tooLarge) |
| | Get the nr of ‘spurious’ values, i.e. More...
|
| |
| void | printHistogram (ostream &, const String &caption) |
| | Print histogram. More...
|
| |
template<class T>
class casacore::HistAcc< T >
Makes a histogram from input values.
Review Status
- Test programs:
- tHistAcc
Prerequisite
Etymology
HistAcc stands for ‘Histogram Accumulator’.
Template Type Argument Requirements (T)
-
The accepted input types are real, i.e. Int, uInt, Float, Double, but not Complex.
Synopsis
Makes a histogram from input values. The histogram bin parameters may be defined, or determined from the first n input values. The input values are fed to HistAcc via the member function ‘put’. They can be fed individually, or in the form of an Array.
The histogram ‘bins’ can be defined via the constructor in the form of loop variables: low bin, high bin, bin-width. It is also possible to let the bin parameters be determined automatically from the first n (e.g. n=50) input values. If the actual nr of input values is less than n when the histogram is interrogated in some way, the bin parameters will be determined from what is available.
Example
It is usually convenient to let the bins be defined automatically:
Matrix<T> vv(30,100);
vv =...
HistAcc<T> h(25);
h.put(vv);
h.printHistogram(cout,"vv");
Fallible<Double>
median = h1.getMedian();
LatticeExprNode median(const LatticeExprNode &expr)
In some cases the bin parameters are pre-defined:
Vector<T> vv(100,0);
vv =...
HistAcc<T> h(-10,20,3);
h.put(vv);
uInt n = h.getSpurious(l,h);
The internal statistics accumulator can be interrogated explicitly or implicitly:
StatAcc<T> s = h.getStatistics();
Fallible<Double>
mean = s.getMean();
Fallible<Double>
mean = h.getStatistics().getMean();
LatticeExprNode mean(const LatticeExprNode &expr)
Motivation
Definition at line 118 of file HistAcc.h.