Loading...
Searching...
No Matches
casacore::MaskedLatticeStatsDataProvider< T > Class Template Reference

Data provider which allows stats framework to iterate through a masked lattice. More...

`#include <MaskedLatticeStatsDataProvider.h>`

## Public Member Functions

| MaskedLatticeStatsDataProvider ()
| default constructor.
| MaskedLatticeStatsDataProvider (MaskedLattice< T > &lattice, uInt iteratorLimitBytes=4096 *4096)
| iteratorLimitBytes is related to the size of the lattice.
| ~MaskedLatticeStatsDataProvider ()
void | operator++ ()
| increment the data provider to the next dataset, mask, range set, and weights.
uInt | estimatedSteps () const
| estimated number of steps to iterate through the the lattice
Bool | atEnd () const
| Are there any data sets left to provide?
void | finalize ()
| Take any actions necessary to finalize the provider.
uInt64 | getCount ()
| get the count of elements in the current data set.
const T * | getData ()
| get the current data set
const Bool * | getMask ()
| Get the associated mask of the current dataset.
uInt | getNMaxThreads () const
| returns something reasonable based on the lattice size.
Bool | hasMask () const
| Does the current data set have an associated mask?
void | reset ()
| reset the provider to point to the first data set it manages.
void | setLattice (const MaskedLattice< T > &lattice, uInt iteratorLimitBytes=4096 *4096)
| set the lattice.
void | updateMaxPos (const std::pair< Int64, Int64 > &maxpos)
| see base class documentation.
void | updateMinPos (const std::pair< Int64, Int64 > &minpos)
Public Member Functions inherited from casacore::LatticeStatsDataProviderBase< T >
virtual | ~LatticeStatsDataProviderBase ()
uInt | getMaskStride ()
| Get the stride for the current mask (only called if hasMask() returns True).
std::vector< std::pair< typename NumericTraits< T >::PrecisionType, typename NumericTraits< T >::PrecisionType > > | getRanges ()
| Get the associated range(s) of the current dataset.
uInt | getStride ()
| Get the stride for the current data set.
const T * | getWeights ()
| Returns NULL; lattices do not have associated weights.
Bool | hasRanges () const
| Does the current data set have associated range(s)?
Bool | hasWeights () const
| returns False; lattices do not have associated weights.
Bool | isInclude () const
| If the associated data set has ranges, are these include (return True) or exclude (return False) ranges?
void | minMaxPos (IPosition &minpos, IPosition &maxpos) const
| get the positions of the min and max
void | setProgressMeter (std::shared_ptr< LattStatsProgress > pm)
void | setRanges (const std::vector< std::pair< typename NumericTraits< T >::PrecisionType, typename NumericTraits< T >::PrecisionType > > &ranges, Bool isInclude)
| set the data ranges
Public Member Functions inherited from casacore::StatsDataProvider< NumericTraits< T >::PrecisionType, const T *, const Bool * >
virtual | ~StatsDataProvider ()
virtual void | updateMaxPos (const LocationType &)
| In general, unless you are writing statistics algorithm code, you shouldn't need to call these methods.
virtual void | updateMinPos (const LocationType &)

## Private Member Functions

void | _freeStorage ()

## Private Attributes

std::shared_ptr< RO_MaskedLatticeIterator< T > > | _iter
Array< T > | _currentSlice
Array< Bool > | _currentMaskSlice
const T * | _currentPtr
const Bool * | _currentMaskPtr
Bool | _delData
Bool | _delMask
Bool | _atEnd
uInt | _nMaxThreads

## Additional Inherited Members

Protected Member Functions inherited from casacore::LatticeStatsDataProviderBase< T >
| LatticeStatsDataProviderBase ()
void | _updateMaxPos (const IPosition &maxPos)
void | _updateMinPos (const IPosition &minPos)
void | _updateProgress ()
Protected Member Functions inherited from casacore::StatsDataProvider< NumericTraits< T >::PrecisionType, const T *, const Bool * >
| StatsDataProvider ()

## Detailed Description

