casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
CleanImageSkyModel.h
Go to the documentation of this file.
00001 //# CleanImageSkyModel.h: Definition for CleanImageSkyModel
00002 //# Copyright (C) 1996,1997,1998,2000
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_CLEANIMAGESKYMODEL_H
00030 #define SYNTHESIS_CLEANIMAGESKYMODEL_H
00031 
00032 #include <synthesis/MeasurementComponents/ImageSkyModel.h>
00033 
00034 namespace casa { //# NAMESPACE CASA - BEGIN
00035 
00036 // <summary> 
00037 // Image Sky Model: Image-based Model for the Sky Brightness
00038 // </summary>
00039 
00040 // <use visibility=export>
00041 
00042 // <reviewed reviewer="" date="" tests="" demos="">
00043 
00044 // <prerequisite>
00045 //   <li> <linkto class=SkyModel>SkyModel</linkto> class
00046 //   <li> <linkto class=SkyEquation>SkyEquation</linkto> class
00047 //   <li> <linkto class=ImageInterface>ImageInterface</linkto> class
00048 //   <li> <linkto class=PagedImage>PagedImage</linkto> class
00049 //   <li> <linkto module=MeasurementComponents>MeasurementComponents</linkto> module
00050 //   <li> <linkto class=VisSet>VisSet</linkto> class
00051 // </prerequisite>
00052 //
00053 // <etymology>
00054 // CleanImageSkyModel describes an interface for Models to be used in
00055 // the SkyEquation. It is derived from <linkto class=SkyModel>SkyModel</linkto>.
00056 // </etymology>
00057 //
00058 // <synopsis> 
00059 // A CleanImageSkyModel contains a number of separate models. The interface to
00060 // SkyEquation is via an image per model. <linkto class=SkyEquation>SkyEquation</linkto> uses this image to
00061 // calculate Fourier transforms, etc. Some (most) SkyModels are
00062 // solvable: the SkyEquation can be used by the SkyModel to return
00063 // gradients with respect to itself (via the image interface). Thus
00064 // for a SkyModel to solve for itself, it calls the SkyEquation
00065 // methods to get gradients of chi-squared with respect to the
00066 // image pixel values (thus returning an image: basically a residual
00067 // image). The SkyModel then uses these gradients as appropriate to
00068 // update itself.
00069 // </synopsis> 
00070 //
00071 // <example>
00072 // See the example for <linkto class=SkyModel>SkyModel</linkto>.
00073 // </example>
00074 //
00075 // <motivation>
00076 // The properties of a model of the sky must be described
00077 // for the <linkto class=SkyEquation>SkyEquation</linkto>.
00078 // </motivation>
00079 //
00080 // <todo asof="97/10/01">
00081 // <li> Multiple images in SkyModel
00082 // <li> ComponentModel
00083 // </todo>
00084 
00085 template <class T> class PagedImage;
00086 
00087 class CleanImageSkyModel : public ImageSkyModel {
00088 public:
00089 
00090   // Empty constructor
00091   CleanImageSkyModel();
00092 
00093   // Copy constructor
00094   CleanImageSkyModel(const CleanImageSkyModel& sm);
00095 
00096   // Has a mask for model?
00097   Bool hasMask(Int model=0);
00098 
00099   // Add a componentlist
00100   virtual Bool add(ComponentList& compList);
00101 
00102   // Add an image. maxNumXfr is the maximum Number of transfer functions
00103   // that we might want to associate with this image.
00104   virtual Int add(ImageInterface<Float>& image, const Int maxNumXfr=100);
00105   
00106   // Add an mask  
00107   virtual Bool addMask(Int image, ImageInterface<Float>& mask);
00108 
00109   // Has a flux mask?
00110   Bool hasFluxMask(Int model=0);
00111 
00112   virtual Bool addFluxMask(Int image, ImageInterface<Float>& fluxMask);
00113   
00114   ImageInterface<Float>& fluxMask(Int model=0);
00115 
00116   // Destructor
00117   virtual ~CleanImageSkyModel();
00118 
00119   // Assignment operator
00120   CleanImageSkyModel& operator=(const CleanImageSkyModel& other);
00121 
00122   // Return masks
00123   // <group>
00124   ImageInterface<Float>& mask(Int model=0);
00125   // </group>
00126   //set to search for peak in I^2+Q^2+U^2+V^2 domain or each stokes plane seperately
00127   //Ignored for hogbom and msclean for now
00128   virtual void setJointStokesClean(Bool joint=True);
00129 
00130 
00131    // Return the maximum absolute value from residual images per field
00132   virtual Float maxField(Vector<Float>& imagemax, Vector<Float>& imagemin);
00133 
00134 
00135 protected:
00136 
00137   PtrBlock<ImageInterface<Float> * > mask_p;
00138   PtrBlock<ImageInterface<Float> * > fluxmask_p;
00139   Bool doPolJoint_p;
00140 
00141 };
00142 
00143 
00144 
00145 } //# NAMESPACE CASA - END
00146 
00147 #endif
00148 
00149