casa
$Rev:20696$
|
Static functions for Lattices. More...
#include <LatticeUtilities.h>
Static Public Member Functions | |
template<class T > | |
static void | collapse (Array< T > &data, const IPosition &axes, const MaskedLattice< T > &in, Bool dropDegenerateAxes) |
Collapse the specified axes by averaging and recover the pixel values. | |
template<class T > | |
static void | collapse (Array< T > &data, Array< Bool > &mask, const IPosition &axes, const MaskedLattice< T > &lat, Bool dropDegenerateAxes, Bool getPixels=True, Bool getMask=True, const LatticeStatsBase::StatisticsTypes stat=LatticeStatsBase::MEAN) |
Collapse the specified axes by averaging and recover either/and the pixel values and mask. | |
template<class T > | |
static void | copyDataAndMask (LogIO &os, MaskedLattice< T > &out, const MaskedLattice< T > &in, Bool zeroMasked=False) |
Copy data and mask from input to output. | |
template<class T > | |
static void | replicate (Lattice< T > &lat, const Slicer ®ion, const Array< T > &pixels) |
Replicate array through lattice in the specified region. | |
template<class T > | |
static void | bin (MaskedArray< T > &out, const MaskedArray< T > &in, uInt axis, uInt bin) |
Bin up one axis of MaskedArray (uses Lattices in implementation) | |
template<class T > | |
static void | addDegenerateAxes (Lattice< T > *&pLatOut, const Lattice< T > &latIn, uInt nDim) |
Add degenerate axes to the lattice if needed (nDim is the desired number of dimensions for the output lattice). |
Static functions for Lattices.
Public interface
Some static helper functions for Lattices
Common functionality not appropriate for Lattice member functions
Definition at line 69 of file LatticeUtilities.h.
static void casa::LatticeUtilities::addDegenerateAxes | ( | Lattice< T > *& | pLatOut, |
const Lattice< T > & | latIn, | ||
uInt | nDim | ||
) | [static] |
Add degenerate axes to the lattice if needed (nDim is the desired number of dimensions for the output lattice).
If the shapes are the same, the returned pointer holds a SubLattice. If a reshape was necessary, the pointer holds an ExtendLattice. The pointer is the callers responsibility to delete.
static void casa::LatticeUtilities::bin | ( | MaskedArray< T > & | out, |
const MaskedArray< T > & | in, | ||
uInt | axis, | ||
uInt | bin | ||
) | [static] |
Bin up one axis of MaskedArray (uses Lattices in implementation)
static void casa::LatticeUtilities::collapse | ( | Array< T > & | data, |
const IPosition & | axes, | ||
const MaskedLattice< T > & | in, | ||
Bool | dropDegenerateAxes | ||
) | [static] |
Collapse the specified axes by averaging and recover the pixel values.
If axes is empty, then the data just contains all of the lattice (i.e. no collapse), but dropDegenerateAxes is stil honoured
static void casa::LatticeUtilities::collapse | ( | Array< T > & | data, |
Array< Bool > & | mask, | ||
const IPosition & | axes, | ||
const MaskedLattice< T > & | lat, | ||
Bool | dropDegenerateAxes, | ||
Bool | getPixels = True , |
||
Bool | getMask = True , |
||
const LatticeStatsBase::StatisticsTypes | stat = LatticeStatsBase::MEAN |
||
) | [static] |
Collapse the specified axes by averaging and recover either/and the pixel values and mask.
If axes is empty, then the data and mask just contains all of the lattice (i.e. no collapse) but dropDegenerateAxes is stil honoured
static void casa::LatticeUtilities::copyDataAndMask | ( | LogIO & | os, |
MaskedLattice< T > & | out, | ||
const MaskedLattice< T > & | in, | ||
Bool | zeroMasked = False |
||
) | [static] |
Copy data and mask from input to output.
If the input has no mask, that means all True (good), and these values will be transferred to the output. Mask transfer only occurs if the output has a writeable mask.
static void casa::LatticeUtilities::replicate | ( | Lattice< T > & | lat, |
const Slicer & | region, | ||
const Array< T > & | pixels | ||
) | [static] |
Replicate array through lattice in the specified region.
The shape of pixels
has to fit exactly into the shape of the selected region for each axis of pixels
. Otherwise and exception will be thrown. For example, if the shape of the region is [10,20], the shape of pixels could be [10] and it will be replicated 20 times. Another example would be that the shape of pixels could be [5,10] and it would be replicated 4 times fitting into the Lattice