casacore
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
casacore::ConstrainedRangeStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator > Class Template Referenceabstract

Abstract base class for statistics algorithms which are characterized by a range of good values. More...

#include <ConstrainedRangeStatistics.h>

Public Member Functions

 ConstrainedRangeStatistics ()=delete
 
virtual ~ConstrainedRangeStatistics ()
 
virtual AccumType getMedian (CountedPtr< uInt64 > knownNpts=nullptr, CountedPtr< AccumType > knownMin=nullptr, CountedPtr< AccumType > knownMax=nullptr, uInt binningThreshholdSizeBytes=4096 *4096, Bool persistSortedArray=False, uInt nBins=10000)
 In the following group of methods, if the size of the composite dataset is smaller than binningThreshholdSizeBytes, the composite dataset will be (perhaps partially) sorted and persisted in memory during the call. More...
 
virtual AccumType getMedianAbsDevMed (CountedPtr< uInt64 > knownNpts=nullptr, CountedPtr< AccumType > knownMin=nullptr, CountedPtr< AccumType > knownMax=nullptr, uInt binningThreshholdSizeBytes=4096 *4096, Bool persistSortedArray=False, uInt nBins=10000)
 get the median of the absolute deviation about the median of the data. More...
 
virtual AccumType getMedianAndQuantiles (std::map< Double, AccumType > &quantileToValue, const std::set< Double > &quantiles, CountedPtr< uInt64 > knownNpts=nullptr, CountedPtr< AccumType > knownMin=nullptr, CountedPtr< AccumType > knownMax=nullptr, uInt binningThreshholdSizeBytes=4096 *4096, Bool persistSortedArray=False, uInt nBins=10000)
 If one needs to compute both the median and quantile values, it is better to call getMedianAndQuantiles() rather than getMedian() and getQuantiles() separately, as the first will scan large data sets fewer times than calling the seperate methods. More...
 
virtual std::map< Double, AccumType > getQuantiles (const std::set< Double > &quantiles, CountedPtr< uInt64 > knownNpts=nullptr, CountedPtr< AccumType > knownMin=nullptr, CountedPtr< AccumType > knownMax=NULL, uInt binningThreshholdSizeBytes=4096 *4096, Bool persistSortedArray=False, uInt nBins=10000)
 Get the specified quantiles. More...
 
virtual void getMinMax (AccumType &mymin, AccumType &mymax)
 get the min and max of the data set More...
 
virtual uInt64 getNPts ()
 scan the dataset(s) that have been added, and find the number of good points. More...
 
virtual LocationType getStatisticIndex (StatisticsData::STATS stat)
 see base class description More...
 
virtual void reset ()
 reset object to initial state. More...
 
- Public Member Functions inherited from casacore::ClassicalStatistics< CASA_STATP >
 ClassicalStatistics ()
 
 ClassicalStatistics (const ClassicalStatistics &cs)
 copy semantics More...
 
virtual ~ClassicalStatistics ()
 
ClassicalStatisticsoperator= (const ClassicalStatistics &other)
 copy semantics More...
 
virtual StatisticsAlgorithm< CASA_STATP > * clone () const
 Clone this instance. More...
 
virtual StatisticsData::ALGORITHM algorithm () const
 get the algorithm that this object uses for computing stats More...
 
virtual CASA_STATP getMedian (CountedPtr< uInt64 > knownNpts=nullptr, CountedPtr< CASA_STATP > knownMin=nullptr, CountedPtr< CASA_STATP > knownMax=nullptr, uInt binningThreshholdSizeBytes=4096 *4096, Bool persistSortedArray=False, uInt nBins=10000)
 In the following group of methods, if the size of the composite dataset is smaller than binningThreshholdSizeBytes, the composite dataset will be (perhaps partially) sorted and persisted in memory during the call. More...
 
virtual CASA_STATP getMedianAndQuantiles (std::map< Double, CASA_STATP > &quantiles, const std::set< Double > &fractions, CountedPtr< uInt64 > knownNpts=nullptr, CountedPtr< CASA_STATP > knownMin=nullptr, CountedPtr< CASA_STATP > knownMax=nullptr, uInt binningThreshholdSizeBytes=4096 *4096, Bool persistSortedArray=False, uInt nBins=10000)
 If one needs to compute both the median and quantile values, it is better to call getMedianAndQuantiles() rather than getMedian() and getQuantiles() separately, as the first will scan large data sets fewer times than calling the separate methods. More...
 
virtual CASA_STATP getMedianAbsDevMed (CountedPtr< uInt64 > knownNpts=nullptr, CountedPtr< CASA_STATP > knownMin=nullptr, CountedPtr< CASA_STATP > knownMax=nullptr, uInt binningThreshholdSizeBytes=4096 *4096, Bool persistSortedArray=False, uInt nBins=10000)
 get the median of the absolute deviation about the median of the data. More...
 
virtual std::map< Double, CASA_STATPgetQuantiles (const std::set< Double > &fractions, CountedPtr< uInt64 > knownNpts=nullptr, CountedPtr< CASA_STATP > knownMin=nullptr, CountedPtr< CASA_STATP > knownMax=nullptr, uInt binningThreshholdSizeBytes=4096 *4096, Bool persistSortedArray=False, uInt nBins=10000)
 Get the specified quantiles. More...
 
virtual void getMinMax (CASA_STATP &mymin, CASA_STATP &mymax)
 scan the dataset(s) that have been added, and find the min and max. More...
 
virtual void getMinMaxNpts (uInt64 &npts, CASA_STATP &mymin, CASA_STATP &mymax)
 
virtual void setCalculateAsAdded (Bool c)
 Should statistics be updated with calls to addData or should they only be calculated upon calls to getStatistics() etc? Beware that calling this will automatically reinitialize the object, so that it will contain no references to data et al. More...
 
virtual void setDataProvider (StatsDataProvider< CASA_STATP > *dataProvider)
 An exception will be thrown if setCalculateAsAdded(True) has been called. More...
 
void setQuantileComputer (CountedPtr< ClassicalQuantileComputer< CASA_STATP >> qc)
 Allow derived objects to set the quantile computer object. More...
 
virtual void setStatsToCalculate (std::set< StatisticsData::STATS > &stats)
 Provide guidance to algorithms by specifying a priori which statistics the caller would like calculated. More...
 
- Public Member Functions inherited from casacore::StatisticsAlgorithm< CASA_STATP >
virtual ~StatisticsAlgorithm ()
 
void addData (const DataIterator &first, uInt nr, uInt dataStride=1, Bool nrAccountsForStride=False)
 Add a dataset to an existing set of datasets on which statistics are to be calculated. More...
 
void addData (const DataIterator &first, uInt nr, const DataRanges &dataRanges, Bool isInclude=True, uInt dataStride=1, Bool nrAccountsForStride=False)
 
void addData (const DataIterator &first, const const Bool * &maskFirst, uInt nr, uInt dataStride=1, Bool nrAccountsForStride=False, uInt maskStride=1)
 
void addData (const DataIterator &first, const const Bool * &maskFirst, uInt nr, const DataRanges &dataRanges, Bool isInclude=True, uInt dataStride=1, Bool nrAccountsForStride=False, uInt maskStride=1)
 
void addData (const DataIterator &first, const DataIterator &weightFirst, uInt nr, uInt dataStride=1, Bool nrAccountsForStride=False)
 
void addData (const DataIterator &first, const DataIterator &weightFirst, uInt nr, const DataRanges &dataRanges, Bool isInclude=True, uInt dataStride=1, Bool nrAccountsForStride=False)
 
void addData (const DataIterator &first, const DataIterator &weightFirst, const const Bool * &maskFirst, uInt nr, uInt dataStride=1, Bool nrAccountsForStride=False, uInt maskStride=1)
 
void addData (const DataIterator &first, const DataIterator &weightFirst, const const Bool * &maskFirst, uInt nr, const DataRanges &dataRanges, Bool isInclude=True, uInt dataStride=1, Bool nrAccountsForStride=False, uInt maskStride=1)
 
CASA_STATP getQuantile (Double quantile, CountedPtr< uInt64 > knownNpts=nullptr, CountedPtr< CASA_STATP > knownMin=nullptr, CountedPtr< CASA_STATP > knownMax=nullptr, uInt binningThreshholdSizeBytes=4096 *4096, Bool persistSortedArray=False, uInt nBins=10000)
 Purposefully not virtual. More...
 
CASA_STATP getStatistic (StatisticsData::STATS stat)
 get the value of the specified statistic. More...
 
StatsData< CASA_STATPgetStatistics ()
 Return statistics. More...
 
void setData (const DataIterator &first, uInt nr, uInt dataStride=1, Bool nrAccountsForStride=False)
 setdata() clears any current datasets or data provider and then adds the specified data set as the first dataset in the (possibly new) set of data sets for which statistics are to be calculated. More...
 
void setData (const DataIterator &first, uInt nr, const DataRanges &dataRanges, Bool isInclude=True, uInt dataStride=1, Bool nrAccountsForStride=False)
 
void setData (const DataIterator &first, const const Bool * &maskFirst, uInt nr, uInt dataStride=1, Bool nrAccountsForStride=False, uInt maskStride=1)
 
void setData (const DataIterator &first, const const Bool * &maskFirst, uInt nr, const DataRanges &dataRanges, Bool isInclude=True, uInt dataStride=1, Bool nrAccountsForStride=False, uInt maskStride=1)
 
void setData (const DataIterator &first, const DataIterator &weightFirst, uInt nr, uInt dataStride=1, Bool nrAccountsForStride=False)
 
void setData (const DataIterator &first, const DataIterator &weightFirst, uInt nr, const DataRanges &dataRanges, Bool isInclude=True, uInt dataStride=1, Bool nrAccountsForStride=False)
 
void setData (const DataIterator &first, const DataIterator &weightFirst, const const Bool * &maskFirst, uInt nr, uInt dataStride=1, Bool nrAccountsForStride=False, uInt maskStride=1)
 
void setData (const DataIterator &first, const DataIterator &weightFirst, const const Bool * &maskFirst, uInt nr, const DataRanges &dataRanges, Bool isInclude=True, uInt dataStride=1, Bool nrAccountsForStride=False, uInt maskStride=1)
 

Protected Member Functions

 ConstrainedRangeStatistics (CountedPtr< ConstrainedRangeQuantileComputer< CASA_STATP >> qc)
 Concrete derived classes are responsible for providing an appropriate QuantileComputer object to the constructor, which is ultimately passed up the instantiation hierarchy and stored at the StatisticsAlgorithm level. More...
 
 ConstrainedRangeStatistics (const ConstrainedRangeStatistics< CASA_STATP > &other)
 copy semantics More...
 
ConstrainedRangeStatistics< CASA_STATP > & operator= (const ConstrainedRangeStatistics< CASA_STATP > &other)
 copy semantics More...
 
virtual void _accumNpts (uInt64 &npts, const DataIterator &dataStart, uInt64 nr, uInt dataStride) const
 scan through the data set to determine the number of good (unmasked, weight > 0, within range) points. More...
 
virtual void _accumNpts (uInt64 &npts, const DataIterator &dataStart, uInt64 nr, uInt dataStride, const DataRanges &ranges, Bool isInclude) const
 
virtual void _accumNpts (uInt64 &npts, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const MaskIterator &maskBegin, uInt maskStride) const
 
virtual void _accumNpts (uInt64 &npts, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const MaskIterator &maskBegin, uInt maskStride, const DataRanges &ranges, Bool isInclude) const
 
virtual void _accumNpts (uInt64 &npts, const DataIterator &dataBegin, const WeightsIterator &weightsBegin, uInt64 nr, uInt dataStride) const
 
virtual void _accumNpts (uInt64 &npts, const DataIterator &dataBegin, const WeightsIterator &weightsBegin, uInt64 nr, uInt dataStride, const DataRanges &ranges, Bool isInclude) const
 
virtual void _accumNpts (uInt64 &npts, const DataIterator &dataBegin, const WeightsIterator &weightsBegin, uInt64 nr, uInt dataStride, const MaskIterator &maskBegin, uInt maskStride, const DataRanges &ranges, Bool isInclude) const
 
