casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
casacore::HistTiledCollapser< T > Class Template Reference

Generate histograms, tile by tile, from a masked lattice. More...

#include <LatticeHistograms.h>

Inheritance diagram for casacore::HistTiledCollapser< T >:
casacore::TiledCollapser< T, T >

Public Member Functions

 HistTiledCollapser (LatticeStatistics< T > *pStats, uInt nBins)
 Constructor. More...
 
virtual ~HistTiledCollapser ()
 
virtual void init (uInt nOutPixelsPerCollapse)
 Initialize process, making some checks. More...
 
virtual void initAccumulator (uInt64 n1, uInt64 n3)
 Initialize the accumulator. More...
 
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. More...
 
virtual void endAccumulator (Array< T > &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...
 
- Public Member Functions inherited from casacore::TiledCollapser< T, T >
virtual ~TiledCollapser ()
 Destructor. More...
 

Private Attributes

LatticeStatistics< T > * pStats_p
 
Block< T > * pHist_p
 
uInt nBins_p
 
uInt64 n1_p
 
uInt64 n3_p
 

Detailed Description

template<class T>
class casacore::HistTiledCollapser< T >

Generate histograms, tile by tile, from a masked lattice.

Intended use:

Public interface

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Etymology

This class is used by LatticeHistograms to generate histograms from an input MaskedLattice. The input lattice is iterated through in tile-sized chunks and fed to an object of this class.

Synopsis

HistTiledCollapser 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. LatticeHistograms uses a HistTiledCollapser object which it gives to LatticeApply::tiledApply for digestion. After it has done its work, LatticeHistograms then accesses the output Lattice that it made.

Example

// Created collapser. Control information is passed in via the constructor.
HistTiledCollapser<T> collapser(pStats, nBins_p);
// This is the first output axis getting collapsed values. In LatticeHistograms
// this is the first axis of the output lattice
Int newOutAxis = 0;
// tiledApply does the work by passing the collapser data in chunks
// and by writing the results into the output lattice
LatticeApply<T>::tiledApply(outLattice, inLattice,
collapser, collapseAxes,
newOutAxis);

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 461 of file LatticeHistograms.h.

Constructor & Destructor Documentation

template<class T >
casacore::HistTiledCollapser< T >::HistTiledCollapser ( LatticeStatistics< T > *  pStats,
uInt  nBins 
)

Constructor.

template<class T >
virtual casacore::HistTiledCollapser< T >::~HistTiledCollapser ( )
virtual

Member Function Documentation

template<class T >
virtual Bool casacore::HistTiledCollapser< T >::canHandleNullMask ( ) const
inlinevirtual

Can handle null mask.

Reimplemented from casacore::TiledCollapser< T, T >.

Definition at line 495 of file LatticeHistograms.h.

template<class T >
virtual void casacore::HistTiledCollapser< T >::endAccumulator ( Array< T > &  result,
Array< Bool > &  resultMask,
const IPosition shape 
)
virtual

End the accumulation process and return the result arrays.

Implements casacore::TiledCollapser< T, T >.

template<class T >
virtual void casacore::HistTiledCollapser< T >::init ( uInt  nOutPixelsPerCollapse)
virtual

Initialize process, making some checks.

Implements casacore::TiledCollapser< T, T >.

template<class T >
virtual void casacore::HistTiledCollapser< T >::initAccumulator ( uInt64  n1,
uInt64  n3 
)
virtual

Initialize the accumulator.

Implements casacore::TiledCollapser< T, T >.

template<class T >
virtual void casacore::HistTiledCollapser< T >::process ( uInt  accumIndex1,
uInt  accumIndex3,
const T *  inData,
const Bool inMask,
uInt  inDataIncr,
uInt  inMaskIncr,
uInt  nrval,
const IPosition startPos,
const IPosition shape 
)
virtual

Process the data in the current chunk.

Implements casacore::TiledCollapser< T, T >.

Member Data Documentation

template<class T >
uInt64 casacore::HistTiledCollapser< T >::n1_p
private

Definition at line 501 of file LatticeHistograms.h.

template<class T >
uInt64 casacore::HistTiledCollapser< T >::n3_p
private

Definition at line 502 of file LatticeHistograms.h.

template<class T >
uInt casacore::HistTiledCollapser< T >::nBins_p
private

Definition at line 500 of file LatticeHistograms.h.

template<class T >
Block<T>* casacore::HistTiledCollapser< T >::pHist_p
private

Definition at line 499 of file LatticeHistograms.h.

template<class T >
LatticeStatistics<T>* casacore::HistTiledCollapser< T >::pStats_p
private

Definition at line 495 of file LatticeHistograms.h.


The documentation for this class was generated from the following file: