casacore
 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 class PGPlotter;
45 
46 // <summary>
47 // Abstract base class to monitor progress in lattice operations
48 // </summary>
49 
50 // <use visibility=export>
51 
52 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
53 // </reviewed>
54 
55 // <synopsis>
56 // This is an abstract base class for classes to monitor the
57 // progress of an operation on a Lattice. The default implementation
58 // offered by this class does nothing.
59 // However, a derived class could show the progress using for example
60 // a <linkto class=ProgressMeter>ProgressMeter</linkto>. A derived
61 // class should override the virtual functions from this class.
62 //
63 // The user of the LatticeCleanProgress object should first call
64 // function <src>init</src> with the total number of steps
65 // that are to be done. Thereafter, after each step has been
66 // executed, function <src>nstepsDone</src> should be called
67 // after each step. Finally, function <src>done</src> should
68 // be called.
69 // </synopsis>
70 
71 // <example>
72 // <srcblock>
73 // </srcblock>
74 // </example>
75 
76 // <motivation>
77 // Since operations on Lattices can take a while, it can be useful
78 // to show the progress. However, making module Lattices dependent on
79 // the class ProgressMeter sounded bad. This abstract class serves
80 // as a bridge between the Lattice module and the ProgressMeter class
81 // (or any other class showing the progress).
82 // </motivation>
83 //
84 //# <todo asof="1997/08/01">
85 //# <li>
86 //# </todo>
87 
88 
90 public:
91  LatticeCleanProgress(PGPlotter* pgplotter=0);
92 
93  virtual ~LatticeCleanProgress();
94 
95 
96  // Print and plot the information.
97  // Currently, not all information is utilized.
98  Bool info(const Bool lastcall,
99  const Int iteration,
100  const Int numberIterations,
101  const Vector<Float>& maxima,
102  const Block<IPosition>& posMaximum,
103  const Float strengthOptimum,
104  const Int optimumScale,
105  const IPosition& positionOptimum,
106  const Float& totalFlux,
107  const Vector<Float>& totalFluxScale,
108  const Bool resetBase=False);
109 
110 protected:
111 
112 private:
113 
114  // initizalize the arrays and such
115  void initialize(const uInt nScales,
116  const Float& maxResidual,
117  const uInt numIterations);
118 
119  // As the iterations trickle in, we will from time to time
120  // need to make the Matrices larger. Increase to 2*n+1
121  void resizeDataStorage();
122 
123  // this will redraw the plot with a new scale;
124  // if plotMatrices = False, just draw the boxes,
125  // else, replot all past data.
126  //
127  void basicSetUp(Bool plotMatrices = False);
128 
129  // Note: you MUST call basicSetUp before calling this.
130  void plotOne(const Int iteration,
131  const Vector<Float>& resid, const Vector<Float>& flux);
132 
134 
147 
153 
156 
158 
160 
161 };
162 
163 
164 
165 } //# NAMESPACE CASACORE - END
166 
167 #endif
A Vector of integers, for indexing into Array&lt;T&gt; objects.
Definition: IPosition.h:118
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...
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
Definition: Allocator.h:210
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