casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MaskedHogbomCleanModel.h
Go to the documentation of this file.
1 //# MaskedHogbomCleanModel.h: this defines MaskedHogbomCleanModel
2 //# Copyright (C) 1996,1999
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_MASKEDHOGBOMCLEANMODEL_H
30 #define SYNTHESIS_MASKEDHOGBOMCLEANMODEL_H
31 
32 
33 #include <casa/aips.h>
38 
39 namespace casa { //# NAMESPACE CASA - BEGIN
40 
41 // <summary>
42 // A Class for performing Hogbom Clean's of Arrays
43 // </summary>
44 
45 // <use visibility=export>
46 
47 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
48 // </reviewed>
49 
50 // <prerequisite> <li> ResidualEquation/ConvolutionEquation <li>
51 // LinearModel/LinearEquation Paradigm </prerequisite>
52 //
53 // <etymology>
54 // This class is called HogbomCleanModel because thats the algorithm it uses
55 // deconvolve the model.
56 // </etymology>
57 //
58 // <synopsis>
59 // This class is used to perform the Hogbom Clean Algorithm on a
60 // MaskedArray. It is functionally equivalent to the HogbomCleanModel class and
61 // all the documention for that class will not be repreated here. The only
62 // difference is that the model used to represent the sky in this class is a
63 // casacore::MaskedArray, and hence this class can implement the concept of clean
64 // boxes.
65 //
66 // Masking is used to deliniate the search region when clean is determing
67 // the maximum residual as well as the region that is subtracted in the
68 // when calculating the residual image (if the ConvolutionEquation class is
69 // used in conjunction with this class). However Because this user
70 // calculates the residual using the ConvolutionEquation class (which ignores
71 // the mask) this will always return a residual that is accurate even in the
72 // masked regions of the image.
73 // </synopsis>
74 //
75 // <example>
76 // <srcblock>
77 // casacore::Matrix<casacore::Float> psf(12,12); // The psf cannot be masked!
78 // MaskedMatrix dirty(10,10), initialModel(10,10);
79 // ...put appropriate values into psf, dirty, & initialModel....
80 // ConvolutionEquation convEqn(psf, dirty);
81 // MaskedHogbomCleanModel<casacore::Float> deconvolvedModel(initialModel);
82 // deconvolvedModel.setGain(0.2);
83 // deconvolvedModel.setNumberIterations(1000);
84 // casacore::Bool convWorked = deconvolvedModel.solve(convEqn);
85 // casacore::Array<casacore::Float> finalModel, residuals;
86 // if (convWorked){
87 // finalModel = deconvolvedModel.getModel();
88 // ConvEqn.residual(deconvolvedModel, finalResidual);
89 // }
90 // </srcblock>
91 // </example>
92 //
93 // <motivation>
94 // This class is needed to deconvolve images.
95 // </motivation>
96 //
97 // <templating arg=T>
98 // I have tested this class with Arrays of
99 // <li> Float
100 // </templating>
101 //
102 //
103 // <todo asof="1996/05/02">
104 // <li> Check that Arrays of StokesVectors work as advertised
105 // <li> compare timing with other clean implementations (ie, Mark's
106 // CleanTools, SDE, AIPS & miriad)
107 // </todo>
108 
109 template<class T> class MaskedHogbomCleanModel:
110  public MaskedArrayModel<T>,
111  public Iterate
112 {
113 public:
114  // The default constructor does nothing more than initialise a zero length
115  // array to hold the deconvolved model. If this constructor is used then
116  // the actual model must be set using the setModel() function of the
117  // ArrayModel class.
119  // Construct the HogbomCleanModel object and initialise the model.
121  :MaskedArrayModel<T>(model){};
122  // Using a Hogbom clean deconvolution proceedure solve for an improved
123  // estimate of the deconvolved object. The convolution/residual equation
124  // contains the psf and dirty image. When called with a ResidualEquation
125  // arguement a quite general interface is used that is slow. The
126  // convolution equation contains functions that speed things up. The
127  // functions return false if the deconvolution could not be done.
128  // <group>
131  // </group>
132 
133  //# Make parent members known.
134 protected:
136 };
137 
138 
139 } //# NAMESPACE CASA - END
140 
141 #ifndef AIPS_NO_TEMPLATE_SRC
142 #include <synthesis/MeasurementEquations/MaskedHogbomCleanModel.tcc>
143 #endif //# AIPS_NO_TEMPLATE_SRC
144 #endif
Interface class containing functions returning &quot;Domain&quot; type.
Definition: Deconvolver.h:56
Implements the convolution equation.
MaskedHogbomCleanModel()
The default constructor does nothing more than initialise a zero length array to hold the deconvolved...
Class for masking an Array for operations on that Array.
casacore::Bool solve(ResidualEquation< casacore::MaskedArray< T > > &eqn)
Using a Hogbom clean deconvolution proceedure solve for an improved estimate of the deconvolved objec...
base class for models with an internal &amp; external representation as a casacore::MaskedArray ...
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
A Class for performing Hogbom Clean&#39;s of Arrays.
MaskedHogbomCleanModel(const casacore::MaskedArray< T > &model)
Construct the HogbomCleanModel object and initialise the model.
Base class for Iteration.
Definition: Iterate.h:40