casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ClarkCleanProgress.h
Go to the documentation of this file.
1 //# ClarkCleanProgress.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 SYNTHESIS_CLARKCLEANPROGRESS_H
29 #define SYNTHESIS_CLARKCLEANPROGRESS_H
30 
31 //# Includes
32 #include <casa/aips.h>
33 #include <casa/Quanta/Quantum.h>
36 #include <casa/Arrays/IPosition.h>
37 #include <casa/Arrays/Vector.h>
38 
39 namespace casacore{
40 
41 template <class T> class Vector;
42 class PGPlotter;
43 // the class ProgressMeter sounded bad. This abstract class serves
44 }
45 
46 namespace casa { //# NAMESPACE CASA - BEGIN
47 
48 //# Forward Declarations
49 
50 // <summary>
51 // Abstract base class to monitor progress in lattice operations
52 // </summary>
53 
54 // <use visibility=export>
55 
56 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
57 // </reviewed>
58 
59 // <synopsis>
60 // This is an abstract base class for classes to monitor the
61 // progress of an operation on a Lattice. The default implementation
62 // offered by this class does nothing.
63 // However, a derived class could show the progress using for example
64 // a <linkto class=casacore::ProgressMeter>ProgressMeter</linkto>. A derived
65 // class should override the virtual functions from this class.
66 //
67 // The user of the ClarkCleanProgress object should first call
68 // function <src>init</src> with the total number of steps
69 // that are to be done. Thereafter, after each step has been
70 // executed, function <src>nstepsDone</src> should be called
71 // after each step. Finally, function <src>done</src> should
72 // be called.
73 // </synopsis>
74 
75 // <example>
76 // <srcblock>
77 // </srcblock>
78 // </example>
79 
80 // <motivation>
81 // Since operations on Lattices can take a while, it can be useful
82 // to show the progress. However, making module Lattices dependent on
83 // as a bridge between the casacore::Lattice module and the casacore::ProgressMeter class
84 // (or any other class showing the progress).
85 // </motivation>
86 //
87 //# <todo asof="1997/08/01">
88 //# <li>
89 //# </todo>
90 
91 
93 public:
94  ClarkCleanProgress(casacore::PGPlotter* pgplotter=0, casacore::Int plotterIncrement=10);
95 
96  // delete its PGPlotter
97  virtual ~ClarkCleanProgress();
98 
99  // Plot the information if it has a PGPlotter
100  casacore::Bool info(const casacore::Bool lastcall,
101  const casacore::Int iteration,
102  const casacore::Int numberIterations,
103  const casacore::Float& maximum,
104  const casacore::IPosition& posMaximum,
105  const casacore::Float& totalFlux,
106  const casacore::Bool majorIteration,
107  const casacore::Bool resetBase=false);
108 
109  // Finish up any aspects of the plot which need to be finished
111 
112  // returns true if we have a live pgplotter_pointer
113  // Use: do a try { progress_pointer->hasPGPlotter(); }
115 
116 protected:
117 
118 private:
119 
120  // draw the outline of the plot;
121  // If doplot = true, redraw all the past data as well.
122  // THIS ASSUMES WE HAVE A VALID PGPLOTTER
123  void basicSetUp(casacore::Bool doPlot = false);
124 
125  // plot just the current points
126  // THIS ASSUMES WE HAVE A VALID PGPLOTTER
127  void plotOne(const casacore::Int iteration,
128  const casacore::Float resid, const casacore::Float flux);
129 
130  // replot all points, but don't redraw plotter
131  // THIS ASSUMES WE HAVE A VALID PGPLOTTER
132  void plotVectors();
133 
135 
147 
148  // we are going to plot all points, but not all at once; every Increment iterations
150 
152 
153 };
154 
155 
156 
157 } //# NAMESPACE CASA - END
158 
159 #endif
A Vector of integers, for indexing into Array&lt;T&gt; objects.
Definition: IPosition.h:119
casacore::Float currentMinFluxScale
int Int
Definition: aipstype.h:50
std::vector< double > Vector
Definition: ds9context.h:24
casacore::Bool finalize()
Finish up any aspects of the plot which need to be finished.
casacore::Vector< casacore::Float > posResiduals
casacore::Float currentMinResidual
void plotOne(const casacore::Int iteration, const casacore::Float resid, const casacore::Float flux)
plot just the current points THIS ASSUMES WE HAVE A VALID PGPLOTTER
void basicSetUp(casacore::Bool doPlot=false)
draw the outline of the plot; If doplot = true, redraw all the past data as well. ...
ClarkCleanProgress(casacore::PGPlotter *pgplotter=0, casacore::Int plotterIncrement=10)
casacore::Vector< casacore::Float > negResiduals
casacore::Float currentMaxResidual
casacore::uInt currentTotalIterations
casacore::Vector< casacore::Float > totalFluxes
Abstract base class to monitor progress in lattice operations.
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
casacore::Bool info(const casacore::Bool lastcall, const casacore::Int iteration, const casacore::Int numberIterations, const casacore::Float &maximum, const casacore::IPosition &posMaximum, const casacore::Float &totalFlux, const casacore::Bool majorIteration, const casacore::Bool resetBase=false)
Plot the information if it has a PGPlotter.
casacore::Vector< casacore::Float > maxResiduals
float Float
Definition: aipstype.h:54
void plotVectors()
replot all points, but don&#39;t redraw plotter THIS ASSUMES WE HAVE A VALID PGPLOTTER ...
casacore::PGPlotter * itsPgplotter
Standard plotting object for application programmers.
Definition: PGPlotter.h:95
virtual ~ClarkCleanProgress()
delete its PGPlotter
casacore::Bool hasPGPlotter()
returns true if we have a live pgplotter_pointer Use: do a try { progress_pointer-&gt;hasPGPlotter(); } ...
casacore::Vector< casacore::Float > iterationNumber
casacore::Int plottingIncrement
we are going to plot all points, but not all at once; every Increment iterations
casacore::Float currentFluxScale
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