26 #ifndef SCIMATH_FITTOHALFSTATISTICS_H
27 #define SCIMATH_FITTOHALFSTATISTICS_H
51 class AccumType,
class DataIterator,
class MaskIterator=
const Bool *,
52 class WeightsIterator=DataIterator
58 const static AccumType
TWO;
92 uInt binningThreshholdSizeBytes=4096*4096,
126 std::map<Double, AccumType>& quantiles,
127 const std::set<Double>& fractions,
131 uInt binningThreshholdSizeBytes=4096*4096,
140 uInt binningThreshholdSizeBytes=4096*4096,
147 const std::set<Double>& fractions,
151 uInt binningThreshholdSizeBytes=4096*4096,
159 virtual void getMinMax(AccumType& mymin, AccumType& mymax);
171 virtual void reset();
197 const DataIterator& dataBegin,
uInt64 nr,
uInt dataStride
203 const DataIterator& dataBegin,
uInt64 nr,
uInt dataStride,
209 const DataIterator& dataBegin,
uInt64 nr,
uInt dataStride,
210 const MaskIterator& maskBegin,
uInt maskStride
215 const DataIterator& dataBegin,
uInt64 nr,
uInt dataStride,
216 const MaskIterator& maskBegin,
uInt maskStride,
227 const DataIterator& dataBegin,
const WeightsIterator& weightsBegin,
233 const DataIterator& dataBegin,
const WeightsIterator& weightsBegin,
239 const DataIterator& dataBegin,
const WeightsIterator& weightBegin,
240 uInt64 nr,
uInt dataStride,
const MaskIterator& maskBegin,
246 const DataIterator& dataBegin,
const WeightsIterator& weightBegin,
247 uInt64 nr,
uInt dataStride,
const MaskIterator& maskBegin,
282 #ifndef CASACORE_NO_AUTO_TEMPLATES
283 #include <casacore/scimath/StatsFramework/FitToHalfStatistics.tcc>
virtual void reset()
reset object to initial state.
AccumType getMedianAndQuantiles(std::map< Double, AccumType > &quantiles, const std::set< Double > &fractions, 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...
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 ~FitToHalfStatistics()
StatsData< AccumType > & _getStatsData()
Retrieve stats structure.
CountedPtr< std::pair< AccumType, AccumType > > _range
This is used for convenience and performance.
Bool _calculateAsAdded False
void _weightedStats(StatsData< AccumType > &stats, LocationType &location, const DataIterator &dataBegin, const WeightsIterator &weightsBegin, uInt64 nr, uInt dataStride)
has weights, but no mask, no ranges
unsigned long long uInt64
AccumType getMedian(CountedPtr< uInt64 > knownNpts=nullptr, CountedPtr< AccumType > knownMin=nullptr, CountedPtr< AccumType > knownMax=nullptr, uInt binningThreshholdSizeBytes=4096 *4096, Bool persistSortedArray=False, uInt nBins=10000)
The median is just the center value, so none of the parameters to this method are used...
void _setRange()
derived classes need to implement how to set their respective range
StatsData< AccumType > _statsData
USE_DATA
which section of data to use, greater than or less than the center value
virtual StatsData< AccumType > _getStatistics()
FitToHalfStatistics(FitToHalfStatisticsData::CENTER center=FitToHalfStatisticsData::CMEAN, FitToHalfStatisticsData::USE_DATA useData=FitToHalfStatisticsData::LE_CENTER, AccumType value=0)
value is only used if center=CVALUE
FitToHalfStatisticsData::CENTER _centerType
ALGORITHM
implemented algorithms
virtual StatisticsData::ALGORITHM algorithm() const
get the algorithm that this object uses for computing stats
CENTER
choice of center point based on the corresponding statistics from the entire distribution of data...
CountedPtr< AccumType > _realMin
Referenced counted pointer for constant data.
std::pair< Int64, Int64 > LocationType
void setCalculateAsAdded(Bool c)
This class does not allow statistics to be calculated as datasets are added, so an exception will be ...
Class to calculate statistics using the so-called fit to half algorithm.
bool Bool
Define the standard types used by Casacore.
std::map< Double, AccumType > getQuantiles(const std::set< Double > &fractions, CountedPtr< uInt64 > knownNpts=nullptr, CountedPtr< AccumType > knownMin=nullptr, CountedPtr< AccumType > knownMax=nullptr, uInt binningThreshholdSizeBytes=4096 *4096, Bool persistSortedArray=False, uInt nBins=10000)
Get the specified quantiles.
static const AccumType TWO
void _getRealMinMax(AccumType &realMin, AccumType &realMax)
get the min/max of the real portion only of the dataset
virtual StatisticsAlgorithm< CASA_STATP > * clone() const
Clone this instance.
Abstract base class for statistics algorithms which are characterized by a range of good values...
virtual void getMinMax(AccumType &mymin, AccumType &mymax)
scan the dataset(s) that have been added, and find the min and max.
void _updateDataProviderMaxMin(const StatsData< AccumType > &threadStats)
CountedPtr< AccumType > _realMax
these are the max and min for the real portion of the dataset
void _getMinMax(CountedPtr< AccumType > &realMin, CountedPtr< AccumType > &realMax, CountedPtr< AccumType > knownMin, CountedPtr< AccumType > knownMax)
get the min max of the entire (real + virtual) data set.
virtual StatsData< AccumType > _getInitialStats() const
virtual void setStatsToCalculate(std::set< StatisticsData::STATS > &stats)
Override base class method by requiring mean to be computed in addition to what is added in stats if ...
const Double c
Fundamental physical constants (SI units):
const StatsData< AccumType > & _getStatsData() const
FitToHalfStatistics< CASA_STATP > & operator=(const FitToHalfStatistics< CASA_STATP > &other)
copy semantics
uInt64 getNPts()
scan the dataset(s) that have been added, and find the number of good points.
void _unweightedStats(StatsData< AccumType > &stats, uInt64 &ngood, LocationType &location, const DataIterator &dataBegin, uInt64 nr, uInt dataStride)
no weights, no mask, no ranges
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
#define casacore
<X11/Intrinsic.h> #defines true, false, casacore::Bool, and String.