Go to the documentation of this file.
28 #ifndef CASA_MASKARRMATH_H
29 #define CASA_MASKARRMATH_H
32 #include <casacore/casa/aips.h>
33 #include <casacore/casa/BasicMath/Math.h>
34 #include <casacore/casa/Arrays/Array.h>
35 #include <casacore/casa/Arrays/MaskedArray.h>
36 #include <casacore/casa/Arrays/IPosition.h>
38 #include <casacore/casa/BasicSL/Complex.h>
441 {
return madfm (a, sorted, (a.
nelements() <= 100)); }
527 template <
typename T,
typename FuncType>
530 const FuncType& funcObj);
556 template <
typename T,
typename FuncType>
559 const FuncType& funcObj,
565 #ifndef CASACORE_NO_AUTO_TEMPLATES
566 #include <casacore/casa/Arrays/MaskArrMath.tcc>
567 #endif //# CASACORE_NO_AUTO_TEMPLATES
T operator()(const MaskedArray< T > &arr) const
uInt nelements() const
The number of elements of this masked array.
MaskedArray< T > boxedArrayMath(const MaskedArray< T > &array, const IPosition &boxSize, const FuncType &funcObj)
Apply the given ArrayMath reduction function objects to each box in the array.
LatticeExprNode stddev(const LatticeExprNode &expr)
MaskedArray< T > sin(const MaskedArray< T > &left)
Transcendental function applied to the array on an element-by-element basis.
A Vector of integers, for indexing into Array<T> objects.
LatticeExprNode operator+(const LatticeExprNode &expr)
Global functions operating on a LatticeExprNode.
T max(const MaskedArray< T > &left)
The maximum element of the array.
T operator()(const MaskedArray< T > &arr) const
MaskedArray< T > cosh(const MaskedArray< T > &left)
void indgen(MaskedArray< T > &a, T start, T inc)
Fills all elements of "array" where the mask is True with a sequence starting with "start" and increm...
void indgen(MaskedArray< T > &a, T start)
Fills all elements of "array" where the mask is True with a sequence starting with "start" and increm...
LatticeExprNode variance(const LatticeExprNode &expr)
T madfm(const MaskedArray< T > &a, Bool sorted=False)
The median absolute deviation from the median.
MaskedArray< T > atan(const MaskedArray< T > &left)
MaskedArray< T > asin(const MaskedArray< T > &left)
MaskedArray< T > fabs(const MaskedArray< T > &left)
T stddev(const MaskedArray< T > &a, T mean)
LatticeExprNode real(const LatticeExprNode &expr)
MaskedArray< T > pow(const MaskedArray< T > &left, const Double &right)
T sum(const MaskedArray< T > &a)
const MaskedArray< T > & operator-=(const MaskedArray< T > &left, const Array< T > &other)
T operator()(const MaskedArray< T > &arr) const
MaskedArray< T > cos(const MaskedArray< T > &left)
MaskedArray< T > tan(const MaskedArray< T > &left)
MaskedArray< T > pow(const MaskedArray< T > &left, const MaskedArray< U > &right)
MaskedArray< T > log10(const MaskedArray< T > &left)
T rms(const MaskedArray< T > &a)
The root-mean-square of "a" is the sqrt of sum(a*a)/N.
MaskedArray< T > operator+(const MaskedArray< T > &a)
Unary arithmetic operation.
MaskedArray< T > ceil(const MaskedArray< T > &left)
MaskedArray< T > fmod(const MaskedArray< T > &left, const MaskedArray< T > &right)
const MaskedArray< T > & operator+=(const MaskedArray< T > &left, const Array< T > &other)
Element by element arithmetic modifying left in-place.
MaskedArray< T > fmod(const Array< T > &left, const MaskedArray< T > &right)
T pstddev(const MaskedArray< T > &a, T mean, uInt ddof=0)
MaskedArray< T > operator/(const MaskedArray< T > &left, const Array< T > &right)
MaskedMadfmFunc(Bool sorted=False, Bool takeEvenMean=True)
MaskedArray< T > fmod(const MaskedArray< T > &left, const T &right)
LatticeExprNode mean(const LatticeExprNode &expr)
MaskedArray< T > max(const Array< T > &left, const MaskedArray< T > &right)
T pstddev(const MaskedArray< T > &a, uInt ddof=0)
T operator()(const MaskedArray< T > &arr) const
MaskedArray< T > min(const MaskedArray< T > &left, const Array< T > &right)
Return an array that contains the minimum of "left" and "right" at each position.
T avdev(const MaskedArray< T > &a)
The average deviation of "a" is the sum of abs(a(i) - mean(a))/N.
void minMax(T &minVal, T &maxVal, const MaskedArray< T > &marray)
T product(const TableVector< T > &tv)
void minMax(T &minVal, T &maxVal, IPosition &minPos, IPosition &maxPos, const MaskedArray< T > &marray)
Find the minimum and maximum values of a MaskedArray.
MaskedArray< T > floor(const MaskedArray< T > &left)
MaskedArray< T > sqrt(const MaskedArray< T > &left)
MaskedArray< T > atan2(const Array< T > &left, const MaskedArray< T > &right)
MaskedArray< T > imag(const MaskedArray< std::complex< T >> &carray)
Extracts the imaginary part of a complex array into an array of floats.
MaskedArray< T > operator-(const MaskedArray< T > &a)
MaskedArray< T > acos(const MaskedArray< T > &left)
T operator()(const MaskedArray< T > &arr) const
MaskedArray< T > atan2(const T &left, const MaskedArray< T > &right)
MaskedArray< T > cube(const MaskedArray< T > &val)
Returns a MaskedArray where every element is cubed.
Mathematical operations for MaskedArrays (and with Arrays)
MaskedArray< T > max(const T &left, const MaskedArray< T > &right)
LatticeExprNode max(const LatticeExprNode &left, const LatticeExprNode &right)
MaskedArray< T > atan2(const MaskedArray< T > &left, const Array< T > &right)
Transcendental functions requiring two arguments applied on an element-by-element basis.
MaskedArray< T > square(const MaskedArray< T > &val)
Returns a MaskedArray where every element is squared.
T operator()(const MaskedArray< T > &arr) const
T pvariance(const MaskedArray< T > &a, T mean, uInt ddof=0)
T sumsquares(const MaskedArray< T > &a)
Sum of the squares of every element of the MaskedArray where the Mask is True.
T variance(const MaskedArray< T > &a, T mean)
Rather than using a computed mean, use the supplied value.
LatticeExprNode operator/(const LatticeExprNode &left, const LatticeExprNode &right)
T operator()(const MaskedArray< T > &arr) const
LatticeExprNode min(const LatticeExprNode &left, const LatticeExprNode &right)
T mean(const MaskedArray< T > &a)
The mean of "a" is the sum of all elements of "a" divided by the number of elements of "a".
T operator()(const MaskedArray< T > &arr) const
MaskedArray< T > min(const MaskedArray< T > &left, const MaskedArray< T > &right)
this file contains all the compiler specific defines
T variance(const MaskedArray< T > &a)
The variance of "a" is the sum of (a(i) - mean(a))**2/(a.nelements() - ddof).
TableExprNode array(const TableExprNode &values, const TableExprNodeSet &shape)
Create an array of the given shape and fill it with the values.
MaskedArray< T > fmod(const T &left, const MaskedArray< T > &right)
LatticeExprNode median(const LatticeExprNode &expr)
MaskedArray< T > max(const MaskedArray< T > &left, const T &right)
LatticeExprNode imag(const LatticeExprNode &expr)
T pvariance(const MaskedArray< T > &a, uInt ddof=0)
MaskedArray< T > pow(const MaskedArray< T > &left, const Array< U > &right)
Class for masking an Array for operations on that Array.
MaskedArray< T > min(const T &left, const MaskedArray< T > &right)
MaskedArray< T > atan2(const MaskedArray< T > &left, const T &right)
void min(const MaskedArray< T > &result, const Array< T > &left, const Array< T > &right)
"result" contains the minimum of "left" and "right" at each position.
MaskedArray< T > log(const MaskedArray< T > &left)
const MaskedArray< T > & operator/=(const MaskedArray< T > &left, const Array< T > &other)
MaskedArray< T > min(const MaskedArray< T > &left, const T &right)
T avdev(const MaskedArray< T > &a, T mean)
The average deviation of "a" is the sum of abs(a(i) - mean(a))/N.
T madfm(const MaskedArray< T > &a, Bool sorted, Bool takeEvenMean)
const MaskedArray< T > & operator*=(const MaskedArray< T > &left, const Array< T > &other)
MaskedArray< T > real(const MaskedArray< std::complex< T >> &carray)
Extracts the real part of a complex array into an array of floats.
TableExprNode marray(const TableExprNode &array, const TableExprNode &mask)
Form a masked array.
T stddev(const MaskedArray< T > &a)
The standard deviation of "a" is the square root of its variance.
MaskedArray< T > max(const MaskedArray< T > &left, const Array< T > &right)
Return an array that contains the maximum of "left" and "right" at each position.
MaskedArray< T > operator*(const MaskedArray< T > &left, const Array< T > &right)
T median(const MaskedArray< T > &a, Bool sorted=False)
The median of "a" is a(n/2).
template <class T, class U> class vector;
LatticeExprNode sum(const LatticeExprNode &expr)
MaskedArray< T > tanh(const MaskedArray< T > &left)
bool Bool
Define the standard types used by Casacore.
MaskedArray< T > exp(const MaskedArray< T > &left)
T min(const MaskedArray< T > &left)
The "min" and "max" functions require that the type "T" have comparison operators.
TableExprNode rms(const TableExprNode &array)
T median(const MaskedArray< T > &a, Bool sorted, Bool takeEvenMean)
void indgen(MaskedArray< T > &a)
Fills all elements of "array" where the mask is True with a sequence starting with 0 and incremented ...
MaskedArray< T > pow(const Array< T > &left, const MaskedArray< U > &right)
MaskedArray< T > min(const Array< T > &left, const MaskedArray< T > &right)
MaskedArray< T > fmod(const MaskedArray< T > &left, const Array< T > &right)
LatticeExprNode avdev(const LatticeExprNode &expr)
MVBaseline operator*(const RotMatrix &left, const MVBaseline &right)
Rotate a Baseline vector with rotation matrix and other multiplications.
T operator()(const MaskedArray< T > &arr) const
MaskedArray< T > abs(const MaskedArray< T > &left)
Float operator()(const MaskedArray< Float > &arr) const
MaskedArray< T > atan2(const MaskedArray< T > &left, const MaskedArray< T > &right)
MaskedArray< T > sinh(const MaskedArray< T > &left)
MaskedArray< T > max(const MaskedArray< T > &left, const MaskedArray< T > &right)
LatticeExprNode operator-(const LatticeExprNode &expr)
void max(const MaskedArray< T > &result, const Array< T > &left, const Array< T > &right)
"result" contains the maximum of "left" and "right" at each position.
Array< T > slidingArrayMath(const MaskedArray< T > &array, const IPosition &halfBoxSize, const FuncType &funcObj, Bool fillEdge=True)
Apply for each element in the array the given ArrayMath reduction function object to the box around t...
T product(const MaskedArray< T > &a)
Product of every element of the MaskedArray where the Mask is True.