casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
WFCleanImageSkyModel.h
Go to the documentation of this file.
00001 //# WFCleanImageSkyModel.h: Definition for WFCleanImageSkyModel
00002 //# Copyright (C) 1996,1997,1998,1999,2002
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_WFCLEANIMAGESKYMODEL_H
00030 #define SYNTHESIS_WFCLEANIMAGESKYMODEL_H
00031 
00032 #include <synthesis/MeasurementComponents/MFCleanImageSkyModel.h>
00033 namespace casa { //# NAMESPACE CASA - BEGIN
00034 
00035 //forward
00036 class SkyEquation;
00037 template <class T> class SubImage;
00038 
00039 // <summary> 
00040 // WF Image Sky Model: Image Sky Model implementing the WF Clean algorithm
00041 // </summary>
00042 
00043 // <use visibility=export>
00044 
00045 // <reviewed reviewer="" date="" tests="" demos="">
00046 
00047 // <prerequisite>
00048 //   <li> <linkto class=ImageSkyModel>ImageSkyModel</linkto> module
00049 //   <li> <linkto class=MFCleanImageSkyModel>MFCleanImageSkyModel</linkto> module
00050 // </prerequisite>
00051 //
00052 // <etymology>
00053 // WFCleanImageSkyModel implements the WF Clean algorithm.
00054 // It is derived from <linkto class=MFCleanImageSkyModel>MFCleanImageSkyModel</linkto>.
00055 // </etymology>
00056 //
00057 // <synopsis> 
00058 // The WF Clean is an FFT-based clean algorithm. Cleaning is
00059 // split into major and minor cycles. In a minor cycle, the
00060 // brightest pixels are cleaned using only the strongest sidelobes
00061 // (and main lobe) of the PSF. In the major cycle, a fully correct
00062 // subtraction of the PSF is done for all points accumulated in the
00063 // minor cycle using an FFT-based convolution for speed.
00064 //
00065 // The WF Clean is implemented using the 
00066 // <linkto class=MFCleanImageSkyModel>MFCleanImageSkyModel</linkto>
00067 // class.
00068 //
00069 // Masking is optionally performed using a mask image: only points
00070 // where the mask is non-zero are cleaned. If no mask is specified
00071 // all points in the inner quarter of the image are cleaned.
00072 // </synopsis> 
00073 //
00074 // <example>
00075 // See the example for <linkto class=SkyModel>SkyModel</linkto>.
00076 // </example>
00077 //
00078 // <motivation>
00079 // </motivation>
00080 //
00081 // <todo asof="97/10/01">
00082 // <ul> Allow specification of more control parameters
00083 // </todo>
00084 
00085 class WFCleanImageSkyModel : public MFCleanImageSkyModel {
00086 public:
00087 
00088   WFCleanImageSkyModel();
00089 
00090   virtual ~WFCleanImageSkyModel();
00091 
00092   WFCleanImageSkyModel(const Int nfacets, Bool largeMemory=False);
00093 
00094   virtual Int add(ImageInterface<Float>& image, const Int maxNumXfr=100);
00095 
00096   virtual Bool addResidual(Int image, ImageInterface<Float>& residual);
00097 
00098   virtual Bool addMask(Int image, ImageInterface<Float>& mask);
00099 
00100   // Solve for this SkyModel
00101   virtual Bool solve (SkyEquation& me);
00102 
00103   //This will return for model 0 the main residual image i.e nxn facets
00104   virtual ImageInterface<Float>& getResidual(Int physImageID);
00105 
00106   //void makeApproxPSFs(SkyEquation& se);
00107   
00108   /*
00109   PtrBlock<TempImage<Complex> *>& cimageBlkPtr() { return cimage_p;};
00110   PtrBlock<Matrix<Float> * >& weightBlkPtr(){return weight_p; } ;
00111   */
00112 protected:
00113 
00114   // Make a facet
00115   SubImage<Float>* makeFacet(Int facet, ImageInterface<Float>& image);
00116 
00117   // Make the slicers
00118   Bool makeSlicers(const Int facet, const IPosition& imageShape, 
00119                    IPosition& facetShape,
00120                    Slicer& imageSlicer);
00121   // Number of facets
00122   Int nfacets_p;
00123 
00124 
00125 private:
00126 
00127   CountedPtr<ImageInterface<Float> > imageImage_p;
00128   CountedPtr<ImageInterface<Float> > residualImage_p;
00129   CountedPtr<ImageInterface<Float> > maskImage_p;
00130 
00131   Int facets_p;
00132   Bool largeMem_p;
00133 
00134   // Here we store the facets for the various images: Model, Mask
00135   // and Residual
00136   Block<CountedPtr<SubImage<Float> > > facetImages_p;
00137   Block<CountedPtr<SubImage<Float> > > facetMaskImages_p;
00138   Block<CountedPtr<SubImage<Float> > > facetResidualImages_p;
00139   
00140 };
00141 
00142 
00143 } //# NAMESPACE CASA - END
00144 
00145 #endif
00146 
00147