|
| StatsTiledCollapser (const Vector< T > &pixelRange, Bool noInclude, Bool noExclude, Bool fixedMinMax) |
| Constructor provides pixel selection range and whether that range is an inclusion or exclusion range. More...
|
|
virtual | ~StatsTiledCollapser () |
|
virtual void | init (uInt nOutPixelsPerCollapse) |
| Initialize process, making some checks. More...
|
|
virtual void | initAccumulator (uInt64 n1, uInt64 n3) |
| Initialiaze the accumulator. More...
|
|
virtual void | process (uInt accumIndex1, uInt accumIndex3, const T *inData, const Bool *inMask, uInt dataIncr, uInt maskIncr, uInt nrval, const IPosition &startPos, const IPosition &shape) |
| Process the data in the current chunk. More...
|
|
virtual void | endAccumulator (Array< U > &result, Array< Bool > &resultMask, const IPosition &shape) |
| End the accumulation process and return the result arrays. More...
|
|
virtual Bool | canHandleNullMask () const |
| Can handle null mask. More...
|
|
void | minMaxPos (IPosition &minPos, IPosition &maxPos) |
| Find the location of the minimum and maximum data values in the input lattice. More...
|
|
virtual | ~TiledCollapser () |
| Destructor. More...
|
|
virtual void | endAccumulator (Array< T > &result, Array< Bool > &resultMask, const IPosition &shape)=0 |
| End the accumulator. More...
|
|
template<class T, class U = T>
class casacore::StatsTiledCollapser< T, U >
Generate statistics, tile by tile, from a masked lattice NOTE this version was moved from LatticeStatistics (early Dec 2014 version) and slightly modified mostly for style issues (no significant semantic differences from that version). For a large number of statistics sets that need to be computed simultaneously, this version is more efficient than using the new stats framework, because creating large numbers of eg ClassicalStatistics objects is much less efficient than the direct manipulation of pointers to primitive types that this class does.
Intended use:
Public interface
Review Status
- Date Reviewed:
- yyyy/mm/dd
Prerequisite
Etymology
This class is used by LatticeStatistics
to generate statistical sum from an input MaskedLattice
. The input lattice is iterated through in tile-sized chunks and fed to an object of this class.
Synopsis
StatsTiledCollapser
is derived from TiledCollapser
which is a base class used to define methods. Objects of this base class are used by LatticeApply
functions. In this particular case, we are interested in LatticeApply::tiledApply
. This function iterates through a MaskedLattice
and allows you to collapse one or more axes, computing some values from it, and placing those values into an output MaskedLattice
. It iterates through the input lattice in optimal tile-sized chunks. LatticeStatistics
uses a StatsTiledCollapser
object which it gives to LatticeApply::tiledApply
for digestion. After it has done its work, LatticeStatistics
then accesses the output Lattice
that it made.
Example
StatsTiledCollapser<T> collapser(range_p, noInclude_p, noExclude_p,
fixedMinMax_p, blcParent_p);
Int newOutAxis = outLattice.ndim()-1;
collapser, collapseAxes,
newOutAxis);
static void tiledApply(MaskedLattice< U > &latticeOut, const MaskedLattice< T > &latticeIn, TiledCollapser< T, U > &collapser, const IPosition &collapseAxes, Int newOutAxis=-1, LatticeProgress *tellProgress=0)
This function iterates tile by tile through an input lattice and applies a user supplied function obj...
In this example, a collapser is made and passed to LatticeApply. Afterwards, the output Lattice is available for use. The Lattices must all be the correct shapes on input to tiledApply
Motivation
The LatticeApply classes enable the ugly details of optimal Lattice iteration to be hidden from the user.
To Do
Definition at line 113 of file StatsTiledCollapser.h.