virtual void _accumNpts (uInt64 &npts, const DataIterator &dataBegin, const WeightsIterator &weightBegin, uInt64 nr, uInt dataStride, const MaskIterator &maskBegin, uInt maskStride) const
 
virtual AccumType _getStatistic (StatisticsData::STATS stat)
 
virtual StatsData< AccumType > _getStatistics ()
 
virtual void _minMax (CountedPtr< AccumType > &mymin, CountedPtr< AccumType > &mymax, const DataIterator &dataBegin, uInt64 nr, uInt dataStride) const
 
virtual void _minMax (CountedPtr< AccumType > &mymin, CountedPtr< AccumType > &mymax, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const DataRanges &ranges, Bool isInclude) const
 
virtual void _minMax (CountedPtr< AccumType > &mymin, CountedPtr< AccumType > &mymax, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const MaskIterator &maskBegin, uInt maskStride) const
 
virtual void _minMax (CountedPtr< AccumType > &mymin, CountedPtr< AccumType > &mymax, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const MaskIterator &maskBegin, uInt maskStride, const DataRanges &ranges, Bool isInclude) const
 
virtual void _minMax (CountedPtr< AccumType > &mymin, CountedPtr< AccumType > &mymax, const DataIterator &dataBegin, const WeightsIterator &weightsBegin, uInt64 nr, uInt dataStride) const
 
virtual void _minMax (CountedPtr< AccumType > &mymin, CountedPtr< AccumType > &mymax, const DataIterator &dataBegin, const WeightsIterator &weightsBegin, uInt64 nr, uInt dataStride, const DataRanges &ranges, Bool isInclude) const
 
virtual void _minMax (CountedPtr< AccumType > &mymin, CountedPtr< AccumType > &mymax, const DataIterator &dataBegin, const WeightsIterator &weightsBegin, uInt64 nr, uInt dataStride, const MaskIterator &maskBegin, uInt maskStride, const DataRanges &ranges, Bool isInclude) const
 
virtual void _minMax (CountedPtr< AccumType > &mymin, CountedPtr< AccumType > &mymax, const DataIterator &dataBegin, const WeightsIterator &weightBegin, uInt64 nr, uInt dataStride, const MaskIterator &maskBegin, uInt maskStride) const
 
virtual void _minMaxNpts (uInt64 &npts, CountedPtr< AccumType > &mymin, CountedPtr< AccumType > &mymax, const DataIterator &dataBegin, uInt64 nr, uInt dataStride) const
 Sometimes we want the min, max, and npts all in one scan. More...
 
virtual void _minMaxNpts (uInt64 &npts, CountedPtr< AccumType > &mymin, CountedPtr< AccumType > &mymax, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const DataRanges &ranges, Bool isInclude) const
 
virtual void _minMaxNpts (uInt64 &npts, CountedPtr< AccumType > &mymin, CountedPtr< AccumType > &mymax, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const MaskIterator &maskBegin, uInt maskStride) const
 
virtual void _minMaxNpts (uInt64 &npts, CountedPtr< AccumType > &mymin, CountedPtr< AccumType > &mymax, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const MaskIterator &maskBegin, uInt maskStride, const DataRanges &ranges, Bool isInclude) const
 
virtual void _minMaxNpts (uInt64 &npts, CountedPtr< AccumType > &mymin, CountedPtr< AccumType > &mymax, const DataIterator &dataBegin, const WeightsIterator &weightsBegin, uInt64 nr, uInt dataStride) const
 
virtual void _minMaxNpts (uInt64 &npts, CountedPtr< AccumType > &mymin, CountedPtr< AccumType > &mymax, const DataIterator &dataBegin, const WeightsIterator &weightsBegin, uInt64 nr, uInt dataStride, const DataRanges &ranges, Bool isInclude) const
 
virtual void _minMaxNpts (uInt64 &npts, CountedPtr< AccumType > &mymin, CountedPtr< AccumType > &mymax, const DataIterator &dataBegin, const WeightsIterator &weightsBegin, uInt64 nr, uInt dataStride, const MaskIterator &maskBegin, uInt maskStride, const DataRanges &ranges, Bool isInclude) const
 
virtual void _minMaxNpts (uInt64 &npts, CountedPtr< AccumType > &mymin, CountedPtr< AccumType > &mymax, const DataIterator &dataBegin, const WeightsIterator &weightBegin, uInt64 nr, uInt dataStride, const MaskIterator &maskBegin, uInt maskStride) const
 
void _setRange (CountedPtr< std::pair< AccumType, AccumType > > r)
 This method is purposefully non-virtual. More...
 
virtual void _setRange ()=0
 derived classes need to implement how to set their respective range More...
 
virtual void _unweightedStats (StatsData< AccumType > &stats, uInt64 &ngood, LocationType &location, const DataIterator &dataBegin, uInt64 nr, uInt dataStride)
 no weights, no mask, no ranges More...
 
virtual void _unweightedStats (StatsData< AccumType > &stats, uInt64 &ngood, LocationType &location, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const DataRanges &ranges, Bool isInclude)
 no weights, no mask More...
 
virtual void _unweightedStats (StatsData< AccumType > &stats, uInt64 &ngood, LocationType &location, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const MaskIterator &maskBegin, uInt maskStride)
 
virtual void _unweightedStats (StatsData< AccumType > &stats, uInt64 &ngood, LocationType &location, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const MaskIterator &maskBegin, uInt maskStride, const DataRanges &ranges, Bool isInclude)
 
virtual void _weightedStats (StatsData< AccumType > &stats, LocationType &location, const DataIterator &dataBegin, const WeightsIterator &weightsBegin, uInt64 nr, uInt dataStride)
 has weights, but no mask, no ranges More...
 
virtual void _weightedStats (StatsData< AccumType > &stats, LocationType &location, const DataIterator &dataBegin, const WeightsIterator &weightsBegin, uInt64 nr, uInt dataStride, const DataRanges &ranges, Bool isInclude)
 
