casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Static Public Member Functions
casa::LatticeUtilities Class Reference

Static functions for Lattices. More...

#include <LatticeUtilities.h>

List of all members.

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 &region, 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).

Detailed Description

Static functions for Lattices.

Intended use:

Public interface

Review Status

Date Reviewed:
yyyy/mm/dd
Test programs:
tLatticeUtilities

Prerequisite

Synopsis

Some static helper functions for Lattices

Motivation

Common functionality not appropriate for Lattice member functions

To Do

Definition at line 69 of file LatticeUtilities.h.


Member Function Documentation

template<class T >
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.

template<class T >
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)

template<class T >
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

template<class T >
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

template<class T >
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.

template<class T >
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


The documentation for this class was generated from the following file: