26 #ifndef SCIMATH_CONSTRAINEDRANGESTATISTICS_H
27 #define SCIMATH_CONSTRAINEDRANGESTATISTICS_H
46 class AccumType,
class DataIterator,
class MaskIterator=
const Bool*,
47 class WeightsIterator=DataIterator
103 uInt binningThreshholdSizeBytes=4096*4096,
112 uInt binningThreshholdSizeBytes=4096*4096,
122 std::map<Double, AccumType>& quantileToValue,
123 const std::set<Double>& quantiles,
127 uInt binningThreshholdSizeBytes=4096*4096,
134 const std::set<Double>& quantiles,
138 uInt binningThreshholdSizeBytes=4096*4096,
144 virtual void getMinMax(AccumType& mymin, AccumType& mymax);
158 virtual void reset();
191 const DataIterator& dataStart,
uInt64 nr,
uInt dataStride,
197 const MaskIterator& maskBegin,
uInt maskStride
202 const DataIterator& dataBegin,
uInt64 nr,
uInt dataStride,
203 const MaskIterator& maskBegin,
uInt maskStride,
208 uInt64& npts,
const DataIterator& dataBegin,
209 const WeightsIterator& weightsBegin,
uInt64 nr,
uInt dataStride
213 uInt64& npts,
const DataIterator& dataBegin,
214 const WeightsIterator& weightsBegin,
uInt64 nr,
uInt dataStride,
219 uInt64& npts,
const DataIterator& dataBegin,
220 const WeightsIterator& weightsBegin,
uInt64 nr,
uInt dataStride,
221 const MaskIterator& maskBegin,
uInt maskStride,
226 uInt64& npts,
const DataIterator& dataBegin,
227 const WeightsIterator& weightBegin,
uInt64 nr,
uInt dataStride,
228 const MaskIterator& maskBegin,
uInt maskStride
239 const DataIterator& dataBegin,
uInt64 nr,
uInt dataStride
244 const DataIterator& dataBegin,
uInt64 nr,
uInt dataStride,
250 const DataIterator& dataBegin,
uInt64 nr,
uInt dataStride,
251 const MaskIterator& maskBegin,
uInt maskStride
256 const DataIterator& dataBegin,
uInt64 nr,
uInt dataStride,
257 const MaskIterator& maskBegin,
uInt maskStride,
263 const DataIterator& dataBegin,
const WeightsIterator& weightsBegin,
269 const DataIterator& dataBegin,
const WeightsIterator& weightsBegin,
275 const DataIterator& dataBegin,
const WeightsIterator& weightsBegin,
276 uInt64 nr,
uInt dataStride,
const MaskIterator& maskBegin,
282 const DataIterator& dataBegin,
const WeightsIterator& weightBegin,
283 uInt64 nr,
uInt dataStride,
const MaskIterator& maskBegin,
305 uInt dataStride,
const MaskIterator& maskBegin,
uInt maskStride
311 uInt dataStride,
const MaskIterator& maskBegin,
uInt maskStride,
318 const WeightsIterator& weightsBegin,
uInt64 nr,
uInt dataStride
324 const WeightsIterator& weightsBegin,
uInt64 nr,
uInt dataStride,
331 const WeightsIterator& weightsBegin,
uInt64 nr,
uInt dataStride,
332 const MaskIterator& maskBegin,
uInt maskStride,
339 const WeightsIterator& weightBegin,
uInt64 nr,
uInt dataStride,
340 const MaskIterator& maskBegin,
uInt maskStride
355 const DataIterator& dataBegin,
uInt64 nr,
uInt dataStride
361 const DataIterator& dataBegin,
uInt64 nr,
uInt dataStride,
367 const DataIterator& dataBegin,
uInt64 nr,
uInt dataStride,
368 const MaskIterator& maskBegin,
uInt maskStride
373 const DataIterator& dataBegin,
uInt64 nr,
uInt dataStride,
374 const MaskIterator& maskBegin,
uInt maskStride,
383 const DataIterator& dataBegin,
const WeightsIterator& weightsBegin,
389 const DataIterator& dataBegin,
const WeightsIterator& weightsBegin,
395 const DataIterator& dataBegin,
const WeightsIterator& weightBegin,
396 uInt64 nr,
uInt dataStride,
const MaskIterator& maskBegin,
402 const DataIterator& dataBegin,
const WeightsIterator& weightBegin,
403 uInt64 nr,
uInt dataStride,
const MaskIterator& maskBegin,
416 #ifndef CASACORE_NO_AUTO_TEMPLATES
417 #include <casacore/scimath/StatsFramework/ConstrainedRangeStatistics.tcc>
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 binningThresh...
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.
virtual void _setRange()=0
derived classes need to implement how to set their respective range
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.
Bool _calculateAsAdded False
virtual ~ConstrainedRangeStatistics()
unsigned long long uInt64
CountedPtr< std::pair< AccumType, AccumType > > _range
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
Class to calculate statistics in a "classical" sense, ie using accumulators with no special filtering...
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 getMedianAndQuantil...
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.
virtual void _minMax(CountedPtr< AccumType > &mymin, CountedPtr< AccumType > &mymax, const DataIterator &dataBegin, uInt64 nr, uInt dataStride) const
virtual uInt64 getNPts()
scan the dataset(s) that have been added, and find the number of good points.
Referenced counted pointer for constant data.
virtual AccumType _getStatistic(StatisticsData::STATS stat)
ConstrainedRangeStatistics< CASA_STATP > & operator=(const ConstrainedRangeStatistics< CASA_STATP > &other)
copy semantics
std::pair< Int64, Int64 > LocationType
virtual LocationType getStatisticIndex(StatisticsData::STATS stat)
see base class description
bool Bool
Define the standard types used by Casacore.
virtual void reset()
reset object to initial state.
Abstract base class for statistics algorithms which are characterized by a range of good values...
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...
ConstrainedRangeStatistics()=delete
virtual void _unweightedStats(StatsData< AccumType > &stats, uInt64 &ngood, LocationType &location, const DataIterator &dataBegin, uInt64 nr, uInt dataStride)
no weights, no mask, no ranges
virtual StatsData< AccumType > _getStatistics()
virtual void getMinMax(AccumType &mymin, AccumType &mymax)
get the min and max of the data set
#define casacore
<X11/Intrinsic.h> #defines true, false, casacore::Bool, and String.