virtual void _weightedStats (StatsData< AccumType > &stats, LocationType &location, const DataIterator &dataBegin, const WeightsIterator &weightBegin, uInt64 nr, uInt dataStride, const MaskIterator &maskBegin, uInt maskStride)
 
virtual void _weightedStats (StatsData< AccumType > &stats, LocationType &location, const DataIterator &dataBegin, const WeightsIterator &weightBegin, uInt64 nr, uInt dataStride, const MaskIterator &maskBegin, uInt maskStride, const DataRanges &ranges, Bool isInclude)
 
- Protected Member Functions inherited from casacore::ClassicalStatistics< CASA_STATP >
 ClassicalStatistics (CountedPtr< ClassicalQuantileComputer< CASA_STATP > > qc)
 This constructor should be used by derived objects in order to set the proper quantile computer object. More...
 
virtual void _accumNpts (uInt64 &npts, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const const Bool * &maskBegin, uInt maskStride) const
 
virtual void _accumNpts (uInt64 &npts, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const const Bool * &maskBegin, uInt maskStride, const DataRanges &ranges, Bool isInclude) const
 
virtual void _accumNpts (uInt64 &npts, const DataIterator &dataBegin, const DataIterator &weightsBegin, uInt64 nr, uInt dataStride) const
 
virtual void _accumNpts (uInt64 &npts, const DataIterator &dataBegin, const DataIterator &weightsBegin, uInt64 nr, uInt dataStride, const DataRanges &ranges, Bool isInclude) const
 
virtual void _accumNpts (uInt64 &npts, const DataIterator &dataBegin, const DataIterator &weightsBegin, uInt64 nr, uInt dataStride, const const Bool * &maskBegin, uInt maskStride, const DataRanges &ranges, Bool isInclude) const
 
virtual void _accumNpts (uInt64 &npts, const DataIterator &dataBegin, const DataIterator &weightBegin, uInt64 nr, uInt dataStride, const const Bool * &maskBegin, uInt maskStride) const
 
void _accumulate (StatsData< CASA_STATP > &stats, const CASA_STATP &datum, const LocationType &location)
 
void _accumulate (StatsData< CASA_STATP > &stats, const CASA_STATP &datum, const CASA_STATP &weight, const LocationType &location)
 
void _addData ()
 Allows derived classes to do things after data is set or added. More...
 
void _clearStats ()
 
Bool _getDoMaxMin () const
 
virtual StatsData< CASA_STATP_getInitialStats () const
 
virtual StatsData< CASA_STATP > & _getStatsData ()
 Retrieve stats structure. More...
 
virtual const StatsData< CASA_STATP > & _getStatsData () const
 
virtual void _minMax (CountedPtr< CASA_STATP > &mymin, CountedPtr< CASA_STATP > &mymax, const DataIterator &dataBegin, uInt64 nr, uInt dataStride) const
 
virtual void _minMax (CountedPtr< CASA_STATP > &mymin, CountedPtr< CASA_STATP > &mymax, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const DataRanges &ranges, Bool isInclude) const
 
virtual void _minMax (CountedPtr< CASA_STATP > &mymin, CountedPtr< CASA_STATP > &mymax, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const const Bool * &maskBegin, uInt maskStride) const
 
virtual void _minMax (CountedPtr< CASA_STATP > &mymin, CountedPtr< CASA_STATP > &mymax, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const const Bool * &maskBegin, uInt maskStride, const DataRanges &ranges, Bool isInclude) const
 
virtual void _minMax (CountedPtr< CASA_STATP > &mymin, CountedPtr< CASA_STATP > &mymax, const DataIterator &dataBegin, const DataIterator &weightsBegin, uInt64 nr, uInt dataStride) const
 
virtual void _minMax (CountedPtr< CASA_STATP > &mymin, CountedPtr< CASA_STATP > &mymax, const DataIterator &dataBegin, const DataIterator &weightsBegin, uInt64 nr, uInt dataStride, const DataRanges &ranges, Bool isInclude) const
 
virtual void _minMax (CountedPtr< CASA_STATP > &mymin, CountedPtr< CASA_STATP > &mymax, const DataIterator &dataBegin, const DataIterator &weightsBegin, uInt64 nr, uInt dataStride, const const Bool * &maskBegin, uInt maskStride, const DataRanges &ranges, Bool isInclude) const
 
virtual void _minMax (CountedPtr< CASA_STATP > &mymin, CountedPtr< CASA_STATP > &mymax, const DataIterator &dataBegin, const DataIterator &weightBegin, uInt64 nr, uInt dataStride, const const Bool * &maskBegin, uInt maskStride) const
 
virtual void _minMaxNpts (uInt64 &npts, CountedPtr< CASA_STATP > &mymin, CountedPtr< CASA_STATP > &mymax, const DataIterator &dataBegin, uInt64 nr, uInt dataStride) const
 Sometimes we want the min, max, and npts all in one scan. More...
 
virtual void _minMaxNpts (uInt64 &npts, CountedPtr< CASA_STATP > &mymin, CountedPtr< CASA_STATP > &mymax, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const DataRanges &ranges, Bool isInclude) const
 
virtual void _minMaxNpts (uInt64 &npts, CountedPtr< CASA_STATP > &mymin, CountedPtr< CASA_STATP > &mymax, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const const Bool * &maskBegin, uInt maskStride) const
 
virtual void _minMaxNpts (uInt64 &npts, CountedPtr< CASA_STATP > &mymin, CountedPtr< CASA_STATP > &mymax, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const const Bool * &maskBegin, uInt maskStride, const DataRanges &ranges, Bool isInclude) const
 
virtual void _minMaxNpts (uInt64 &npts, CountedPtr< CASA_STATP > &mymin, CountedPtr< CASA_STATP > &mymax, const DataIterator &dataBegin, const DataIterator &weightsBegin, uInt64 nr, uInt dataStride) const
 
virtual void _minMaxNpts (uInt64 &npts, CountedPtr< CASA_STATP > &mymin, CountedPtr< CASA_STATP > &mymax, const DataIterator &dataBegin, const DataIterator &weightsBegin, uInt64 nr, uInt dataStride, const DataRanges &ranges, Bool isInclude) const
 
