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();
168 const DataIterator& dataBegin,
Int64 nr,
uInt dataStride
174 const DataIterator& dataBegin,
Int64 nr,
uInt dataStride,
180 const DataIterator& dataBegin,
Int64 nr,
uInt dataStride,
181 const MaskIterator& maskBegin,
uInt maskStride
186 const DataIterator& dataBegin,
Int64 nr,
uInt dataStride,
187 const MaskIterator& maskBegin,
uInt maskStride,
201 const DataIterator& dataBegin,
const WeightsIterator& weightsBegin,
207 const DataIterator& dataBegin,
const WeightsIterator& weightsBegin,
213 const DataIterator& dataBegin,
const WeightsIterator& weightBegin,
214 Int64 nr,
uInt dataStride,
const MaskIterator& maskBegin,
uInt maskStride
219 const DataIterator& dataBegin,
const WeightsIterator& weightBegin,
220 Int64 nr,
uInt dataStride,
const MaskIterator& maskBegin,
uInt maskStride,
244 #ifndef CASACORE_NO_AUTO_TEMPLATES 245 #include <casacore/scimath/Mathematics/FitToHalfStatistics.tcc> 246 #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.
virtual StatsData< AccumType > _getInitialStats() const
virtual StatisticsData::ALGORITHM algorithm() const
get the algorithm that this object uses for computing stats
unsigned long long uInt64
std::pair< Int64, Int64 > LocationType
StatsData< AccumType > _statsData
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
const StatsData< AccumType > & _getStatsData() const
ALGORITHM
implemented algorithms
StatsData< AccumType > _getStatistics()
CENTER
choice of center point based on the corresponding statistics from the entire distribution of data...
void _unweightedStats(StatsData< AccumType > &stats, uInt64 &ngood, LocationType &location, const DataIterator &dataBegin, Int64 nr, uInt dataStride)
no weights, no mask, no ranges
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)
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.
void _updateDataProviderMaxMin(const StatsData< AccumType > &threadStats)
CountedPtr< AccumType > _realMax
these are the max and min for the real portion of the dataset
void _weightedStats(StatsData< AccumType > &stats, LocationType &location, const DataIterator &dataBegin, const WeightsIterator &weightsBegin, Int64 nr, uInt dataStride)
has weights, but no mask, no ranges
const Double c
Fundamental physical constants (SI units):
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.