casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ImageStatsBase.h
Go to the documentation of this file.
1 //# Copyright (C) 1998,1999,2000,2001,2003
2 //# Associated Universities, Inc. Washington DC, USA.
3 //#
4 //# This program is free software; you can redistribute it and/or modify it
5 //# under the terms of the GNU General Public License as published by the Free
6 //# Software Foundation; either version 2 of the License, or (at your option)
7 //# any later version.
8 //#
9 //# This program 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 General Public License for
12 //# more details.
13 //#
14 //# You should have received a copy of the GNU General Public License along
15 //# with this program; if not, write to the Free Software Foundation, Inc.,
16 //# 675 Massachusetts Ave, Cambridge, MA 02139, USA.
17 //#
18 //# Correspondence concerning AIPS++ should be addressed as follows:
19 //# Internet email: aips2-request@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 //# $Id: tSubImage.cc 20567 2009-04-09 23:12:39Z gervandiepen $
26 
27 #ifndef IMAGEANALYSIS_IMAGESTATSBASE_H
28 #define IMAGEANALYSIS_IMAGESTATSBASE_H
29 
31 
33 
35 #include <casa/namespace.h>
36 
37 #include <memory>
38 
39 namespace casacore {
40 
41 template <class T> class CountedPtr;
42 
43 }
44 
45 namespace casa {
46 
47 class C11Timer;
48 
49 template <class T> class ImageStatsBase: public ImageTask<T> {
50 
51  // <summary>
52  // This adds configuration methods for statistics classes.
53  // </summary>
54 
55  // <reviewed reviewer="" date="" tests="" demos="">
56  // </reviewed>
57 
58  // <prerequisite>
59  // </prerequisite>
60 
61  // <etymology>
62  // Image statistics configuration
63  // </etymology>
64 
65  // <synopsis>
66  // This adds configuration methods for statistics classes.
67  // </synopsis>
68 
69 public:
70 
71  ImageStatsBase() = delete;
72 
74 
75  void configureBiweight(casacore::Int maxIter);
76 
77  void configureChauvenet(
78  casacore::Double zscore, casacore::Int maxIterations
79  );
80 
82 
83  // configure fit to half algorithm
84  void configureFitToHalf(
87  casacore::Double centerValue
88  );
89 
90  // configure hinges-fences algorithm
92 
93 protected:
94 
95  struct AlgConf {
97  // hinges-fences f factor
99  // fit to have center type
101  // fit to half data portion to use
103  // fit to half center value
104  T cv;
105  // Chauvenet zscore
107  // Chauvenet/Biweight max iterations
109  };
110 
112  const SPCIIT image,
113  const casacore::Record *const &regionPtr,
114  const casacore::String& maskInp,
115  const casacore::String& outname="",
116  casacore::Bool overwrite=false
117  );
118 
120 
121  std::unique_ptr<casacore::ImageStatistics<T>>& _getImageStats() {
122  return _statistics;
123  }
124 
126  return _algConf.algorithm;
127  }
128 
129  AlgConf _getAlgConf() const {
130  return _algConf;
131  }
132 
133  void _resetStats(ImageStatistics<T>* stat=nullptr) {
134  _statistics.reset(stat);
135  }
136 
137 private:
138 
139  std::unique_ptr<casacore::ImageStatistics<T>> _statistics;
140  AlgConf _algConf;
143 
144 };
145 
146 }
147 
148 #ifndef AIPS_NO_TEMPLATE_SRC
149 #include <imageanalysis/ImageAnalysis/ImageStatsBase.tcc>
150 #endif
151 
152 #endif
decide based on size and number of steps needed for stats
int Int
Definition: aipstype.h:50
Displays various statistics from an image.
StatisticsData::ALGORITHM _getAlgorithm() const
void configureBiweight(casacore::Int maxIter)
casacore::Double zs
Chauvenet zscore.
void configureChauvenet(casacore::Double zscore, casacore::Int maxIterations)
std::unique_ptr< casacore::ImageStatistics< T > > & _getImageStats()
USE_DATA
which section of data to use, greater than or less than the center value
AlgConf _getAlgConf() const
casacore::Double hf
hinges-fences f factor
ALGORITHM
implemented algorithms
CENTER
choice of center point based on the corresponding statistics from the entire distribution of data...
Referenced counted pointer for constant data.
Definition: VisModelData.h:42
casacore::String _configureAlgorithm()
double Double
Definition: aipstype.h:55
std::unique_ptr< casacore::ImageStatistics< T > > _statistics
void configureHingesFences(casacore::Double f)
configure hinges-fences algorithm
A hierarchical collection of named fields of various types.
Definition: Record.h:180
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
casacore::StatisticsData::ALGORITHM algorithm
ImageStatsBase()=delete
This adds configuration methods for statistics classes.
#define SPCIIT
Definition: ImageTypedefs.h:35
casacore::Int mi
Chauvenet/Biweight max iterations.
void configureFitToHalf(casacore::FitToHalfStatisticsData::CENTER centerType, casacore::FitToHalfStatisticsData::USE_DATA useData, casacore::Double centerValue)
configure fit to half algorithm
ImageStatsData::PreferredClassicalAlgorithm _prefClassStatsAlg
T cv
fit to half center value
String: the storage and methods of handling collections of characters.
Definition: String.h:223
void configureClassical(ImageStatsData::PreferredClassicalAlgorithm p)
void _resetStats(ImageStatistics< T > *stat=nullptr)
casacore::FitToHalfStatisticsData::USE_DATA ud
fit to half data portion to use
casacore::FitToHalfStatisticsData::CENTER ct
fit to have center type
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42