casacore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LattStatsSpecialize.h
Go to the documentation of this file.
1 //# LattStatsSpecialize.h: specialized functions for LatticeStatistics
2 //# Copyright (C) 1996,1997,1998,1999,2000,2001,2002,2003
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be addressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //# $Id$
27 
28 #ifndef LATTICES_LATTSTATSSPECIALIZE_H
29 #define LATTICES_LATTSTATSSPECIALIZE_H
30 
31 
32 //# Includes
33 #include <casacore/casa/aips.h>
36 namespace casacore { //# NAMESPACE CASACORE - BEGIN
37 
38 template <class T> class Lattice;
39 template <class T> class MaskedLattice;
40 class LatticeExprNode;
41 class String;
42 class IPosition;
43 
44 
45 
46 // <summary> </summary>
47 // <use visibility=export>
48 //
49 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
50 // </reviewed>
51 //
52 // <prerequisite>
53 // </prerequisite>
54 //
55 // <etymology>
56 // </etymology>
57 //
58 // <synopsis>
59 // </synopsis>
60 //
61 // <motivation>
62 // </motivation>
63 //
64 // <todo asof="1998/01/10">
65 // </todo>
66 
67 
69 {
70 public:
71  static Bool hasSomePoints (Double npts);
72  static Bool hasSomePoints (DComplex npts);
73 //
74  static void setUseItTrue (Float& useIt);
75  static void setUseItTrue (Complex& useIt);
76 //
77  static Float usePixelInc (Float dMin, Float dMax, Float datum);
78  static Complex usePixelInc (Complex dMin, Complex dMax, Complex datum);
79 //
80  static Float usePixelExc (Float dMin, Float dMax, Float datum);
81  static Complex usePixelExc (Complex dMin, Complex dMax, Complex datum);
82 //
83  static Double getMean (Double sum, Double n);
84  static DComplex getMean (DComplex sum, DComplex n);
85 //
86  static Double getVariance (Double sum, Double sumsq, Double n);
87  static DComplex getVariance (DComplex sum, DComplex sumsq, DComplex n);
88 //
89  static Double getSigma (Double sum, Double sumsq, Double n);
90  static DComplex getSigma (DComplex sum, DComplex sumsq, DComplex n);
91 //
92  static Double getSigma (Double var);
93  static DComplex getSigma (DComplex var);
94 //
95  static Double getRms (Double sumsq, Double n);
96  static DComplex getRms (DComplex sumsq, DComplex n);
97 //
98  static Float min(Float v1, Float v2);
99  static Complex min(Complex v1, Complex v2);
100 //
101  static Float max(Float v1, Float v2);
102  static Complex max(Complex v1, Complex v2);
103 //
104  static Float getNodeScalarValue(const LatticeExprNode& node, Float);
105  static Complex getNodeScalarValue(const LatticeExprNode& node, Complex);
106 
107  template <class T> static Bool setIncludeExclude (String& errorMessage,
108  Vector<T>& range,
109  Bool& noInclude, Bool& noExclude,
110  const Vector<T>& include,
111  const Vector<T>& exclude);
112  static Bool setIncludeExclude (String& errorMessage,
113  Vector<Complex>& range,
114  Bool& noInclude, Bool& noExclude,
115  const Vector<Complex>& include,
116  const Vector<Complex>& exclude);
117 //
118  static Bool minMax (Float& dataMin, Float& dataMax, const MaskedLattice<Float>* pLattice,
119  const Vector<Float>& range, Bool noInclude, Bool noExclude);
120  static Bool minMax (Complex& dataMin, Complex& dataMax, const MaskedLattice<Complex>* pLattice,
121  const Vector<Complex>& range, Bool noInclude, Bool noExclude);
122 };
123 
124 
125 } //# NAMESPACE CASACORE - END
126 
127 #ifndef CASACORE_NO_AUTO_TEMPLATES
128 #include <casacore/lattices/LatticeMath/LattStatsSpecialize2.tcc>
129 #endif //# CASACORE_NO_AUTO_TEMPLATES
130 
131 #endif
132 
static Float getNodeScalarValue(const LatticeExprNode &node, Float)
static Bool setIncludeExclude(String &errorMessage, Vector< T > &range, Bool &noInclude, Bool &noExclude, const Vector< T > &include, const Vector< T > &exclude)
static Float usePixelExc(Float dMin, Float dMax, Float datum)
LatticeExprNode sum(const LatticeExprNode &expr)
A templated, abstract base class for array-like objects with masks.
Definition: ImageConcat.h:46
static Float max(Float v1, Float v2)
static Double getVariance(Double sum, Double sumsq, Double n)
static Bool hasSomePoints(Double npts)
static Float min(Float v1, Float v2)
static void setUseItTrue(Float &useIt)
static Float usePixelInc(Float dMin, Float dMax, Float datum)
double Double
Definition: aipstype.h:55
static Double getSigma(Double sum, Double sumsq, Double n)
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
static Bool minMax(Float &dataMin, Float &dataMax, const MaskedLattice< Float > *pLattice, const Vector< Float > &range, Bool noInclude, Bool noExclude)
float Float
Definition: aipstype.h:54
static Double getMean(Double sum, Double n)
static Double getRms(Double sumsq, Double n)
Bridging class to allow C++ expressions involving lattices.
String: the storage and methods of handling collections of characters.
Definition: String.h:225