virtual void _minMaxNpts (uInt64 &npts, CountedPtr< CASA_STATP > &mymin, CountedPtr< CASA_STATP > &mymax, const DataIterator &dataBegin, const DataIterator &weightsBegin, uInt64 nr, uInt dataStride, const const Bool * &maskBegin, uInt maskStride, const DataRanges &ranges, Bool isInclude) const
 
virtual void _minMaxNpts (uInt64 &npts, CountedPtr< CASA_STATP > &mymin, CountedPtr< CASA_STATP > &mymax, const DataIterator &dataBegin, const DataIterator &weightBegin, uInt64 nr, uInt dataStride, const const Bool * &maskBegin, uInt maskStride) const
 
CountedPtr< StatisticsAlgorithmQuantileComputer< CASA_STATP > > _getQuantileComputer ()
 
virtual void _unweightedStats (StatsData< CASA_STATP > &stats, uInt64 &ngood, LocationType &location, const DataIterator &dataBegin, uInt64 nr, uInt dataStride)
 no weights, no mask, no ranges More...
 
virtual void _unweightedStats (StatsData< CASA_STATP > &stats, uInt64 &ngood, LocationType &location, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const DataRanges &ranges, Bool isInclude)
 no weights, no mask More...
 
virtual void _unweightedStats (StatsData< CASA_STATP > &stats, uInt64 &ngood, LocationType &location, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const const Bool * &maskBegin, uInt maskStride)
 
virtual void _unweightedStats (StatsData< CASA_STATP > &stats, uInt64 &ngood, LocationType &location, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const const Bool * &maskBegin, uInt maskStride, const DataRanges &ranges, Bool isInclude)
 
virtual void _updateDataProviderMaxMin (const StatsData< CASA_STATP > &threadStats)
 
virtual void _weightedStats (StatsData< CASA_STATP > &stats, LocationType &location, const DataIterator &dataBegin, const DataIterator &weightsBegin, uInt64 nr, uInt dataStride)
 has weights, but no mask, no ranges More...
 
virtual void _weightedStats (StatsData< CASA_STATP > &stats, LocationType &location, const DataIterator &dataBegin, const DataIterator &weightsBegin, uInt64 nr, uInt dataStride, const DataRanges &ranges, Bool isInclude)
 
virtual void _weightedStats (StatsData< CASA_STATP > &stats, LocationType &location, const DataIterator &dataBegin, const DataIterator &weightBegin, uInt64 nr, uInt dataStride, const const Bool * &maskBegin, uInt maskStride)
 
virtual void _weightedStats (StatsData< CASA_STATP > &stats, LocationType &location, const DataIterator &dataBegin, const DataIterator &weightBegin, uInt64 nr, uInt dataStride, const const Bool * &maskBegin, uInt maskStride, const DataRanges &ranges, Bool isInclude)
 
- Protected Member Functions inherited from casacore::StatisticsAlgorithm< CASA_STATP >
 StatisticsAlgorithm ()
 
 StatisticsAlgorithm (const StatisticsAlgorithm &other)
 use copy semantics, except for the data provider which uses reference semantics More...
 
StatisticsAlgorithmoperator= (const StatisticsAlgorithm &other)
 use copy semantics, except for the data provider which uses reference semantics More...
 
const StatisticsDataset< CASA_STATP > & _getDataset () const
 These methods are purposefully not virtual. More...
 
StatisticsDataset< CASA_STATP > & _getDataset ()
 
const std::set< StatisticsData::STATS_getStatsToCalculate () const
 
virtual const std::set< StatisticsData::STATS > & _getUnsupportedStatistics () const
 
void _setUnsupportedStatistics (const std::set< StatisticsData::STATS > &stats)
 Derived classes should normally call this in their constructors, if applicable. More...
 

Private Attributes

CountedPtr< std::pair< AccumType, AccumType > > _range
 

Detailed Description

template<class AccumType, class DataIterator, class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
class casacore::ConstrainedRangeStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >

Abstract base class for statistics algorithms which are characterized by a range of good values.

The range is usually calculated dynamically based on the entire distribution. The specifics of such calculations are delegated to derived classes.

Definition at line 49 of file ConstrainedRangeStatistics.h.

Constructor & Destructor Documentation

◆ ConstrainedRangeStatistics() [1/3]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
casacore::ConstrainedRangeStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::ConstrainedRangeStatistics ( )
delete

◆ ~ConstrainedRangeStatistics()

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
virtual casacore::ConstrainedRangeStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::~ConstrainedRangeStatistics ( )
virtual

◆ ConstrainedRangeStatistics() [2/3]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
casacore::ConstrainedRangeStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::ConstrainedRangeStatistics ( CountedPtr< ConstrainedRangeQuantileComputer< CASA_STATP >>  qc)
protected

Concrete derived classes are responsible for providing an appropriate QuantileComputer object to the constructor, which is ultimately passed up the instantiation hierarchy and stored at the StatisticsAlgorithm level.

◆ ConstrainedRangeStatistics() [3/3]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
casacore::ConstrainedRangeStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::ConstrainedRangeStatistics ( const ConstrainedRangeStatistics< CASA_STATP > &  other)
protected

copy semantics

Member Function Documentation

◆ _accumNpts() [1/8]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
virtual void casacore::ConstrainedRangeStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_accumNpts ( uInt64 npts,
const DataIterator &  dataBegin,
const WeightsIterator &  weightBegin,
uInt64  nr,
uInt  dataStride,
const MaskIterator &  maskBegin,
uInt  maskStride 
) const
protectedvirtual

◆ _accumNpts() [2/8]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
virtual void casacore::ConstrainedRangeStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_accumNpts ( uInt64 npts,
const DataIterator &  dataBegin,
const WeightsIterator &  weightsBegin,
uInt64  nr,
uInt  dataStride 
) const
protectedvirtual

◆ _accumNpts() [3/8]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
virtual void casacore::ConstrainedRangeStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_accumNpts ( uInt64 npts,
const DataIterator &  dataBegin,
const WeightsIterator &  weightsBegin,
uInt64  nr,
uInt  dataStride,
const DataRanges ranges,
Bool  isInclude 
) const
protectedvirtual

