//# LatticeModel.h: this defines LatticeModel //# Copyright (C) 1996,1997,1999,2000 //# Associated Universities, Inc. Washington DC, USA. //# //# This library is free software; you can redistribute it and/or modify it //# under the terms of the GNU Library General Public License as published by //# the Free Software Foundation; either version 2 of the License, or (at your //# option) any later version. //# //# This library is distributed in the hope that it will be useful, but WITHOUT //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public //# License for more details. //# //# You should have received a copy of the GNU Library General Public License //# along with this library; if not, write to the Free Software Foundation, //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. //# //# Correspondence concerning AIPS++ should be addressed as follows: //# Internet email: aips2-request@nrao.edu. //# Postal address: AIPS++ Project Office //# National Radio Astronomy Observatory //# 520 Edgemont Road //# Charlottesville, VA 22903-2475 USA //# //# //# $Id$ #ifndef SYNTHESIS_LATTICEMODEL_H #define SYNTHESIS_LATTICEMODEL_H #include #include #include namespace casa { //# NAMESPACE CASA - BEGIN // models with an internal & external representation as an casacore::Lattice // // // // //
  • Lattices module //
  • LinearModel class //
  • LinearModel/LinearEquation paradigm // // // // An LatticeModel is a base class for Models that can be // represented by Lattices. It is expected that this class will be mainly // used as base classes for 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 // HogbomCleanModel // class. // // // // // // LatticeModel currentModel(); // Cannot use the model yet! // { // casacore::PagedImage bestGuess(Iposition(2,32,32)); // ... put your best guess into the casacore::Matrix ... // currentModel.setModel(bestGuess); // This does a real copy // } // ConvolutionEquation eqn(psf, dirty); // psf, and dirty are PagedImages defined // // elsewhere. // eqn.evaluate(result, currentModel); // Here result is the convolution of // // of the model with the psf. // // // // // All the different image plane based clean algorithms have a common // implementation in that they can use an casacore::Lattice (ie, casacore::PagedImage) // to store the current // model. This class provides a way to abstract this functionality. // // // // While 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 //
  • StokesVector // // // // This class does not explicitly throw exceptions however the objects used // by this class may // // // //
  • We don't have any "set" or "constructor" methods which // take constants. We work in terms of pointers now because of // casacore::Lattice::operator= is protected, and Ger said it was the right thing. // class LatticeModel :public LinearModel > { public: LatticeModel(casacore::Lattice& mod); // The destructor does nothing. virtual ~LatticeModel(); // returns a reference to the model virtual const casacore::Lattice & getModel() const { return *itsModelPtr;} // Change the underlying Model to to the one specified. Reference semantics // are used so that no data is copied. virtual void setModel(const casacore::Lattice & model) { itsModelPtr = model.clone(); } private: casacore::Lattice * itsModelPtr; }; } //# NAMESPACE CASA - END #endif