casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ImageNACleaner.h
Go to the documentation of this file.
1 //# ImageNACleaner.h: this defines Cleaner a class for doing deconvolution
2 //# Copyright (C) 2015
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 General Public License as published by
7 //# the Free Software Foundation; either version 3 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_IMAGENACLEANER_H
30 #define SYNTHESIS_IMAGENACLEANER_H
31 
32 //# Includes
35 namespace casacore{
36 
37 template <class T> class Matrix;
38 template <class T> class ImageInterface;
39 }
40 
41 namespace casa { //# NAMESPACE CASA - BEGIN
42 
43 //# Forward Declarations
44 
45 
46 
47 // <summary>A class interfacing images to MatrixNACleaner </summary>
48 
49 // <use visibility=export>
50 
51 // <reviewed reviewer="" date="yyyy/mm/dd" tests="tLatticeCleaner">
52 // </reviewed>
53 
54 // <prerequisite>
55 // <li> ImageInterface
56 // <li> MatrixNACleaner
57 // </prerequisite>
58 //
59 // <etymology>
60 
61 // The ImageCleaner class will use Non Amnesiac on Images.
62 
63 // </etymology>
64 //
65 // <synopsis>
66 // This class will perform some kind of Clean deconvolution
67 // on Lattices.
68 //
69 // </synopsis>
70 //
71 // <example>
72 // <srcblock>
73 // </srcblock>
74 // </example>
75 //
76 // <motivation>
77 // </motivation>
78 //
79 // <thrown>
80 // <li> casacore::AipsError: if psf has more dimensions than the model.
81 // </thrown>
82 //
83 
85 
86 {
87 
88  public:
89  //Default
91  // Create a cleaner with a psf and dirty image
93  //assignmemnt constructor
94  ImageNACleaner(const ImageNACleaner& other);
95  //assignment operator
96  ImageNACleaner & operator=(const ImageNACleaner & other);
97 
98  //The destructor
100 
101  // Update the dirty image only
103  // Change the psf image
105 
106 
107 
108  // niter - number of iterations
109  // gain - loop gain used in cleaning (a fraction of the maximum
110  // subtracted at every iteration)
111  // aThreshold - absolute threshold to stop iterations
112  // masksupport is +-number of pixel around a peak to remember
113  // memtype is memory function to use 0- no memory standard clean, 1 weak memory, 2 medium, 3 strong
114  // numsigma: keep memory of position if peak is above this value
115  void setcontrol(const casacore::Int niter,
116  const casacore::Float gain, const casacore::Quantity& aThreshold,
117  const casacore::Int masksupp=3, const casacore::Int memtype=2, const casacore::Float numSigma=5.0);
118 
119 
120  // return how many iterations we did do
121  casacore::Int iteration() const ;
122 
123 
124  // what iteration number to start on
125  void startingIteration(const casacore::Int starting = 0);
126 
127  // Clean an image.
128  //return value gives you a hint of what's happening
129  // 1 = converged
130  // 0 = not converged but behaving normally
131  // -1 = not converged and stopped on cleaning consecutive smallest scale
132  // -2 = not converged and either large scale hit negative or diverging
133  // -3 = clean is diverging rather than converging
135  const casacore::Int niter, const casacore::Float gain, const casacore::Quantity& threshold, const casacore::Int masksupp=3,
136  const casacore::Int memType=2, const casacore::Float numsigma=5.0);
137  // Set the mask
138  // mask - input mask lattice
139  // This is where the algorithm searched...the value of the mask shows the weight
140  //importance
141  // code is exactly the same as before this parameter has been introduced.
143  //Max residual after last clean
145 
146  private:
147  //Helper function to setup some param
149  const casacore::Quantity& threshold, const casacore::Int supp=3, const casacore::Int memType=2, const casacore::Float numsigma=5.0);
163 
164 };
165 
166 } //# NAMESPACE CASA - END
167 
168 #endif
ImageNACleaner & operator=(const ImageNACleaner &other)
assignment operator
casacore::Int iteration() const
return how many iterations we did do
A class interfacing images to MatrixNACleaner.
int Int
Definition: aipstype.h:50
LatticeExprNode mask(const LatticeExprNode &expr)
This function returns the mask of the given expression.
void setMask(casacore::ImageInterface< casacore::Float > &mask)
Set the mask mask - input mask lattice This is where the algorithm searched...the value of the mask ...
void setcontrol(const casacore::Int niter, const casacore::Float gain, const casacore::Quantity &aThreshold, const casacore::Int masksupp=3, const casacore::Int memtype=2, const casacore::Float numSigma=5.0)
niter - number of iterations gain - loop gain used in cleaning (a fraction of the maximum subtracted ...
void startingIteration(const casacore::Int starting=0)
what iteration number to start on
casacore::Int nImChan_p
casacore::Bool setupMatCleaner(const casacore::Int niter, const casacore::Float gain, const casacore::Quantity &threshold, const casacore::Int supp=3, const casacore::Int memType=2, const casacore::Float numsigma=5.0)
Helper function to setup some param.
MatrixNACleaner matClean_p
casacore::Float maxResidual()
Max residual after last clean.
casacore::CountedPtr< casacore::ImageInterface< casacore::Float > > psf_p
casacore::Int nPsfChan_p
casacore::Int polAxis_p
casacore::Int nImPol_p
Referenced counted pointer for constant data.
Definition: VisModelData.h:42
void setPsf(casacore::ImageInterface< casacore::Float > &psf)
Change the psf image.
~ImageNACleaner()
The destructor.
casacore::CountedPtr< casacore::ImageInterface< casacore::Float > > dirty_p
casacore::CountedPtr< casacore::ImageInterface< casacore::Float > > mask_p
ImageNACleaner()
Default.
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
float Float
Definition: aipstype.h:54
A simple deconvolver that masks by memory of previous peaks.
casacore::Int nMaskChan_p
casacore::Float maxResidual_p
void setDirty(casacore::ImageInterface< casacore::Float > &dirty)
Update the dirty image only.
casacore::Int chanAxis_p
casacore::Int nMaskPol_p
casacore::Int nPsfPol_p
casacore::Int clean(casacore::ImageInterface< casacore::Float > &model, const casacore::Int niter, const casacore::Float gain, const casacore::Quantity &threshold, const casacore::Int masksupp=3, const casacore::Int memType=2, const casacore::Float numsigma=5.0)
Clean an image.
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42