◆ _accumNpts() [4/8]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
virtual void casacore::ConstrainedRangeStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_accumNpts ( uInt64 npts,
const DataIterator &  dataBegin,
const WeightsIterator &  weightsBegin,
uInt64  nr,
uInt  dataStride,
const MaskIterator &  maskBegin,
uInt  maskStride,
const DataRanges ranges,
Bool  isInclude 
) const
protectedvirtual

◆ _accumNpts() [5/8]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
virtual void casacore::ConstrainedRangeStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_accumNpts ( uInt64 npts,
const DataIterator &  dataBegin,
uInt64  nr,
uInt  dataStride,
const MaskIterator &  maskBegin,
uInt  maskStride 
) const
protectedvirtual

◆ _accumNpts() [6/8]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
virtual void casacore::ConstrainedRangeStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_accumNpts ( uInt64 npts,
const DataIterator &  dataBegin,
uInt64  nr,
uInt  dataStride,
const MaskIterator &  maskBegin,
uInt  maskStride,
const DataRanges ranges,
Bool  isInclude 
) const
protectedvirtual

◆ _accumNpts() [7/8]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
virtual void casacore::ConstrainedRangeStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_accumNpts ( uInt64 npts,
const DataIterator &  dataStart,
uInt64  nr,
uInt  dataStride 
) const
protectedvirtual

scan through the data set to determine the number of good (unmasked, weight > 0, within range) points.

The first with no mask, no ranges, and no weights is trivial with npts = nr in this class, but is implemented here so that derived classes may override it.

Reimplemented from casacore::ClassicalStatistics< CASA_STATP >.

Reimplemented in casacore::HingesFencesStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >.

◆ _accumNpts() [8/8]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
virtual void casacore::ConstrainedRangeStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_accumNpts ( uInt64 npts,
const DataIterator &  dataStart,
uInt64  nr,
uInt  dataStride,
const DataRanges ranges,
Bool  isInclude 
) const
protectedvirtual

◆ _getStatistic()

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
virtual AccumType casacore::ConstrainedRangeStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_getStatistic ( StatisticsData::STATS  stat)
protectedvirtual

◆ _getStatistics()

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
virtual StatsData<AccumType> casacore::ConstrainedRangeStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_getStatistics ( )
protectedvirtual

◆ _minMax() [1/8]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
virtual void casacore::ConstrainedRangeStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_minMax ( CountedPtr< AccumType > &  mymin,
CountedPtr< AccumType > &  mymax,
const DataIterator &  dataBegin,
const WeightsIterator &  weightBegin,
uInt64  nr,
uInt  dataStride,
const MaskIterator &  maskBegin,
uInt  maskStride 
) const
protectedvirtual

◆ _minMax() [2/8]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
virtual void casacore::ConstrainedRangeStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_minMax ( CountedPtr< AccumType > &  mymin,
CountedPtr< AccumType > &  mymax,
const DataIterator &  dataBegin,
const WeightsIterator &  weightsBegin,
uInt64  nr,
uInt  dataStride 
) const
protectedvirtual

◆ _minMax() [3/8]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
virtual void casacore::ConstrainedRangeStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_minMax ( CountedPtr< AccumType > &  mymin,
CountedPtr< AccumType > &  mymax,
const DataIterator &  dataBegin,
const WeightsIterator &  weightsBegin,
uInt64  nr,
uInt  dataStride,
const DataRanges ranges,
Bool  isInclude 
) const
protectedvirtual

◆ _minMax() [4/8]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
virtual void casacore::ConstrainedRangeStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_minMax ( CountedPtr< AccumType > &  mymin,
CountedPtr< AccumType > &  mymax,
const DataIterator &  dataBegin,
const WeightsIterator &  weightsBegin,
uInt64  nr,
uInt  dataStride,
const MaskIterator &  maskBegin,
uInt  maskStride,
const DataRanges ranges,
Bool  isInclude 
) const
protectedvirtual

◆ _minMax() [5/8]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
virtual void casacore::ConstrainedRangeStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_minMax ( CountedPtr< AccumType > &  mymin,
CountedPtr< AccumType > &  mymax,
const DataIterator &  dataBegin,
uInt64  nr,
uInt  dataStride 
) const
protectedvirtual

◆ _minMax() [6/8]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
virtual void casacore::ConstrainedRangeStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_minMax ( CountedPtr< AccumType > &  mymin,
CountedPtr< AccumType > &  mymax,
const DataIterator &  dataBegin,
uInt64  nr,
uInt  dataStride,
const DataRanges ranges,
Bool  isInclude 
) const
protectedvirtual

◆ _minMax() [7/8]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
virtual void casacore::ConstrainedRangeStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_minMax ( CountedPtr< AccumType > &  mymin,
CountedPtr< AccumType > &  mymax,
const DataIterator &  dataBegin,
uInt64  nr,
uInt  dataStride,
const MaskIterator &  maskBegin,
uInt  maskStride 
) const
protectedvirtual

◆ _minMax() [8/8]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
virtual void casacore::ConstrainedRangeStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_minMax ( CountedPtr< AccumType > &  mymin,
CountedPtr< AccumType > &  mymax,
const DataIterator &  dataBegin,
uInt64  nr,
uInt  dataStride,
const MaskIterator &  maskBegin,
uInt  maskStride,
const DataRanges ranges,
Bool  isInclude 
) const
protectedvirtual

◆ _minMaxNpts() [1/8]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
virtual void casacore::ConstrainedRangeStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_minMaxNpts ( uInt64 npts,
CountedPtr< AccumType > &  mymin,
CountedPtr< AccumType > &  mymax,
const DataIterator &  dataBegin,
const WeightsIterator &  weightBegin,
uInt64  nr,
uInt  dataStride,
const MaskIterator &  maskBegin,
uInt  maskStride 
) const
protectedvirtual

