casacore
|
Data provider which allows stats framework to iterate through an unmasked lattice. More...
#include <LatticeStatsDataProvider.h>
Public Member Functions | |
LatticeStatsDataProvider () | |
default constructor, must set lattice after construction but before using the object More... | |
LatticeStatsDataProvider (const Lattice< T > &lattice, uInt iteratorLimitBytes=4096 *4096) | |
iteratorLimitBytes is related to the size of the lattice. More... | |
~LatticeStatsDataProvider () | |
void | operator++ () |
increment the data provider to the next dataset, mask, range set, and weights. More... | |
uInt | estimatedSteps () const |
estimated number of steps to iterate through the the lattice More... | |
Bool | atEnd () const |
Are there any data sets left to provide? More... | |
void | finalize () |
Take any actions necessary to finalize the provider. More... | |
uInt64 | getCount () |
get the count of elements in the current data set. More... | |
const T * | getData () |
get the current data set More... | |
const Bool * | getMask () |
Get the associated mask of the current dataset. More... | |
uInt | getNMaxThreads () const |
returns something reasonable based on the lattice size. More... | |
Bool | hasMask () const |
Does the current data set have an associated mask? More... | |
void | reset () |
reset the provider to point to the first data set it manages. More... | |
void | setLattice (const Lattice< T > &lattice, uInt iteratorLimitBytes=4096 *4096) |
set the lattice. More... | |
void | updateMaxPos (const std::pair< Int64, Int64 > &maxpos) |
see base class documentation. More... | |
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). More... | |
std::vector< std::pair< typename NumericTraits< T >::PrecisionType, typename NumericTraits< T >::PrecisionType > > | getRanges () |
Get the associated range(s) of the current dataset. More... | |
uInt | getStride () |
Get the stride for the current data set. More... | |
const T * | getWeights () |
Returns NULL; lattices do not have associated weights. More... | |
Bool | hasRanges () const |
Does the current data set have associated range(s)? More... | |
Bool | hasWeights () const |
returns False; lattices do not have associated weights. More... | |
Bool | isInclude () const |
If the associated data set has ranges, are these include (return True) or exclude (return False) ranges? More... | |
void | minMaxPos (IPosition &minpos, IPosition &maxpos) const |
get the positions of the min and max More... | |
void | setProgressMeter (CountedPtr< LattStatsProgress > pm) |
void | setRanges (const std::vector< std::pair< typename NumericTraits< T >::PrecisionType, typename NumericTraits< T >::PrecisionType > > &ranges, Bool isInclude) |
set the data ranges More... | |
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. More... | |
virtual void | updateMinPos (const LocationType &) |
Private Member Functions | |
void | _freeStorage () |
Private Attributes | |
CountedPtr< RO_LatticeIterator< T > > | _iter |
Array< T > | _currentSlice |
const T * | _currentPtr |
Bool | _delData |
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 () | |
Data provider which allows stats framework to iterate through an unmasked lattice.
Definition at line 39 of file LatticeStatsDataProvider.h.
casacore::LatticeStatsDataProvider< T >::LatticeStatsDataProvider | ( | ) |
default constructor, must set lattice after construction but before using the object
casacore::LatticeStatsDataProvider< T >::LatticeStatsDataProvider | ( | const Lattice< 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 LatticeStatsDataProvider each loop (in that case, you probably will want to create a single object before the loop and use setLattice() to update its lattice).
casacore::LatticeStatsDataProvider< T >::~LatticeStatsDataProvider | ( | ) |
|
private |
|
virtual |
Are there any data sets left to provide?
Implements casacore::StatsDataProvider< NumericTraits< T >::PrecisionType, const T *, const Bool * >.
|
virtual |
estimated number of steps to iterate through the the lattice
Implements casacore::LatticeStatsDataProviderBase< T >.
|
virtual |
Take any actions necessary to finalize the provider.
This will be called when atEnd() returns True.
Reimplemented from casacore::LatticeStatsDataProviderBase< T >.
|
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 * >.
|
virtual |
get the current data set
Implements casacore::StatsDataProvider< NumericTraits< T >::PrecisionType, const T *, const Bool * >.
|
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 * >.
|
virtual |
returns something reasonable based on the lattice size.
Reimplemented from casacore::StatsDataProvider< NumericTraits< T >::PrecisionType, const T *, const Bool * >.
|
virtual |
Does the current data set have an associated mask?
Implements casacore::StatsDataProvider< NumericTraits< T >::PrecisionType, const T *, const Bool * >.
|
virtual |
increment the data provider to the next dataset, mask, range set, and weights.
Implements casacore::StatsDataProvider< NumericTraits< T >::PrecisionType, const T *, const Bool * >.
|
virtual |
reset the provider to point to the first data set it manages.
Reimplemented from casacore::LatticeStatsDataProviderBase< T >.
void casacore::LatticeStatsDataProvider< T >::setLattice | ( | const Lattice< 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 LatticeStatsDataProvider each loop (in that case, you probably will want to create a single object before the loop and use setLattice() to update its lattice).
void casacore::LatticeStatsDataProvider< T >::updateMaxPos | ( | const std::pair< Int64, Int64 > & | maxpos | ) |
see base class documentation.
void casacore::LatticeStatsDataProvider< T >::updateMinPos | ( | const std::pair< Int64, Int64 > & | minpos | ) |
|
private |
Definition at line 124 of file LatticeStatsDataProvider.h.
|
private |
Definition at line 123 of file LatticeStatsDataProvider.h.
|
private |
Definition at line 122 of file LatticeStatsDataProvider.h.
|
private |
Definition at line 124 of file LatticeStatsDataProvider.h.
|
private |
Definition at line 121 of file LatticeStatsDataProvider.h.
|
private |
Definition at line 125 of file LatticeStatsDataProvider.h.