casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LatticeCleanProgress.h
Go to the documentation of this file.
1 //# LatticeCleanProgress.h: Abstract base class to monitor progress in lattice operations
2 //# Copyright (C) 1997,1998,1999,2000
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be addressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //# $Id$
27 
28 #ifndef LATTICES_LATTICECLEANPROGRESS_H
29 #define LATTICES_LATTICECLEANPROGRESS_H
30 
31 //# Includes
32 #include <casacore/casa/aips.h>
40 
41 namespace casacore { //# NAMESPACE CASACORE - BEGIN
42 
43 //# Forward Declarations
44 template <class T> class Vector;
45 template <class T> class Matrix;
46 class PGPlotter;
47 
48 // <summary>
49 // Abstract base class to monitor progress in lattice operations
50 // </summary>
51 
52 // <use visibility=export>
53 
54 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
55 // </reviewed>
56 
57 // <synopsis>
58 // This is an abstract base class for classes to monitor the
59 // progress of an operation on a Lattice. The default implementation
60 // offered by this class does nothing.
61 // However, a derived class could show the progress using for example
62 // a <linkto class=ProgressMeter>ProgressMeter</linkto>. A derived
63 // class should override the virtual functions from this class.
64 //
65 // The user of the LatticeCleanProgress object should first call
66 // function <src>init</src> with the total number of steps
67 // that are to be done. Thereafter, after each step has been
68 // executed, function <src>nstepsDone</src> should be called
69 // after each step. Finally, function <src>done</src> should
70 // be called.
71 // </synopsis>
72 
73 // <example>
74 // <srcblock>
75 // </srcblock>
76 // </example>
77 
78 // <motivation>
79 // Since operations on Lattices can take a while, it can be useful
80 // to show the progress. However, making module Lattices dependent on
81 // the class ProgressMeter sounded bad. This abstract class serves
82 // as a bridge between the Lattice module and the ProgressMeter class
83 // (or any other class showing the progress).
84 // </motivation>
85 //
86 //# <todo asof="1997/08/01">
87 //# <li>
88 //# </todo>
89 
90 
92 public:
93  LatticeCleanProgress(PGPlotter* pgplotter=0);
94 
95  virtual ~LatticeCleanProgress();
96 
97 
98  // Print and plot the information.
99  // Currently, not all information is utilized.
100  Bool info(const Bool lastcall,
101  const Int iteration,
102  const Int numberIterations,
103  const Vector<Float>& maxima,
104  const Block<IPosition>& posMaximum,
105  const Float strengthOptimum,
106  const Int optimumScale,
107  const IPosition& positionOptimum,
108  const Float& totalFlux,
109  const Vector<Float>& totalFluxScale,
110  const Bool resetBase=False);
111 
112 protected:
113 
114 private:
115 
116  // initizalize the arrays and such
117  void initialize(const uInt nScales,
118  const Float& maxResidual,
119  const uInt numIterations);
120 
121  // As the iterations trickle in, we will from time to time
122  // need to make the Matrices larger. Increase to 2*n+1
123  void resizeDataStorage();
124 
125  // this will redraw the plot with a new scale;
126  // if plotMatrices = False, just draw the boxes,
127  // else, replot all past data.
128  //
129  void basicSetUp(Bool plotMatrices = False);
130 
131  // Note: you MUST call basicSetUp before calling this.
132  void plotOne(const Int iteration,
133  const Vector<Float>& resid, const Vector<Float>& flux);
134 
136 
149 
155 
158 
160 
162 
163 };
164 
165 
166 
167 } //# NAMESPACE CASACORE - END
168 
169 #endif
A Vector of integers, for indexing into Array&lt;T&gt; objects.
Definition: IPosition.h:119
int Int
Definition: aipstype.h:50
void basicSetUp(Bool plotMatrices=False)
this will redraw the plot with a new scale; if plotMatrices = False, just draw the boxes...
std::vector< double > Vector
Definition: ds9context.h:24
void resizeDataStorage()
As the iterations trickle in, we will from time to time need to make the Matrices larger...
void initialize(const uInt nScales, const Float &maxResidual, const uInt numIterations)
initizalize the arrays and such
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
float Float
Definition: aipstype.h:54
Abstract base class to monitor progress in lattice operations.
const Bool False
Definition: aipstype.h:44
simple 1-D array
Standard plotting object for application programmers.
Definition: PGPlotter.h:95
LatticeCleanProgress(PGPlotter *pgplotter=0)
Bool info(const Bool lastcall, const Int iteration, const Int numberIterations, const Vector< Float > &maxima, const Block< IPosition > &posMaximum, const Float strengthOptimum, const Int optimumScale, const IPosition &positionOptimum, const Float &totalFlux, const Vector< Float > &totalFluxScale, const Bool resetBase=False)
Print and plot the information.
void plotOne(const Int iteration, const Vector< Float > &resid, const Vector< Float > &flux)
Note: you MUST call basicSetUp before calling this.
unsigned int uInt
Definition: aipstype.h:51
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42