◆ _minMaxNpts() [2/8]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
virtual void casacore::ConstrainedRangeStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_minMaxNpts ( uInt64 npts,
CountedPtr< AccumType > &  mymin,
CountedPtr< AccumType > &  mymax,
const DataIterator &  dataBegin,
const WeightsIterator &  weightsBegin,
uInt64  nr,
uInt  dataStride 
) const
protectedvirtual

◆ _minMaxNpts() [3/8]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
virtual void casacore::ConstrainedRangeStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_minMaxNpts ( uInt64 npts,
CountedPtr< AccumType > &  mymin,
CountedPtr< AccumType > &  mymax,
const DataIterator &  dataBegin,
const WeightsIterator &  weightsBegin,
uInt64  nr,
uInt  dataStride,
const DataRanges ranges,
Bool  isInclude 
) const
protectedvirtual

◆ _minMaxNpts() [4/8]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
virtual void casacore::ConstrainedRangeStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_minMaxNpts ( uInt64 npts,
CountedPtr< AccumType > &  mymin,
CountedPtr< AccumType > &  mymax,
const DataIterator &  dataBegin,
const WeightsIterator &  weightsBegin,
uInt64  nr,
uInt  dataStride,
const MaskIterator &  maskBegin,
uInt  maskStride,
const DataRanges ranges,
Bool  isInclude 
) const
protectedvirtual

◆ _minMaxNpts() [5/8]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
virtual void casacore::ConstrainedRangeStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_minMaxNpts ( uInt64 npts,
CountedPtr< AccumType > &  mymin,
CountedPtr< AccumType > &  mymax,
const DataIterator &  dataBegin,
uInt64  nr,
uInt  dataStride 
) const
protectedvirtual

Sometimes we want the min, max, and npts all in one scan.

◆ _minMaxNpts() [6/8]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
virtual void casacore::ConstrainedRangeStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_minMaxNpts ( uInt64 npts,
CountedPtr< AccumType > &  mymin,
CountedPtr< AccumType > &  mymax,
const DataIterator &  dataBegin,
uInt64  nr,
uInt  dataStride,
const DataRanges ranges,
Bool  isInclude 
) const
protectedvirtual

◆ _minMaxNpts() [7/8]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
virtual void casacore::ConstrainedRangeStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_minMaxNpts ( uInt64 npts,
CountedPtr< AccumType > &  mymin,
CountedPtr< AccumType > &  mymax,
const DataIterator &  dataBegin,
uInt64  nr,
uInt  dataStride,
const MaskIterator &  maskBegin,
uInt  maskStride 
) const
protectedvirtual

◆ _minMaxNpts() [8/8]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
virtual void casacore::ConstrainedRangeStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_minMaxNpts ( uInt64 npts,
CountedPtr< AccumType > &  mymin,
CountedPtr< AccumType > &  mymax,
const DataIterator &  dataBegin,
uInt64  nr,
uInt  dataStride,
const MaskIterator &  maskBegin,
uInt  maskStride,
const DataRanges ranges,
Bool  isInclude 
) const
protectedvirtual

◆ _setRange() [1/2]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
virtual void casacore::ConstrainedRangeStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_setRange ( )
protectedpure virtual

◆ _setRange() [2/2]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
void casacore::ConstrainedRangeStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_setRange ( CountedPtr< std::pair< AccumType, AccumType > >  r)
protected

This method is purposefully non-virtual.

Derived classes should implement the version with no parameters.

◆ _unweightedStats() [1/4]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
virtual void casacore::ConstrainedRangeStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_unweightedStats ( StatsData< AccumType > &  stats,
uInt64 ngood,
LocationType location,
const DataIterator &  dataBegin,
uInt64  nr,
uInt  dataStride 
)
protectedvirtual

no weights, no mask, no ranges

◆ _unweightedStats() [2/4]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
virtual void casacore::ConstrainedRangeStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_unweightedStats ( StatsData< AccumType > &  stats,
uInt64 ngood,
LocationType location,
const DataIterator &  dataBegin,
uInt64  nr,
uInt  dataStride,
const DataRanges ranges,
Bool  isInclude 
)
protectedvirtual

no weights, no mask

◆ _unweightedStats() [3/4]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
virtual void casacore::ConstrainedRangeStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_unweightedStats ( StatsData< AccumType > &  stats,
uInt64 ngood,
LocationType location,
const DataIterator &  dataBegin,
uInt64  nr,
uInt  dataStride,
const MaskIterator &  maskBegin,
uInt  maskStride 
)
protectedvirtual

◆ _unweightedStats() [4/4]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
virtual void casacore::ConstrainedRangeStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_unweightedStats ( StatsData< AccumType > &  stats,
uInt64 ngood,
LocationType location,
const DataIterator &  dataBegin,
uInt64  nr,
uInt  dataStride,
const MaskIterator &  maskBegin,
uInt  maskStride,
const DataRanges ranges,
Bool  isInclude 
)
protectedvirtual

◆ _weightedStats() [1/4]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
virtual void casacore::ConstrainedRangeStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_weightedStats ( StatsData< AccumType > &  stats,
LocationType location,
const DataIterator &  dataBegin,
const WeightsIterator &  weightBegin,
uInt64  nr,
uInt  dataStride,
const MaskIterator &  maskBegin,
uInt  maskStride 
)
protectedvirtual

◆ _weightedStats() [2/4]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
virtual void casacore::ConstrainedRangeStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_weightedStats ( StatsData< AccumType > &  stats,
LocationType location,
const DataIterator &  dataBegin,
const WeightsIterator &  weightBegin,
uInt64  nr,
uInt  dataStride,
const MaskIterator &  maskBegin,
uInt  maskStride,
const DataRanges ranges,
Bool  isInclude 
)
protectedvirtual

◆ _weightedStats() [3/4]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
virtual void casacore::ConstrainedRangeStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_weightedStats ( StatsData< AccumType > &  stats,
LocationType location,
const DataIterator &  dataBegin,
const WeightsIterator &  weightsBegin,
uInt64  nr,
uInt  dataStride 
)
protectedvirtual

has weights, but no mask, no ranges

