casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
ResidualAlgorithm.h
Go to the documentation of this file.
00001 //# ResidualAlgorithm.h: Parallel residual image formation
00002 //# Copyright (C) 1996,1997,1998,1999,2000,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 addressed 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 //# $Id$
00027 
00028 #ifndef SYNTHESIS_RESIDUALALGORITHM_H
00029 #define SYNTHESIS_RESIDUALALGORITHM_H
00030 
00031 #include <casa/BasicSL/String.h>
00032 #include <synthesis/Parallel/Algorithm.h>
00033 #include <synthesis/Parallel/Applicator.h>
00034 #include <synthesis/MSVis/VisSet.h>
00035 #include <synthesis/MSVis/VisSetUtil.h>
00036 #include <images/Images/ImageInterface.h>
00037 #include <images/Images/PagedImage.h>
00038 #include <images/Images/TempImage.h>
00039 #include <synthesis/TransformMachines/GridFT.h>
00040 #include <synthesis/TransformMachines/FTMachine.h>
00041 
00042 namespace casa { //# NAMESPACE CASA - BEGIN
00043 
00044 // <summary> Parallel residual image formation </summary>
00045 
00046 // <use visibility=export>
00047 
00048 // <reviewed reviewer="" date="" tests="" demos="">
00049 
00050 // <prerequisite>
00051 //   <li> <linkto module="FTMachine">FTMachine</linkto> module
00052 //     <li> <linkto module="Applicator">Algorithm</linkto> module
00053 // </prerequisite>
00054 //
00055 // <etymology>
00056 // From "residual image" and "parallel algorithm"
00057 // </etymology>
00058 //
00059 // <synopsis> 
00060 // This class is called by PSkyEquation to form residual image
00061 // using parallelization within the Applicator/Algorithm framework
00062 // </synopsis> 
00063 //
00064 // <example>
00065 // <srcblock>
00066 
00067 // </srcblock>
00068 // </example>
00069 //
00070 // <motivation>
00071 // Encapsulate the parallelized residual image formation 
00072 // </motivation>
00073 //
00074 // <todo asof="01/7/20">
00075 // <li> Does not support time-variable SkyJones
00076 // </todo>
00077 
00078 
00079 class ResidualAlgorithm : public Algorithm {
00080  public:
00081   // Default constructor and destructor
00082   ResidualAlgorithm();
00083   ~ResidualAlgorithm();
00084 
00085   // Get the input data and parameters from the controller
00086   void get();
00087 
00088   // Return the results to the controller
00089   void put();
00090 
00091   // Return the name of the algorithm
00092   String &name();
00093 
00094  private:
00095   // Private data
00096   Int model_p;
00097   TempImage<Complex> *cImage_p;
00098   String myName_p;
00099   String msName_p;
00100   Bool incremental_p;
00101   Matrix<Float> *weight_p;
00102   TempImage<Float> psf_p;
00103   FTMachine* ft_p;
00104   MeasurementSet *ms_p ; 
00105 
00106   // Form the residual image
00107   void task();
00108 
00109   // Local utility functions
00110   void initializePut(const VisBuffer& vb, Int model);
00111   void putResidualVis(VisBuffer& vb, Int model);
00112 
00113 };
00114 
00115 
00116 } //# NAMESPACE CASA - END
00117 
00118 #endif