casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
ClarkCleanImageSkyModel.h
Go to the documentation of this file.
00001 //# ClarkCleanImageSkyModel.h: Definition for ClarkCleanImageSkyModel
00002 //# Copyright (C) 1996,1997,1998,1999,2000,2003
00003 //# Associated Universities, Inc. Washington DC, USA.
00004 //#
00005 //# This library is free software; you can redistribute it and/or modify it
00006 //# under the terms of the GNU Library General Public License as published by
00007 //# the Free Software Foundation; either version 2 of the License, or (at your
00008 //# option) any later version.
00009 //#
00010 //# This library is distributed in the hope that it will be useful, but WITHOUT
00011 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00012 //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00013 //# License for more details.
00014 //#
00015 //# You should have received a copy of the GNU Library General Public License
00016 //# along with this library; if not, write to the Free Software Foundation,
00017 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
00018 //#
00019 //# Correspondence concerning AIPS++ should be adressed as follows:
00020 //#        Internet email: aips2-request@nrao.edu.
00021 //#        Postal address: AIPS++ Project Office
00022 //#                        National Radio Astronomy Observatory
00023 //#                        520 Edgemont Road
00024 //#                        Charlottesville, VA 22903-2475 USA
00025 //#
00026 //#
00027 //# $Id$
00028 
00029 #ifndef SYNTHESIS_CLARKCLEANIMAGESKYMODEL_H
00030 #define SYNTHESIS_CLARKCLEANIMAGESKYMODEL_H
00031 
00032 #include <synthesis/MeasurementComponents/CleanImageSkyModel.h>
00033 namespace casa { //# NAMESPACE CASA - BEGIN
00034 
00035 //forward
00036 class SkyEquation;
00037 class ClarkCleanProgress;
00038 template <class T> class SubLattice;
00039 template <class T> class RO_LatticeIterator;
00040 // <summary> 
00041 // Clark Image Sky Model: Image Sky Model implementing the Clark Clean algorithm
00042 // </summary>
00043 
00044 // <use visibility=export>
00045 
00046 // <reviewed reviewer="" date="" tests="" demos="">
00047 
00048 // <prerequisite>
00049 //   <li> <linkto class=ImageSkyModel>ImageSkyModel</linkto> module
00050 //   <li> <linkto class=ClarkCleanLatModel>ClarkCleanLatModel</linkto> module
00051 // </prerequisite>
00052 //
00053 // <etymology>
00054 // ClarkCleanImageSkyModel implements the Clark Clean algorithm.
00055 // It is derived from <linkto class=SkyModel>SkyModel</linkto>.
00056 // </etymology>
00057 //
00058 // <synopsis> 
00059 // The Clark Clean is an FFT-based clean algorithm. Cleaning is
00060 // split into major and minor cycles. In a minor cycle, the
00061 // brightest pixels are cleaned using only the strongest sidelobes
00062 // (and main lobe) of the PSF. In the major cycle, a fully correct
00063 // subtraction of the PSF is done for all points accumulated in the
00064 // minor cycle using an FFT-based convolution for speed.
00065 //
00066 // The Clark Clean is implemented using the 
00067 // <linkto class=ClarkCleanLatModel>ClarkCleanLatModel</linkto>
00068 // class.
00069 //
00070 // Masking is optionally performed using a mask image: only points
00071 // where the mask is non-zero are cleaned. If no mask is specified
00072 // all points in the inner quarter of the image are cleaned.
00073 // </synopsis> 
00074 //
00075 // <example>
00076 // See the example for <linkto class=SkyModel>SkyModel</linkto>.
00077 // </example>
00078 //
00079 // <motivation>
00080 // </motivation>
00081 //
00082 // <todo asof="97/10/01">
00083 // <ul> Allow specification of more control parameters
00084 // </todo>
00085 
00086 class ClarkCleanImageSkyModel : public CleanImageSkyModel {
00087 public:
00088 
00089   // constructor
00090   ClarkCleanImageSkyModel();
00091 
00092   // destructor
00093   ~ClarkCleanImageSkyModel();
00094 
00095   // Solve for this SkyModel
00096   virtual Bool solve (SkyEquation& me);
00097 
00098   //Do the image-based clean
00099   //iterused and maxresidual are return values
00100   static Bool clean(ImageInterface<Float>& image, ImageInterface<Float> & residual, ImageInterface<Float>& psf, 
00101                     ImageInterface<Float>& mask, Float& maxresidual, Int& iterused, Float gain, Int numIter,  Float thresh, Float cycleFactor, Bool useMask=False, Bool doPolJoint=True);
00102  
00103 private:
00104    //make a mask sub-lattice
00105 
00106   static Lattice<Float>* makeMaskSubLat(const Int& nx, 
00107                                  const Int& ny, Int& newNx, Int& newNy,
00108                                     RO_LatticeIterator<Float>& maskIter,
00109                                     Int& xbeg, Int& xend, 
00110                                     Int& ybeg, Int& yend);
00111 
00112   ClarkCleanProgress *itsProgress;
00113 
00114 };
00115 
00116 
00117 } //# NAMESPACE CASA - END
00118 
00119 #endif
00120 
00121 
00122 
00123 
00124 
00125 
00126