template<class T>
class casacore::MaskedLatticeStatsDataProvider< T >

Data provider which allows stats framework to iterate through a masked lattice.

Definition at line 39 of file MaskedLatticeStatsDataProvider.h.

## Constructor & Destructor Documentation

## MaskedLatticeStatsDataProvider() [1/2]

template<class T>

casacore::MaskedLatticeStatsDataProvider< T >::MaskedLatticeStatsDataProvider | ( |  | ) |

default constructor.

Must set lattice after construction but before using the object

## MaskedLatticeStatsDataProvider() [2/2]

template<class T>

casacore::MaskedLatticeStatsDataProvider< T >::MaskedLatticeStatsDataProvider | ( | MaskedLattice< T > & | lattice,
|  | uInt | iteratorLimitBytes = 4096 *4096 )

iteratorLimitBytes is related to the size of the lattice.

If the lattice is greater than this size, then a lattice iterator will be used to step through the lattice. If less, then all the data in the values in the lattice are retrieved in a single chunk. The advantage of the iterator is that less memory is used. The disadvantage is there is a significant performace cost, so if the lattice is small, it is better to get all its values in a single chunk and forgo the iterator. This is particularly true when looping for a large number of iterations and creating a MaskedLatticeStatsDataProvider each loop (in that case, you probably will want to create a single object before the loop and use setLattice() to update its lattice).

## ~MaskedLatticeStatsDataProvider()

template<class T>

casacore::MaskedLatticeStatsDataProvider< T >::~MaskedLatticeStatsDataProvider | ( |  | ) |

## Member Function Documentation

## _freeStorage()

template<class T>

void casacore::MaskedLatticeStatsDataProvider< T >::_freeStorage | ( |  | ) |

private

## atEnd()

template<class T>

Bool casacore::MaskedLatticeStatsDataProvider< T >::atEnd | ( |  | ) | const

virtual

Are there any data sets left to provide?

Implements casacore::StatsDataProvider< NumericTraits< T >::PrecisionType, const T *, const Bool * >.

## estimatedSteps()

template<class T>

uInt casacore::MaskedLatticeStatsDataProvider< T >::estimatedSteps | ( |  | ) | const

virtual

estimated number of steps to iterate through the the lattice

Implements casacore::LatticeStatsDataProviderBase< T >.

## finalize()

template<class T>

void casacore::MaskedLatticeStatsDataProvider< T >::finalize | ( |  | ) |

virtual

Take any actions necessary to finalize the provider.

This will be called when atEnd() returns True.

Reimplemented from casacore::LatticeStatsDataProviderBase< T >.

## getCount()

template<class T>

uInt64 casacore::MaskedLatticeStatsDataProvider< T >::getCount | ( |  | ) |

virtual

get the count of elements in the current data set.

When implementing this method, be certain to take stride into account; ie for a data set with nominally 100 elements that is to have a stride of two, this method should return 50.

Implements casacore::StatsDataProvider< NumericTraits< T >::PrecisionType, const T *, const Bool * >.

## getData()

template<class T>

const T * casacore::MaskedLatticeStatsDataProvider< T >::getData | ( |  | ) |

virtual

get the current data set

Implements casacore::StatsDataProvider< NumericTraits< T >::PrecisionType, const T *, const Bool * >.

## getMask()

template<class T>

const Bool * casacore::MaskedLatticeStatsDataProvider< T >::getMask | ( |  | ) |

virtual

Get the associated mask of the current dataset.

Only called if hasMask() returns True;

Implements casacore::StatsDataProvider< NumericTraits< T >::PrecisionType, const T *, const Bool * >.

## getNMaxThreads()

template<class T>

uInt casacore::MaskedLatticeStatsDataProvider< T >::getNMaxThreads | ( |  | ) | const

virtual

returns something reasonable based on the lattice size.

Reimplemented from casacore::StatsDataProvider< NumericTraits< T >::PrecisionType, const T *, const Bool * >.

## hasMask()

template<class T>

