Go to the documentation of this file.
28 #ifndef CASA_MASKEDARRAY_H
29 #define CASA_MASKEDARRAY_H
33 #include <casacore/casa/aips.h>
34 #include <casacore/casa/Arrays/IPosition.h>
35 #include <casacore/casa/Utilities/CountedPtr.h>
36 #include <casacore/casa/Arrays/LogiArrayFwd.h>
37 #include <casacore/casa/Arrays/MaskLogiArrFwd.h>
47 template <
class T>
class Array;
325 template<
class T>
class MaskedArray
436 const MaskedLogicalArray &inmask,
439 const MaskedLogicalArray &inmask);
556 {
return pArray->shape(); }
723 template<
class T,
class U>
725 template<
class T,
class U>
727 template<
class T,
class U>
737 #ifndef CASACORE_NO_AUTO_TEMPLATES
738 #include <casacore/casa/Arrays/MaskedArray.tcc>
739 #endif //# CASACORE_NO_AUTO_TEMPLATES
Specify which elements to extract from an n-dimensional array.
uInt nelements() const
The number of elements of this masked array.
uInt nelementsValid() const
The number of valid elements of this masked array.
A Vector of integers, for indexing into Array<T> objects.
Bool conform(const Array< T > &other) const
Are the shapes identical?
const LogicalArray & getMask() const
Return the (const) internal Mask.
void putArrayStorage(T *&storage, Bool deleteAndCopy) const
MaskedArray(const Array< T > &inarray, const MaskedLogicalArray &inmask, Bool isreadonly)
Create a MaskedArray from an Array and a MaskedLogicalArray.
MaskedArray< T > operator()(const IPosition &start, const IPosition &end)
Get a reference to an array part which extends from "start" to end.
Bool isReadOnly() const
Is the array read only?
Array< T > * pArray
The array.
MaskedArray< T > & operator=(const T &value)
Set every element of this array to "value", only setting those elements for which the corresponding m...
MaskedArray(const Array< T > &inarray, const LogicalArray &inmask, Bool isreadonly)
Create a MaskedArray from an Array and a LogicalArray.
Array< T > getCompressedArray() const
Return a "compressed" Array containing only the valid elements of the MaskedArray.
void freeArrayStorage(const T *&storage, Bool deleteIt) const
void setReadOnly() const
Set the array to be read only.
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
MaskedArray< T > copy(Bool isreadonly) const
Make a copy of the masked array.
MaskedArray(const MaskedArray< T > &inarray, const MaskedLogicalArray &inmask, Bool isreadonly)
Create a MaskedArray from a MaskedArray and a MaskedLogicalArray.
MaskedArray(const MaskedArray< T > &other)
const IPosition & shape() const
The length of each axis.
MaskedArray< T > & operator=(const MaskedArray< T > &other)
Copy the values in other to this, only copying those elements for which the logical AND of the corres...
MaskedArray< T > operator()(const IPosition &start, const IPosition &end, const IPosition &inc)
Along the ith axis, every inc[i]'th element is chosen.
Bool isRO
Is the array read only?
T * getRWArrayStorage(Bool &deleteIt) const
MaskedArray< T > operator()(const LogicalArray &mask) const
Return a MaskedArray.
MaskedArray< T > & operator=(const Array< T > &inarray)
Copy the values in inarray to this, only copying those elements for which the corresponding mask elem...
void setData(const Array< T > &data, const LogicalArray &mask, Bool isReadOnly=False)
Reset the data and mask of the the MaskedArray.
Bool conform(const MaskedArray< T > &other) const
MaskedArray()
Default constructor for a MaskedArray does not allocate any memory for the Data array or Mask.
void getCompressedArray(Array< T > &inarr) const
Fill the argument "compressed" Array with only the valid elements of the MaskedArray.
MaskedArray(const MaskedArray< T > &inarray, const MaskedLogicalArray &inmask)
this file contains all the compiler specific defines
Bool nelemValidIsOK
Is the number of valid elements cache OK? i.e.
General global functions for MaskedArrays, and MaskedArrays and Arrays.
TableExprNode array(const TableExprNode &values, const TableExprNodeSet &shape)
Create an array of the given shape and fill it with the values.
MaskedArray(const MaskedArray< T > &inarray, const LogicalArray &inmask)
Bool ok() const
Check to see if the masked array is consistent.
MaskedArray(const Array< T > &inarray, const LogicalArray &inmask)
Bool conform2(const Array< T > &left, const MaskedArray< U > &right)
void freeMaskStorage(const LogicalArrayElem *&storage, Bool deleteIt) const
Class for masking an Array for operations on that Array.
uInt nelemValid
Cache the number of valid elements.
Array< T > getCompressedArray(const IPosition &shape) const
The returned Array will have the input shape.
const T * getArrayStorage(Bool &deleteIt) const
Manipulate the storage for the underlying Array.
uInt ndim() const
The dimensionality of this masked array.
void setCompressedArray(const Array< T > &inarr)
Set only the valid elements of the MaskedArray from the argument "compressed" Array.
LatticeExprNode mask(const LatticeExprNode &expr)
This function returns the mask of the given expression.
const Array< T > & getArray() const
Return the internal Array.
template <class T, class U> class vector;
Array< T > & getRWArray() const
Return the internal Array, writeable.
MaskedArray< T > copy() const
LogicalArray * pMask
The mask.
bool Bool
Define the standard types used by Casacore.
MaskedArray(const MaskedArray< T > &other, Bool isreadonly)
Copy constructor.
MaskedArray(const MaskedArray< T > &inarray, const LogicalArray &inmask, Bool isreadonly)
Create a MaskedArray from a MaskedArray and a LogicalArray.
const LogicalArrayElem * getMaskStorage(Bool &deleteIt) const
Manipulate the storage for the underlying Mask.
void setData(const MaskedArray< T > &array, Bool isReadOnly=False)
Bool conform2(const MaskedArray< T > &left, const MaskedArray< U > &right)
Bool conform2(const MaskedArray< T > &left, const Array< U > &right)
Test conformance for masked arrays and arrays of different types.
MaskedArray(const Array< T > &inarray, const MaskedLogicalArray &inmask)
MaskedArray< T > operator()(const Slicer &)
Get a reference to an array using a Slicer.