3#include <isce3/core/EMatrix.h>
21template<
typename EigenT1,
typename EigenT2>
22auto multilookWeightedAvg(
const EigenT1& input,
int row_looks,
int col_looks,
23 const EigenT2& weights)
26 const auto nrows = input.rows() / row_looks;
27 const auto ncols = input.cols() / col_looks;
29 using value_type =
typename EigenT1::value_type;
30 isce3::core::EArray2D<value_type> output(nrows, ncols);
32 #pragma omp parallel for collapse(2)
33 for (
int row = 0; row < nrows; ++row) {
34 for (
int col = 0; col < ncols; ++col) {
36 const auto cells = input.block(row * row_looks, col * col_looks,
37 row_looks, col_looks);
38 const auto wgts = weights.block(row * row_looks, col * col_looks,
39 row_looks, col_looks);
41 output(row, col) = (cells * wgts).sum() / wgts.sum();
57template<
typename EigenType>
58auto multilookSummed(
const EigenType& input,
int row_looks,
int col_looks)
61 const auto nrows = input.rows() / row_looks;
62 const auto ncols = input.cols() / col_looks;
64 using value_type =
typename EigenType::value_type;
65 isce3::core::EArray2D<value_type> output(nrows, ncols);
67 #pragma omp parallel for collapse(2)
68 for (
int row = 0; row < nrows; ++row) {
69 for (
int col = 0; col < ncols; ++col) {
71 output(row, col) = input.block(row * row_looks, col * col_looks,
89template<
typename EigenType>
90auto multilookAveraged(
const EigenType& input,
int row_looks,
int col_looks)
93 const auto nrows = input.rows() / row_looks;
94 const auto ncols = input.cols() / col_looks;
96 using value_type =
typename EigenType::value_type;
97 isce3::core::EArray2D<value_type> output(nrows, ncols);
99 #pragma omp parallel for collapse(2)
100 for (
int row = 0; row < nrows; ++row) {
101 for (
int col = 0; col < ncols; ++col) {
103 output(row, col) = input.block(row * row_looks, col * col_looks,
104 row_looks, col_looks)
126template<
typename EigenInput>
127auto multilookNoData(
const EigenInput& input,
int row_looks,
int col_looks,
128 const typename EigenInput::value_type nodata)
131 auto upcast_bool = [](
const bool b) {
132 typename EigenInput::value_type ret = b ? 1 : 0;
136 auto weights = (input != nodata).unaryExpr(upcast_bool);
138 return multilookWeightedAvg(input, row_looks, col_looks, weights);
151template<
typename EigenInput>
152auto multilookPow(
const EigenInput& input,
int row_looks,
int col_looks,
156 return multilookAveraged(input.abs().pow(exponent), row_looks, col_looks);
base interpolator is an abstract base class
Definition BinarySearchFunc.cpp:5