◆ _weightedStats() [4/4]

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
virtual void casacore::ConstrainedRangeStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_weightedStats ( StatsData< AccumType > &  stats,
LocationType location,
const DataIterator &  dataBegin,
const WeightsIterator &  weightsBegin,
uInt64  nr,
uInt  dataStride,
const DataRanges ranges,
Bool  isInclude 
)
protectedvirtual

◆ getMedian()

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
virtual AccumType casacore::ConstrainedRangeStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::getMedian ( CountedPtr< uInt64 knownNpts = nullptr,
CountedPtr< AccumType >  knownMin = nullptr,
CountedPtr< AccumType >  knownMax = nullptr,
uInt  binningThreshholdSizeBytes = 4096 *4096,
Bool  persistSortedArray = False,
uInt  nBins = 10000 
)
virtual

In the following group of methods, if the size of the composite dataset is smaller than binningThreshholdSizeBytes, the composite dataset will be (perhaps partially) sorted and persisted in memory during the call.

In that case, and if persistSortedArray is True, this sorted array will remain in memory after the call and will be used on subsequent calls of this method when binningThreshholdSizeBytes is greater than the size of the composite dataset. If persistSortedArray is False, the sorted array will not be stored after this call completes and so any subsequent calls for which the dataset size is less than binningThreshholdSizeBytes, the dataset will be sorted from scratch. Values which are not included due to non-unity strides, are not included in any specified ranges, are masked, or have associated weights of zero are not considered as dataset members for quantile computations. If one has a priori information regarding the number of points (npts) and/or the minimum and maximum values of the data set, these can be supplied to improve performance. Note however, that if these values are not correct, the resulting median and/or quantile values will also not be correct (although see the following notes regarding max/min). Note that if this object has already had getStatistics() called, and the min and max were calculated, there is no need to pass these values in as they have been stored internally and used (although passing them in shouldn't hurt anything). If provided, npts, the number of points falling in the specified ranges which are not masked and have weights > 0, should be exactly correct. min can be less than the true minimum, and max can be greater than the True maximum, but for best performance, these should be as close to the actual min and max as possible. In order for quantile computations to occur over multiple datasets, all datasets must be available. This means that if setCalculateAsAdded() was previously called by passing in a value of True, these methods will throw an exception as the previous call indicates that there is no guarantee that all datasets will be available. If one uses a data provider (by having called setDataProvider()), then this should not be an issue.

get the median of the distribution. For a dataset with an odd number of good points, the median is just the value at index int(N/2) in the equivalent sorted dataset, where N is the number of points. For a dataset with an even number of points, the median is the mean of the values at indices int(N/2)-1 and int(N/2) in the sorted dataset.

◆ getMedianAbsDevMed()

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
virtual AccumType casacore::ConstrainedRangeStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::getMedianAbsDevMed ( CountedPtr< uInt64 knownNpts = nullptr,
CountedPtr< AccumType >  knownMin = nullptr,
CountedPtr< AccumType >  knownMax = nullptr,
uInt  binningThreshholdSizeBytes = 4096 *4096,
Bool  persistSortedArray = False,
uInt  nBins = 10000 
)
virtual

get the median of the absolute deviation about the median of the data.

◆ getMedianAndQuantiles()

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
virtual AccumType casacore::ConstrainedRangeStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::getMedianAndQuantiles ( std::map< Double, AccumType > &  quantileToValue,
const std::set< Double > &  quantiles,
CountedPtr< uInt64 knownNpts = nullptr,
CountedPtr< AccumType >  knownMin = nullptr,
CountedPtr< AccumType >  knownMax = nullptr,
uInt  binningThreshholdSizeBytes = 4096 *4096,
Bool  persistSortedArray = False,
uInt  nBins = 10000 
)
virtual

If one needs to compute both the median and quantile values, it is better to call getMedianAndQuantiles() rather than getMedian() and getQuantiles() separately, as the first will scan large data sets fewer times than calling the seperate methods.

The return value is the median; the quantiles are returned in the quantileToValue map.

◆ getMinMax()

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
virtual void casacore::ConstrainedRangeStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::getMinMax ( AccumType &  mymin,
AccumType &  mymax 
)
virtual

get the min and max of the data set

◆ getNPts()

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
virtual uInt64 casacore::ConstrainedRangeStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::getNPts ( )
virtual

scan the dataset(s) that have been added, and find the number of good points.

This method may be called even if setStatsToCaclulate has been called and NPTS has been excluded. If setCalculateAsAdded(True) has previously been called after this object has been (re)initialized, an exception will be thrown.

Reimplemented from casacore::ClassicalStatistics< CASA_STATP >.

Reimplemented in casacore::FitToHalfStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >.

◆ getQuantiles()

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
virtual std::map<Double, AccumType> casacore::ConstrainedRangeStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::getQuantiles ( const std::set< Double > &  quantiles,
CountedPtr< uInt64 knownNpts = nullptr,
CountedPtr< AccumType >  knownMin = nullptr,
CountedPtr< AccumType >  knownMax = NULL,
uInt  binningThreshholdSizeBytes = 4096 *4096,
Bool  persistSortedArray = False,
uInt  nBins = 10000 
)
virtual

Get the specified quantiles.

quantiles must be between 0 and 1, noninclusive.

◆ getStatisticIndex()

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
virtual LocationType casacore::ConstrainedRangeStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::getStatisticIndex ( StatisticsData::STATS  stat)
virtual

see base class description

Reimplemented from casacore::ClassicalStatistics< CASA_STATP >.

◆ operator=()

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
ConstrainedRangeStatistics<CASA_STATP>& casacore::ConstrainedRangeStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::operator= ( const ConstrainedRangeStatistics< CASA_STATP > &  other)
protected

copy semantics

◆ reset()

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
virtual void casacore::ConstrainedRangeStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::reset ( )
virtual

Member Data Documentation

◆ _range

template<class AccumType , class DataIterator , class MaskIterator = const Bool*, class WeightsIterator = DataIterator>
CountedPtr<std::pair<AccumType, AccumType> > casacore::ConstrainedRangeStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >::_range
private

Definition at line 410 of file ConstrainedRangeStatistics.h.


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