casacore
Loading...
Searching...
No Matches
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: casa-feedback@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#ifndef LATTICES_LATTICECLEANPROGRESS_H
27#define LATTICES_LATTICECLEANPROGRESS_H
28
29// # Includes
30#include <casacore/casa/aips.h>
31#include <casacore/casa/Quanta/Quantum.h>
32#include <casacore/lattices/Lattices/Lattice.h>
33#include <casacore/lattices/Lattices/TempLattice.h>
34#include <casacore/casa/Arrays/IPosition.h>
35#include <casacore/casa/Containers/Block.h>
36#include <casacore/casa/Arrays/Vector.h>
37#include <casacore/casa/Arrays/Matrix.h>
38
39namespace casacore { // # NAMESPACE CASACORE - BEGIN
40
41// # Forward Declarations
42class PGPlotter;
43
44// <summary>
45// Abstract base class to monitor progress in lattice operations
46// </summary>
47
48// <use visibility=export>
49
50// <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
51// </reviewed>
52
53// <synopsis>
54// This is an abstract base class for classes to monitor the
55// progress of an operation on a Lattice. The default implementation
56// offered by this class does nothing.
57// However, a derived class could show the progress using for example
58// a <linkto class=ProgressMeter>ProgressMeter</linkto>. A derived
59// class should override the virtual functions from this class.
60//
61// The user of the LatticeCleanProgress object should first call
62// function <src>init</src> with the total number of steps
63// that are to be done. Thereafter, after each step has been
64// executed, function <src>nstepsDone</src> should be called
65// after each step. Finally, function <src>done</src> should
66// be called.
67// </synopsis>
68
69// <example>
70// <srcblock>
71// </srcblock>
72// </example>
73
74// <motivation>
75// Since operations on Lattices can take a while, it can be useful
76// to show the progress. However, making module Lattices dependent on
77// the class ProgressMeter sounded bad. This abstract class serves
78// as a bridge between the Lattice module and the ProgressMeter class
79// (or any other class showing the progress).
80// </motivation>
81//
82// # <todo asof="1997/08/01">
83// # <li>
84// # </todo>
85
87 public:
89
91
92 // Print and plot the information.
93 // Currently, not all information is utilized.
94 Bool info(const Bool lastcall, const Int iteration, const Int numberIterations,
95 const Vector<Float>& maxima, const Block<IPosition>& posMaximum,
96 const Float strengthOptimum, const Int optimumScale, const IPosition& positionOptimum,
97 const Float& totalFlux, const Vector<Float>& totalFluxScale,
98 const Bool resetBase = False);
99
100 protected:
101 private:
102 // initizalize the arrays and such
103 void initialize(const uInt nScales, const Float& maxResidual, const uInt numIterations);
104
105 // As the iterations trickle in, we will from time to time
106 // need to make the Matrices larger. Increase to 2*n+1
108
109 // this will redraw the plot with a new scale;
110 // if plotMatrices = False, just draw the boxes,
111 // else, replot all past data.
112 //
113 void basicSetUp(Bool plotMatrices = False);
114
115 // Note: you MUST call basicSetUp before calling this.
116 void plotOne(const Int iteration, const Vector<Float>& resid, const Vector<Float>& flux);
117
119
132
138
141
143
145};
146
147} // namespace casacore
148
149#endif
void resizeDataStorage()
As the iterations trickle in, we will from time to time need to make the Matrices larger.
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.
LatticeCleanProgress(PGPlotter *pgplotter=0)
void basicSetUp(Bool plotMatrices=False)
this will redraw the plot with a new scale; if plotMatrices = False, just draw the boxes,...
void initialize(const uInt nScales, const Float &maxResidual, const uInt numIterations)
initizalize the arrays and such
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28
const Bool False
Definition aipstype.h:42
unsigned int uInt
Definition aipstype.h:49
float Float
Definition aipstype.h:52
int Int
Definition aipstype.h:48
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40