28 #ifndef LATTICES_LATTICEHISTOGRAMS_H
29 #define LATTICES_LATTICEHISTOGRAMS_H
33 #include <casacore/casa/aips.h>
34 #include <casacore/casa/Arrays/ArrayFwd.h>
35 #include <casacore/lattices/LatticeMath/TiledCollapser.h>
36 #include <casacore/lattices/LatticeMath/LatticeStatistics.h>
37 #include <casacore/lattices/LatticeMath/LatticeProgress.h>
38 #include <casacore/casa/Logging/LogIO.h>
39 #include <casacore/casa/System/PGPlotter.h>
40 #include <casacore/scimath/Mathematics/NumericTraits.h>
41 #include <casacore/casa/iosfwd.h>
46 template <
class T>
class MaskedLattice;
47 template <
class T>
class TempLattice;
509 #ifndef CASACORE_NO_AUTO_TEMPLATES
510 #include <casacore/lattices/LatticeMath/LatticeHistograms.tcc>
Generate histograms, tile by tile, from a masked lattice.
LatticeStatistics< T > * pStats_p
virtual void process(uInt accumIndex1, uInt accumIndex3, const T *inData, const Bool *inMask, uInt inDataIncr, uInt inMaskIncr, uInt nrval, const IPosition &startPos, const IPosition &shape)
Process the data in the current chunk.
virtual ~HistTiledCollapser()
virtual Bool canHandleNullMask() const
Can handle null mask.
HistTiledCollapser(LatticeStatistics< T > *pStats, uInt nBins)
Constructor.
virtual void init(uInt nOutPixelsPerCollapse)
Initialize process, making some checks.
virtual void initAccumulator(uInt64 n1, uInt64 n3)
Initialize the accumulator.
virtual void endAccumulator(Array< T > &result, Array< Bool > &resultMask, const IPosition &shape)
End the accumulation process and return the result arrays
Bool setNBins(const uInt &nBins)
Set the number of bins for the histogram.
LatticeStatistics< T > * pStats_p
Bool setInclude(Vector< T > &range, Bool &noInclude, const Vector< T > &include, ostream &os)
Check/set include pixel range.
void setStream(ostream &os, Int oPrec)
Set stream attributes.
Bool writeDispAxesValues(const String &coords, PGPlotter &plotter, Float nchar) const
Write values of display axes on plots.
Vector< Int > displayAxes() const
Return the display axes.
Bool needStorageLattice_p
Bool displayOneHistogram(const T &linearSum, const T &linearYMax, const IPosition &histPos, const Vector< T > &stats, const Vector< T > &values, const Vector< T > &counts, PGPlotter &plotter)
Display one histogram.
virtual String writeCoordinates(const IPosition &histPos) const
Make a string with pixel coordinates of display axes.
Bool displayHistograms()
Display histograms as a function of display axis.
Bool setAxes(const Vector< Int > &cursorAxes)
Set the cursor axes (0 relative).
Bool setStatsList(const Bool &doList)
This function allows you to control whether some statistics of the data that contributed to the histo...
Bool makeStatistics()
Create and fill statistics object.
Vector< Int > cursorAxes_p
void getStatistics(Vector< T > &stats, const IPosition &pos) const
Get the statistics from the statistics object for the current location of either the input lattice,...
void makeHistograms()
Fill histograms storage lattice.
virtual ~LatticeHistograms()
Destructor.
String errorMessage() const
Recover last error message.
LatticeHistograms(const MaskedLattice< T > &lattice, Bool showProgress=True, Bool forceDisk=False)
Constructor takes the MaskedLattice only.
LatticeHistograms(const MaskedLattice< T > &lattice, LogIO &os, Bool showProgress=True, Bool forceDisk=False)
Constructor takes the MaskedLattice and a LogIO object for logging.
void closePlotting()
CLose the plotter.
void resetError()
Reset argument error condition.
Bool setForm(const Bool &doLog, const Bool &doCumu)
Specify the form of the histogram.
Bool generateStorageLattice()
Iterate through the lattice and generate the histogram accumulation lattice.
Vector< Int > displayAxes_p
Bool setGaussian(const Bool &doGauss)
Specify that a Gaussian overlay should be plotted on the histogram.
Bool goodParameterStatus_p
NumericTraits< T >::PrecisionType AccumType
A useful typedef.
IPosition locHistInLattice(const IPosition &histPosition, Bool relativeToParent=True) const
Given a location in the histogram storage lattice, convert those locations on the non-histogram axis ...
static T convertF(const Float value)
Convert a Float (from plotting) to a T
void listStatistics(LogIO &os, const Vector< T > &stats, T binWidth)
List statistics.
LatticeHistograms< T > & operator=(const LatticeHistograms< T > &other)
Assignment operator (copy semantics)
Bool setNewLattice(const MaskedLattice< T > &lattice)
Set a MaskedLattice.
const MaskedLattice< T > * pInLattice_p
Bool getHistograms(Array< T > &values, Array< T > &counts)
This function retrieves the histograms into Array.
Bool display()
Display the histograms by plotting them.
LogIO os_p
These things are protected only so that they are available to ImageHistograms which inherits from Lat...
static Float convertT(const T value)
Convert a T to a Float for plotting.
Bool setPlotting(PGPlotter &plotter, const Vector< Int > &nxy)
This function sets the name of the PGPLOT plotting device and the number of subplots in x and y per p...
Bool setIncludeRange(const Vector< T > &include)
Specify a pixel intensity range for which all pixels in that range are included.
Bool getHistogram(Vector< T > &values, Vector< T > &counts, const IPosition &pos, const Bool posInLattice=False)
This function retrieves the histogram at the specified location into Vectors.
TempLattice< T > * pStoreLattice_p
void extractOneHistogram(T &linearSum, T &linearYMax, Vector< T > &values, Vector< T > &counts, const Vector< T > &stats, const Vector< T > &intCounts)
Fish out and convert to the appropriate form one histogram from the storage lattice.
Bool getHistograms(Array< T > &values, Array< T > &counts, Array< Vector< T > > &stats)
in this version, the set of stats for each histogram is also returned.
LatticeHistograms(const LatticeHistograms< T > &other)
Copy constructor (copy semantics)
Char PrecisionType
Higher precision type (Float->Double)
String: the storage and methods of handling collections of characters.
this file contains all the compiler specific defines
TableExprNode shape(const TableExprNode &array)
Function operating on any scalar or array resulting in a Double array containing the shape.
bool Bool
Define the standard types used by Casacore.
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
LatticeExprNode real(const LatticeExprNode &expr)
unsigned long long uInt64