casacore
Loading...
Searching...
No Matches
StatisticsAlgorithmFactory.h
Go to the documentation of this file.
1// # Copyright (C) 2000,2001
2// # Associated Universities, Inc. Washington DC, USA.
3// #
4// # This library is free software; you can redistribute it and/or modify it
5// # under the terms of the GNU Library General Public License as published by
6// # the Free Software Foundation; either version 2 of the License, or (at your
7// # option) any later version.
8// #
9// # This library is distributed in the hope that it will be useful, but WITHOUT
10// # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11// # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12// # License for more details.
13// #
14// # You should have received a copy of the GNU Library General Public License
15// # along with this library; if not, write to the Free Software Foundation,
16// # Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
17// #
18// # Correspondence concerning AIPS++ should be addressed as follows:
19// # Internet email: casa-feedback@nrao.edu.
20// # Postal address: AIPS++ Project Office
21// # National Radio Astronomy Observatory
22// # 520 Edgemont Road
23// # Charlottesville, VA 22903-2475 USA
24// #
25
26#ifndef SCIMATH_STATSALGORITHMFACTORY_H
27#define SCIMATH_STATSALGORITHMFACTORY_H
28
29#include <casacore/scimath/Mathematics/NumericTraits.h>
30#include <casacore/scimath/StatsFramework/StatisticsAlgorithm.h>
31#include <casacore/scimath/StatsFramework/StatisticsAlgorithmFactoryData.h>
32#include <casacore/scimath/StatsFramework/StatisticsData.h>
33
34namespace casacore {
35
36// Provides a single interface for creation of stats algorithm objects
37
38template <class AccumType, class DataIterator, class MaskIterator = const Bool*,
39 class WeightsIterator = DataIterator>
41 public:
42 // to make copy() more straight forward to implement
43 template <class AccumType2, class DataIterator2, class MaskIterator2, class WeightsIterator2>
45
46 // upon construction, the object is configured to use the classical stats
47 // algorithm
49
51
52 void configureBiweight(Int maxIter = 3, Double c = 6.0);
53
55
56 // configure to use fit to half algorithm.
60 AccumType centerValue = 0);
61
62 // configure to use hinges-fences algorithm
64
65 // configure to use Chauvenet's criterion
66 void configureChauvenet(Double zscore = -1, Int maxIterations = -1);
67
68 // copy the data from this object to an object with different template
69 // types. Note that the AccumType of <src>other</src> must be the same as
70 // the AccumType of this object.
71 template <class DataIterator2, class MaskIterator2, class WeightsIterator2>
73 other) const;
74
75 // Create a pointer to an object of a class derived from StatisticsAlgorithm
76 // that reflects the current configuration
77 std::shared_ptr<StatisticsAlgorithm<CASA_STATP>> createStatsAlgorithm() const;
78
80
81 // Throws an exception if the current configuration is not relevant
82 // to the Biweight algorithm
84
85 // Throws an exception if the current configuration is not relevant
86 // to the Chauvenet/zscore algorithm
88
89 // Throws an exception if the current configuration is not relevant
90 // to the hinges-fences algorithm
92
93 // Throws an exception if the current configuration is not relevant
94 // to the fit-to-half algorithm
96
97 // create a record from the current configuration that can be used
98 // to create another object using the fromRecord() method.
100
101 // create an object from a record
103
104 private:
106 // hinges-fences f factor
111};
112
113} // namespace casacore
114
115#ifndef CASACORE_NO_AUTO_TEMPLATES
116#include <casacore/scimath/StatsFramework/StatisticsAlgorithmFactory.tcc>
117#endif
118
119#endif
USE_DATA
which section of data to use, greater than or less than the center value
CENTER
choice of center point based on the corresponding statistics from the entire distribution of data,...
StatisticsAlgorithmFactory()
upon construction, the object is configured to use the classical stats algorithm
static StatisticsAlgorithmFactory< CASA_STATP > fromRecord(const Record &r)
create an object from a record
void configureFitToHalf(FitToHalfStatisticsData::CENTER centerType=FitToHalfStatisticsData::CMEAN, FitToHalfStatisticsData::USE_DATA useData=FitToHalfStatisticsData::LE_CENTER, AccumType centerValue=0)
configure to use fit to half algorithm.
void configureChauvenet(Double zscore=-1, Int maxIterations=-1)
configure to use Chauvenet's criterion
std::shared_ptr< StatisticsAlgorithm< CASA_STATP > > createStatsAlgorithm() const
Create a pointer to an object of a class derived from StatisticsAlgorithm that reflects the current c...
StatisticsAlgorithmFactoryData::FitToHalfData< AccumType > _fitToHalfData
StatisticsAlgorithmFactoryData::BiweightData biweightData() const
Throws an exception if the current configuration is not relevant to the Biweight algorithm.
void configureHingesFences(Double f)
configure to use hinges-fences algorithm
void configureBiweight(Int maxIter=3, Double c=6.0)
friend class StatisticsAlgorithmFactory
to make copy() more straight forward to implement
void copy(StatisticsAlgorithmFactory< AccumType, DataIterator2, MaskIterator2, WeightsIterator2 > &other) const
copy the data from this object to an object with different template types.
Record toRecord() const
create a record from the current configuration that can be used to create another object using the fr...
StatisticsAlgorithmFactoryData::ChauvenetData _chauvData
StatisticsAlgorithmFactoryData::ChauvenetData chauvenetData() const
Throws an exception if the current configuration is not relevant to the Chauvenet/zscore algorithm.
StatisticsData::ALGORITHM algorithm() const
StatisticsAlgorithmFactoryData::BiweightData _biweightData
Double hingesFencesFactor() const
Throws an exception if the current configuration is not relevant to the hinges-fences algorithm.
StatisticsAlgorithmFactoryData::FitToHalfData< AccumType > fitToHalfData() const
Throws an exception if the current configuration is not relevant to the fit-to-half algorithm.
ALGORITHM
implemented algorithms
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28
int Int
Definition aipstype.h:48
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40
double Double
Definition aipstype.h:53