casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Attributes | List of all members
casa::MaskedArrayModel< T > Class Template Reference

base class for models with an internal & external representation as a casacore::MaskedArray More...

#include <MaskedArrayModel.h>

Inheritance diagram for casa::MaskedArrayModel< T >:
casa::LinearModel< casacore::MaskedArray< T > > casa::MaskedHogbomCleanModel< T >

Public Member Functions

 MaskedArrayModel ()
 Default constructor sets the internal arrays to zero size. More...
 
 MaskedArrayModel (const casacore::MaskedArray< T > &model)
 Construct the model from a masked array. More...
 
 MaskedArrayModel (const casacore::Array< T > &model)
 Construct the model from an array. More...
 
void getModel (casacore::Array< T > &model) const
 These functions return the model, either as a masked array or just the data array itself with the mask removed. More...
 
virtual void getModel (casacore::MaskedArray< T > &model) const
 
casacore::MaskedArray< T > getModel () const
 Return the current model. More...
 
void setModel (const casacore::Array< T > &model)
 These functions are analogous to the constructors above and must be called when the default constructor is used. More...
 
virtual void setModel (const casacore::MaskedArray< T > &model)
 Set the current model. More...
 
- Public Member Functions inherited from casa::LinearModel< casacore::MaskedArray< T > >
virtual ~LinearModel ()
 A virtual destructor is necessary. More...
 

Protected Attributes

casacore::MaskedArray< T > theModel
 

Detailed Description

template<class T>
class casa::MaskedArrayModel< T >

base class for models with an internal & external representation as a casacore::MaskedArray

Intended use:

Public interface

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Synopsis

An MaskedArrayModel is a base class for Models that can be represented by arrays with a mask (used to denote which values are valid). It is expected that this class will be mainly used by inheritence from other classes which will then provide the solve() functions necessary to update the model given an equation.

However this class does not contain any pure virtual functions and hence can be used "as is". An example of this is given below. For an example of how this class can be used by derived classes see the MaskedHogbomCleanModel class.

This class makes an internal copy of the casacore::Array supplied to it (either when constructed or when using the setModel function). If this is found to significantly affect performance (execution speed or memory requirements) this may be changed to a reference, perhaps using a smart pointer like the COWPtr

Example

MaskedArrayModel<casacore::Float> currentModel(); // Cannot use the model yet!
{
... put your best guess into the casacore::Matrix..\.
currentModel.setModel(bestGuess); // This does a real copy
}
ConvolutionEquation eqn(psf, dirty); // psf, and dirty are arrays defined
// elsewhere.
eqn.evaluate(result, currentModel); // Here result is the convolution of
// of the model with the psf.

Motivation

All the different image plane based clean algorithms have a common implementation in that they can use an array to store the current model. This class provides a way to abstract this functionality, as well as provide a mechanism to implement "clean boxes"

Template Type Argument Requirements (T)

the template arguement for this class can be just about anything, the use of this class with an equation class will significantly restrict the possible templates. I have used this class (or derivations of it) with the following data types. Float

Thrown Exceptions

class does not explicitly throw exceptions however the objects used by this class may

To Do

Definition at line 117 of file MaskedArrayModel.h.

Constructor & Destructor Documentation

template<class T >
casa::MaskedArrayModel< T >::MaskedArrayModel ( )

Default constructor sets the internal arrays to zero size.

template<class T >
casa::MaskedArrayModel< T >::MaskedArrayModel ( const casacore::MaskedArray< T > &  model)

Construct the model from a masked array.

The data is copied.

template<class T >
casa::MaskedArrayModel< T >::MaskedArrayModel ( const casacore::Array< T > &  model)

Construct the model from an array.

The mask is set to be fully transparent.

Member Function Documentation

template<class T >
void casa::MaskedArrayModel< T >::getModel ( casacore::Array< T > &  model) const

These functions return the model, either as a masked array or just the data array itself with the mask removed.

template<class T >
virtual void casa::MaskedArrayModel< T >::getModel ( casacore::MaskedArray< T > &  model) const
virtual
template<class T >
casacore::MaskedArray<T> casa::MaskedArrayModel< T >::getModel ( ) const
virtual

Return the current model.

Implements casa::LinearModel< casacore::MaskedArray< T > >.

template<class T >
void casa::MaskedArrayModel< T >::setModel ( const casacore::Array< T > &  model)

These functions are analogous to the constructors above and must be called when the default constructor is used.

If no mask is specified then it is by default set to totally transparent.

template<class T >
virtual void casa::MaskedArrayModel< T >::setModel ( const casacore::MaskedArray< T > &  model)
virtual

Set the current model.

Implements casa::LinearModel< casacore::MaskedArray< T > >.

Member Data Documentation

template<class T >
casacore::MaskedArray<T> casa::MaskedArrayModel< T >::theModel
protected

Definition at line 144 of file MaskedArrayModel.h.


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