casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
IPLatConvEquation.h
Go to the documentation of this file.
1 //# IPLatConvEquation.h: this defines IPLatConvEquation
2 //# Copyright (C) 1996,1997,1998,1999,2000
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be addressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //#
27 //# $Id$
28 
29 #ifndef SYNTHESIS_IPLATCONVEQUATION_H
30 #define SYNTHESIS_IPLATCONVEQUATION_H
31 
32 
33 #include <casa/aips.h>
37 #include <casa/Arrays/IPosition.h>
38 #include <casa/Arrays/Array.h>
39 
40 namespace casa { //# NAMESPACE CASA - BEGIN
41 
42 template <class Domain> class LinearModel;
43 
44 
45 // <summary> Implements the image plane lattice convolution equation </summary>
46 
47 // <use visibility=local>
48 
49 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
50 // </reviewed>
51 
52 // <prerequisite>
53 // <li> <linkto class="LatConvEquation">LatConvEquation</linkto>
54 // (or similar classes)
55 // </prerequisite>
56 //
57 // <etymology>
58 // This class implements image plane (ie, single dish) convolution equation
59 // within the LinearEquation framework, using Lattices.
60 // </etymology>
61 //
62 // <synopsis>
63 // This class is used in conjunction with classes like HogbomCleanModel to
64 // implement deconvolution algorithms. This class contains the point spread
65 // function (psf) and the convolved data (dirty image), and is able to
66 // convolve a supplied model with the psf to produce a predicted output
67 // (using the evaluate() function), or to subtract the convolved data and
68 // produce a residual (using the residual() function).
69 //
70 // See the documentation for
71 // <linkto class=HogbomCleanModel>HogbomCleanModel</linkto>
72 // for an example of how this class can be used to perform deconvolution.
73 //
74 // This class also contains specialised functions (like the version of
75 // evaluate() for a point source model) that speed up the calculation of the
76 // convolution. This specialised version of evaluate() does not need to
77 // actually perform the convolution and instead returns a suitable part of
78 // the psf (zero padded if necessary). When this function is called this
79 // class will get the psf from the convolver and cache it, on the assumption
80 // that many evaluations of this function will be requested (as occurs in
81 // Clean algorithms).
82 //
83 // The size and shape of the psf and the supplied model may be different. The
84 // only restriction is that the dimension of the psf must be less than or
85 // equal to the dimension of the model. If the dimension of the
86 // model is larger than the dimension of the psf then the convolution
87 // will be repeated along the slowest moving (last) axis. The dirty image
88 // and the supplied model must be the same size and shape.
89 //
90 //
91 // </synopsis>
92 //
93 // <example>
94 // <srcblock>
95 // casacore::PagedArray<casacore::Float> psf(2,4,4), dirty(2,20,20), model(2,20,20);
96 // .... put some meaningful values into these Lattices....
97 // // create a convolution equation, and a casacore::PagedArray model
98 // LatConvEquation convEqn(psf, dirty);
99 // LinearModel< casacore::Lattice<casacore::Float> > myModel(model);
100 // // now calculate the convolution of the model and the psf
101 // casacore::PagedArray<casacore::Float> prediction;
102 // convEqn.evaluate(myModel, prediction);
103 // // and calculate the difference between the predicted and actual convolution
104 // casacore::PagedArray<casacore::Float> residual;
105 // convEqn.residual(mymodel, residual)
106 // </srcblock>
107 // </example>
108 //
109 // <motivation>
110 // This class was designed with deconvolution in mind.
111 // </motivation>
112 //
113 // <todo asof="1990/05/03">
114 // <li> Reinstate the evaluate() method with position argument.
115 // <li> Fix up copies and references with Ralph Marson's help
116 // <li> This class is not templated. If necessary I would use templating
117 // to produce a casacore::Double Precision Version.
118 // </todo>
119 
121  public LatConvEquation
122 {
123 public:
124 
125  // Construct the LatConvEquation setting the psf and measured data
128 
129  // Somewhere I read that a destructor should alway be defined even if it
130  // does nothing (as this one does).
131  virtual ~IPLatConvEquation();
132 
133  // Calculate the convolution of the model (supplied by the LinearModel
134  // class) and the psf and the difference between this and the supplied
135  // (presumably measured) convolution.
138 
139  // Calculate the convolution of the model (supplied by the LinearModel
140  // class) and the psf and the difference between this and the supplied
141  // (presumably measured) convolution. Also return chisq.
144 
145 private:
146 
147  // Don't use this one, due to the casacore::Lattice<casacore::Float> &
149 
150  // Factor by which we normalize the PSF for the second convolution
152 
153 };
154 
155 
156 } //# NAMESPACE CASA - END
157 
158 #endif
Implements the image plane lattice convolution equation.
Implements the convolution equation.
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
float Float
Definition: aipstype.h:54
virtual ~IPLatConvEquation()
Somewhere I read that a destructor should alway be defined even if it does nothing (as this one does)...
casacore::Float itsQ
Factor by which we normalize the PSF for the second convolution.
virtual casacore::Bool residual(casacore::Lattice< casacore::Float > &result, const LinearModel< casacore::Lattice< casacore::Float > > &model)
Calculate the convolution of the model (supplied by the LinearModel class) and the psf and the differ...
IPLatConvEquation()
Don&#39;t use this one, due to the casacore::Lattice&lt;casacore::Float&gt; &amp;.
Provides a model for use in model fitting applications.