isce3 0.25.0
Loading...
Searching...
No Matches
Stats.h
1#include <isce3/core/TypeTraits.h>
2#include <isce3/core/Constants.h>
3#include <isce3/core/blockProcessing.h>
4#include <isce3/io/Raster.h>
5
6namespace isce3 { namespace math {
7
15template<class T>
16struct Stats {
18 using type = T;
19 using T_real = typename isce3::real<T>::type;
20 T min = std::numeric_limits<T_real>::quiet_NaN();
21 T max = std::numeric_limits<T_real>::quiet_NaN();
22 T mean = 0;
23
24 long long n_valid = 0;
25
26 T_real sample_stddev() const;
27
29 void update(const Stats<T>& other);
30
32 void update(const T& value);
33
36 void update(const T* values, size_t size, size_t stride = 1);
37
39 Stats(const T* values, size_t size, size_t stride = 1);
40
41 Stats() = default;
42
43private:
44 double real_valued_mean = 0;
45 double square_diff_sum = 0;
46};
47
54template<class T>
57 using type = std::complex<T>;
58
59 Stats<T> real;
60 Stats<T> imag;
61 long long n_valid = 0;
62
64 void update(const StatsRealImag<T>& other);
65
67 void update(const std::complex<T>& value);
68
71 void update(const std::complex<T>* values, size_t size, size_t stride = 1);
72
74 StatsRealImag(const std::complex<T>* values, size_t size, size_t stride = 1);
75
76 StatsRealImag() = default;
77};
78
88template<class T>
89std::vector<isce3::math::Stats<T>> computeRasterStats(
90 isce3::io::Raster& input_raster,
91 isce3::core::MemoryModeBlocksY memory_mode =
92 isce3::core::MemoryModeBlocksY::AutoBlocksY);
93
103template<class T>
104std::vector<isce3::math::StatsRealImag<T>> computeRasterStatsRealImag(
105 isce3::io::Raster& input_raster,
106 isce3::core::MemoryModeBlocksY memory_mode =
107 isce3::core::MemoryModeBlocksY::AutoBlocksY);
108
109}}
Data structure meant to handle Raster I/O operations.
Definition Raster.h:32
base interpolator is an abstract base class
Definition BinarySearchFunc.cpp:5
void update(const StatsRealImag< T > &other)
Update statistics with independent data using Chan's method.
Definition Stats.cpp:140
std::complex< T > type
Expected element type of input data.
Definition Stats.h:57
StatsRealImag(const std::complex< T > *values, size_t size, size_t stride=1)
Initialize from block of data.
Definition Stats.cpp:149
Statistics struct.
Definition Stats.h:16
Stats(const T *values, size_t size, size_t stride=1)
Initialize stats from block of data.
Definition Stats.cpp:99
T type
Expected element type of input data.
Definition Stats.h:18
void update(const Stats< T > &other)
Update statistics with independent data using Chan's method.
Definition Stats.cpp:64

Generated for ISCE3.0 by doxygen 1.13.2.