27 #ifndef SCIMATH_FITTOHALFSTATISTICS_H 28 #define SCIMATH_FITTOHALFSTATISTICS_H 30 #include <casacore/casa/aips.h> 32 #include <casacore/scimath/Mathematics/ConstrainedRangeStatistics.h> 33 #include <casacore/scimath/Mathematics/FitToHalfStatisticsData.h> 46 template <
class AccumType,
class DataIterator,
class MaskIterator=const Bool *,
class WeightsIterator=DataIterator>
51 const static AccumType
TWO;
109 std::map<Double, AccumType>& quantiles,
const std::set<Double>& fractions,
112 uInt binningThreshholdSizeBytes=4096*4096,
Bool persistSortedArray=
False,
120 uInt binningThreshholdSizeBytes=4096*4096,
Bool persistSortedArray=
False,
129 uInt binningThreshholdSizeBytes=4096*4096,
Bool persistSortedArray=
False,
137 virtual void getMinMax(AccumType& mymin, AccumType& mymax);
148 virtual void reset();
167 uInt64& ngood, AccumType& mymin, AccumType& mymax,
169 const DataIterator& dataBegin,
Int64 nr,
uInt dataStride
174 uInt64& ngood, AccumType& mymin, AccumType& mymax,
176 const DataIterator& dataBegin,
Int64 nr,
uInt dataStride,
181 uInt64& ngood, AccumType& mymin, AccumType& mymax,
183 const DataIterator& dataBegin,
Int64 nr,
uInt dataStride,
184 const MaskIterator& maskBegin,
uInt maskStride
188 uInt64& ngood, AccumType& mymin, AccumType& mymax,
190 const DataIterator& dataBegin,
Int64 nr,
uInt dataStride,
191 const MaskIterator& maskBegin,
uInt maskStride,
197 AccumType mymin, AccumType mymax,
Int64 minpos,
204 AccumType& mymin, AccumType& mymax,
206 const DataIterator& dataBegin,
const WeightsIterator& weightsBegin,
211 AccumType& mymin, AccumType& mymax,
213 const DataIterator& dataBegin,
const WeightsIterator& weightsBegin,
218 AccumType& mymin, AccumType& mymax,
220 const DataIterator& dataBegin,
const WeightsIterator& weightBegin,
221 Int64 nr,
uInt dataStride,
const MaskIterator& maskBegin,
uInt maskStride
225 AccumType& mymin, AccumType& mymax,
227 const DataIterator& dataBegin,
const WeightsIterator& weightBegin,
228 Int64 nr,
uInt dataStride,
const MaskIterator& maskBegin,
uInt maskStride,
252 #ifndef CASACORE_NO_AUTO_TEMPLATES 253 #include <casacore/scimath/Mathematics/FitToHalfStatistics.tcc> 254 #endif //# CASACORE_NO_AUTO_TEMPLATES virtual void reset()
reset object to initial state.
AccumType getMedian(CountedPtr< uInt64 > knownNpts=NULL, CountedPtr< AccumType > knownMin=NULL, CountedPtr< AccumType > knownMax=NULL, uInt binningThreshholdSizeBytes=4096 *4096, Bool persistSortedArray=False, uInt64 nBins=10000)
The median is just the center value, so none of the parameters to this method are used...
virtual ~FitToHalfStatistics()
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size)
StatsData< AccumType > & _getStatsData()
retreive stats structure.
void _weightedStats(AccumType &mymin, AccumType &mymax, Int64 &minpos, Int64 &maxpos, const DataIterator &dataBegin, const WeightsIterator &weightsBegin, Int64 nr, uInt dataStride)
has weights, but no mask, no ranges
unsigned long long uInt64
StatsData< AccumType > _statsData
void _unweightedStats(uInt64 &ngood, AccumType &mymin, AccumType &mymax, Int64 &minpos, Int64 &maxpos, const DataIterator &dataBegin, Int64 nr, uInt dataStride)
no weights, no mask, no ranges
USE_DATA
which section of data to use, greater than or less than the center value
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
StatsData< AccumType > _getStatistics()
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...
AccumType getMedianAndQuantiles(std::map< Double, AccumType > &quantiles, const std::set< Double > &fractions, CountedPtr< uInt64 > knownNpts=NULL, CountedPtr< AccumType > knownMin=NULL, CountedPtr< AccumType > knownMax=NULL, uInt binningThreshholdSizeBytes=4096 *4096, Bool persistSortedArray=False, uInt64 nBins=10000)
In the following group of methods, if the size of the composite dataset is smaller than binningThresh...
CountedPtr< AccumType > _realMin
Referenced counted pointer for constant data.
void _getRealMinMax(CountedPtr< AccumType > &realMin, CountedPtr< AccumType > &realMax, CountedPtr< AccumType > knownMin, CountedPtr< AccumType > knownMax)
virtual void _updateMaxMin(AccumType mymin, AccumType mymax, Int64 minpos, Int64 maxpos, uInt dataStride, const Int64 ¤tDataset)
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.
#define DataRanges
Commonly used types in statistics framework.
bool Bool
Define the standard types used by Casacore.
static const AccumType TWO
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.
std::map< Double, AccumType > getQuantiles(const std::set< Double > &fractions, CountedPtr< uInt64 > knownNpts=NULL, CountedPtr< AccumType > knownMin=NULL, CountedPtr< AccumType > knownMax=NULL, uInt binningThreshholdSizeBytes=4096 *4096, Bool persistSortedArray=False, uInt64 nBins=10000)
Get the specified quantiles.
CountedPtr< AccumType > _realMax
these are the max and min for the real portion of the dataset
const Double c
Fundamental physical constants (SI units):
virtual void _clearData()
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.
AccumType getMedianAbsDevMed(CountedPtr< uInt64 > knownNpts=NULL, CountedPtr< AccumType > knownMin=NULL, CountedPtr< AccumType > knownMax=NULL, uInt binningThreshholdSizeBytes=4096 *4096, Bool persistSortedArray=False, uInt64 nBins=10000)
get the median of the absolute deviation about the median of the data.
this file contains all the compiler specific defines
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.