casacore
Loading...
Searching...
No Matches
StatisticsTypes.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#ifndef SCIMATH_STATISTICSTYPES_H
26#define SCIMATH_STATISTICSTYPES_H
27
28#include <casacore/casa/aips.h>
29
30#include <utility>
31#include <vector>
32#include <memory>
33
34// because the template signature has become unwieldy
35#define CASA_STATD \
36 template <class AccumType, class DataIterator, class MaskIterator, class WeightsIterator>
37#define CASA_STATP AccumType, DataIterator, MaskIterator, WeightsIterator
38#define CASA_STATQ DataIterator, MaskIterator, WeightsIterator
39
40namespace casacore {
41
42class Record;
43
44// Commonly used types in statistics framework.
45#define DataArray std::vector<AccumType>
46#define DataRanges std::vector<std::pair<AccumType, AccumType>>
47#define IncludeLimits std::vector<std::pair<AccumType, AccumType>>
48
49using BinCountArray = std::vector<uInt64>;
50using LocationType = std::pair<Int64, Int64>;
51
52template <class AccumType>
53struct StatsData {
55 std::shared_ptr<AccumType> max;
57 AccumType mean;
58 std::shared_ptr<AccumType> median;
59 std::shared_ptr<AccumType> medAbsDevMed;
60 std::shared_ptr<AccumType> min;
63 AccumType nvariance;
64 AccumType rms;
65 AccumType stddev;
66 AccumType sum;
67 AccumType sumsq;
68 AccumType sumweights;
69 AccumType variance;
71};
72
73template <class AccumType>
75
76template <class AccumType>
78
79template <class AccumType>
81
82} // namespace casacore
83
84#ifndef CASACORE_NO_AUTO_TEMPLATES
85#include <casacore/scimath/StatsFramework/StatisticsTypes.tcc>
86#endif // # CASACORE_NO_AUTO_TEMPLATES
87
88#endif
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28
StatsData< AccumType > initializeStatsData()
void copy(double *target, int npixels) const
std::pair< Int64, Int64 > LocationType
Record toRecord(const StatsData< AccumType > &stats)
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40
std::vector< uInt64 > BinCountArray
double Double
Definition aipstype.h:53
std::shared_ptr< AccumType > max
std::shared_ptr< AccumType > median
std::shared_ptr< AccumType > min
std::shared_ptr< AccumType > medAbsDevMed