casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
CEMemProgress.h
Go to the documentation of this file.
00001 //# CEMemProgress.h:  monitor progress in Mem
00002 //# Copyright (C) 1997,1998,1999,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 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_CEMEMPROGRESS_H
00029 #define SYNTHESIS_CEMEMPROGRESS_H
00030  
00031 //# Includes
00032 #include <casa/aips.h>
00033 #include <casa/Quanta/Quantum.h>
00034 #include <lattices/Lattices/Lattice.h>
00035 #include <lattices/Lattices/TempLattice.h>
00036 #include <casa/Arrays/IPosition.h>
00037 #include <casa/Arrays/Vector.h>
00038 
00039 namespace casa { //# NAMESPACE CASA - BEGIN
00040 
00041 //# Forward Declarations
00042 template <class T> class Vector;
00043 class PGPlotter;
00044 
00045 // <summary>
00046 // Class to monitor progress in MEM deconvolution
00047 // </summary>
00048 
00049 // <use visibility=export>
00050 
00051 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
00052 // </reviewed>
00053 
00054 // <synopsis>
00055 // </synopsis>
00056 
00057 // <example>
00058 // <srcblock>
00059 // </srcblock>
00060 // </example>
00061 
00062 // <motivation>
00063 // Since operations on Lattices can take a while, it can be useful
00064 // to show the progress. However, making module Lattices dependent on
00065 // the class ProgressMeter sounded bad. This abstract class serves
00066 // as a bridge between the Lattice module and the ProgressMeter class
00067 // (or any other class showing the progress).
00068 // </motivation>
00069 //
00070 //# <todo asof="1997/08/01">   
00071 //#   <li> 
00072 //# </todo>
00073 
00074 
00075 class CEMemProgress {
00076 public:
00077 
00078   enum EntType {
00079     ENTROPY=0,
00080     EMPINESS=1
00081   };
00082   
00083 
00084 
00085   CEMemProgress(PGPlotter* pgplotter=0);
00086 
00087   virtual ~CEMemProgress();
00088   
00089  // people usually don't worry about maximum residual with MEM; we'll do it, though
00090 
00091   void info(const Bool lastcall,
00092             const Int iteration,
00093             const Int numberIterations,
00094             const Lattice<Float>& model,
00095             const Lattice<Float>& resid,
00096             const Float& maximumRes,         
00097             const IPosition& posMaximum,
00098             const Float& totalFlux,
00099             const Float& sigma,
00100             const Float& normGrad,
00101             const Float& entropy);
00102   
00103 protected:
00104 
00105 private:
00106 
00107   void basicSetUp(Bool doPlot = False);
00108 
00109   void plotOne(const Int iteration, 
00110                const Float sigma, const Float maxResid, 
00111                const Float flux);
00112 
00113   PGPlotter* itsPgplotter;
00114 
00115   Vector<Float> itsIterationNumbers;
00116   Vector<Float> itsTotalFluxes;
00117   Vector<Float> itsMaxResiduals;
00118   Vector<Float> itsSigmas;
00119   Vector<Float> itsNormGrads;
00120   Vector<Float> itsEntropies;
00121   uInt itsCurrentIndex;
00122   uInt itsCurrentTotalIterations;
00123   Float itsCurrentFluxScale;
00124   Float itsCurrentMaxResidualScale;
00125   Float itsCurrentSigmaScale;        
00126   Float itsCurrentNormGradScale;        
00127   Float itsCurrentEntropyScale;        
00128 };
00129 
00130 
00131 
00132 } //# NAMESPACE CASA - END
00133 
00134 #endif