Bool casacore::MaskedLatticeStatsDataProvider< T >::hasMask | ( |  | ) | const

virtual

Does the current data set have an associated mask?

Implements casacore::StatsDataProvider< NumericTraits< T >::PrecisionType, const T *, const Bool * >.

## operator++()

template<class T>

void casacore::MaskedLatticeStatsDataProvider< T >::operator++ | ( |  | ) |

virtual

increment the data provider to the next dataset, mask, range set, and weights.

Implements casacore::StatsDataProvider< NumericTraits< T >::PrecisionType, const T *, const Bool * >.

## reset()

template<class T>

void casacore::MaskedLatticeStatsDataProvider< T >::reset | ( |  | ) |

virtual

reset the provider to point to the first data set it manages.

Reimplemented from casacore::LatticeStatsDataProviderBase< T >.

## setLattice()

template<class T>

void casacore::MaskedLatticeStatsDataProvider< T >::setLattice | ( | const MaskedLattice< T > & | lattice,
|  | uInt | iteratorLimitBytes = 4096 *4096 )

set the lattice.

Automatically resets the lattice iterator. iteratorLimitBytes is related to the size of the lattice. If the lattice is greater than this size, then a lattice iterator will be used to step through the lattice. If less, then all the data in the values in the lattice are retrieved in a single chunk. The advantage of the iterator is that less memory is used. The disadvantage is there is a significant performace cost, so if the lattice is small, it is better to get all its values in a single chunk and forgo the iterator. This is particularly true when looping for a large number of iterations and creating a MaskedLatticeStatsDataProvider each loop (in that case, you probably will want to create a single object before the loop and use setLattice() to update its lattice).

## updateMaxPos()

template<class T>

void casacore::MaskedLatticeStatsDataProvider< T >::updateMaxPos | ( | const std::pair< Int64, Int64 > & | maxpos | ) |

see base class documentation.

## updateMinPos()

template<class T>

void casacore::MaskedLatticeStatsDataProvider< T >::updateMinPos | ( | const std::pair< Int64, Int64 > & | minpos | ) |

## Member Data Documentation

## _atEnd

template<class T>

Bool casacore::MaskedLatticeStatsDataProvider< T >::_atEnd

private

Definition at line 124 of file MaskedLatticeStatsDataProvider.h.

## _currentMaskPtr

template<class T>

const Bool* casacore::MaskedLatticeStatsDataProvider< T >::_currentMaskPtr

private

Definition at line 123 of file MaskedLatticeStatsDataProvider.h.

## _currentMaskSlice

template<class T>

Array<Bool> casacore::MaskedLatticeStatsDataProvider< T >::_currentMaskSlice

private

Definition at line 121 of file MaskedLatticeStatsDataProvider.h.

## _currentPtr

template<class T>

const T* casacore::MaskedLatticeStatsDataProvider< T >::_currentPtr

private

Definition at line 122 of file MaskedLatticeStatsDataProvider.h.

## _currentSlice

template<class T>

Array<T> casacore::MaskedLatticeStatsDataProvider< T >::_currentSlice

private

Definition at line 120 of file MaskedLatticeStatsDataProvider.h.

## _delData

template<class T>

Bool casacore::MaskedLatticeStatsDataProvider< T >::_delData

private

Definition at line 124 of file MaskedLatticeStatsDataProvider.h.

## _delMask

template<class T>

Bool casacore::MaskedLatticeStatsDataProvider< T >::_delMask

private

Definition at line 124 of file MaskedLatticeStatsDataProvider.h.

## _iter

template<class T>

std::shared_ptr<RO_MaskedLatticeIterator<T> > casacore::MaskedLatticeStatsDataProvider< T >::_iter

private

Definition at line 119 of file MaskedLatticeStatsDataProvider.h.

## _nMaxThreads

template<class T>

uInt casacore::MaskedLatticeStatsDataProvider< T >::_nMaxThreads

private

Definition at line 125 of file MaskedLatticeStatsDataProvider.h.

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

- lattices/LatticeMath/MaskedLatticeStatsDataProvider.h