26 #ifndef SCIMATH_HINGESFENCESSTATISTICS_H
27 #define SCIMATH_HINGESFENCESSTATISTICS_H
29 #include <casacore/casa/aips.h>
31 #include <casacore/scimath/StatsFramework/ConstrainedRangeStatistics.h>
50 class AccumType,
class DataIterator,
class MaskIterator=
const Bool *,
51 class WeightsIterator=DataIterator
106 const MaskIterator& maskBegin,
uInt maskStride
111 const MaskIterator& maskBegin,
uInt maskStride,
116 uInt64& npts,
const DataIterator& dataBegin,
117 const WeightsIterator& weightsBegin,
uInt64 nr,
uInt dataStride
122 const DataIterator& dataBegin,
const WeightsIterator& weightsBegin,
128 const DataIterator& dataBegin,
const WeightsIterator& weightsBegin,
129 uInt64 nr,
uInt dataStride,
const MaskIterator& maskBegin,
134 uInt64& npts,
const DataIterator& dataBegin,
135 const WeightsIterator& weightBegin,
uInt64 nr,
uInt dataStride,
136 const MaskIterator& maskBegin,
uInt maskStride
143 const DataIterator& dataBegin,
uInt64 nr,
uInt dataStride
148 const DataIterator& dataBegin,
uInt64 nr,
uInt dataStride,
154 const DataIterator& dataBegin,
uInt64 nr,
uInt dataStride,
155 const MaskIterator& maskBegin,
uInt maskStride
160 const DataIterator& dataBegin,
uInt64 nr,
uInt dataStride,
161 const MaskIterator& maskBegin,
167 const DataIterator& dataBegin,
const WeightsIterator& weightsBegin,
173 const DataIterator& dataBegin,
const WeightsIterator& weightsBegin,
179 const DataIterator& dataBegin,
const WeightsIterator& weightsBegin,
180 uInt64 nr,
uInt dataStride,
const MaskIterator& maskBegin,
186 const DataIterator& dataBegin,
const WeightsIterator& weightBegin,
187 uInt64 nr,
uInt dataStride,
const MaskIterator& maskBegin,
208 uInt dataStride,
const MaskIterator& maskBegin,
uInt maskStride
214 uInt dataStride,
const MaskIterator& maskBegin,
uInt maskStride,
221 const WeightsIterator& weightsBegin,
uInt64 nr,
uInt dataStride
227 const WeightsIterator& weightsBegin,
uInt64 nr,
uInt dataStride,
234 const WeightsIterator& weightsBegin,
uInt64 nr,
uInt dataStride,
235 const MaskIterator& maskBegin,
uInt maskStride,
242 const WeightsIterator& weightBegin,
uInt64 nr,
uInt dataStride,
243 const MaskIterator& maskBegin,
uInt maskStride
251 const DataIterator& dataBegin,
uInt64 nr,
uInt dataStride
257 const DataIterator& dataBegin,
uInt64 nr,
uInt dataStride,
263 const DataIterator& dataBegin,
uInt64 nr,
uInt dataStride,
264 const MaskIterator& maskBegin,
uInt maskStride
269 const DataIterator& dataBegin,
uInt64 nr,
uInt dataStride,
270 const MaskIterator& maskBegin,
uInt maskStride,
279 const DataIterator& dataBegin,
const WeightsIterator& weightsBegin,
285 const DataIterator& dataBegin,
const WeightsIterator& weightsBegin,
291 const DataIterator& dataBegin,
const WeightsIterator& weightBegin,
292 uInt64 nr,
uInt dataStride,
const MaskIterator& maskBegin,
298 const DataIterator& dataBegin,
const WeightsIterator& weightBegin,
299 uInt64 nr,
uInt dataStride,
const MaskIterator& maskBegin,
317 #ifndef CASACORE_NO_AUTO_TEMPLATES
318 #include <casacore/scimath/StatsFramework/HingesFencesStatistics.tcc>
Abstract base class for statistics algorithms which are characterized by a range of good values.
Class to calculate statistics using the so-called hinges and fences algorithm.
void _setRange()
derived classes need to implement how to set their respective range
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 _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
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 _weightedStats(StatsData< AccumType > &stats, LocationType &location, const DataIterator &dataBegin, const WeightsIterator &weightsBegin, uInt64 nr, uInt dataStride, const DataRanges &ranges, Bool isInclude)
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 _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 _minMax(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, uInt64 nr, uInt dataStride, const MaskIterator &maskBegin, uInt maskStride) const
virtual void _accumNpts(uInt64 &npts, const DataIterator &dataBegin, const WeightsIterator &weightsBegin, uInt64 nr, uInt dataStride) const
Double _f
_f defined in inclusion range between Q1 - _f*D and Q3 + _f*D, where D = Q3 - Q1 and Q1 and Q3 are th...
virtual void _accumNpts(uInt64 &npts, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const MaskIterator &maskBegin, uInt maskStride, const DataRanges &ranges, Bool isInclude) const
void setCalculateAsAdded(Bool c)
This class does not allow statistics to be calculated as datasets are added, so an exception will be ...
virtual void _minMax(CountedPtr< AccumType > &mymin, CountedPtr< AccumType > &mymax, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const MaskIterator &maskBegin, uInt maskStride) const
virtual void _accumNpts(uInt64 &npts, const DataIterator &dataBegin, const WeightsIterator &weightBegin, uInt64 nr, uInt dataStride, const MaskIterator &maskBegin, uInt maskStride) const
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
HingesFencesStatistics(const HingesFencesStatistics< CASA_STATP > &other)
copy semantics
virtual void _weightedStats(StatsData< AccumType > &stats, LocationType &location, const DataIterator &dataBegin, const WeightsIterator &weightBegin, uInt64 nr, uInt dataStride, const MaskIterator &maskBegin, uInt maskStride)
virtual ~HingesFencesStatistics()
virtual void _minMaxNpts(uInt64 &npts, CountedPtr< AccumType > &mymin, CountedPtr< AccumType > &mymax, const DataIterator &dataBegin, const WeightsIterator &weightsBegin, uInt64 nr, uInt dataStride) const
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)
no weights, no mask, no ranges
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)
virtual void _accumNpts(uInt64 &npts, 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, 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 MaskIterator &maskBegin, uInt maskStride, const DataRanges &ranges, Bool isInclude) const
virtual StatisticsData::ALGORITHM algorithm() const
get the algorithm that this object uses for computing stats
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, uInt64 nr, uInt dataStride, const DataRanges &ranges, Bool isInclude) const
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
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, uInt64 nr, uInt dataStride, const MaskIterator &maskBegin, uInt maskStride, const DataRanges &ranges, Bool isInclude) const
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...
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
HingesFencesStatistics(Double f=-1.0)
If f is negative, the full dataset is used; ie the object has the same behavior as a ClassicalStatist...
virtual void _minMax(CountedPtr< AccumType > &mymin, CountedPtr< AccumType > &mymax, const DataIterator &dataBegin, uInt64 nr, uInt dataStride) const
virtual StatisticsAlgorithm< CASA_STATP > * clone() const
Clone this instance.
HingesFencesStatistics< CASA_STATP > & operator=(const HingesFencesStatistics< CASA_STATP > &other)
copy semantics
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, const WeightsIterator &weightsBegin, uInt64 nr, uInt dataStride, const DataRanges &ranges, Bool isInclude) const
virtual void reset()
reset object to initial state.
ALGORITHM
implemented algorithms
const Double c
Fundamental physical constants (SI units):
this file contains all the compiler specific defines
bool Bool
Define the standard types used by Casacore.
unsigned long long uInt64
std::pair< Int64, Int64 > LocationType