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
86
88public:
90
92
93
94 // Print and plot the information.
95 // Currently, not all information is utilized.
96 Bool info(const Bool lastcall,
97 const Int iteration,
98 const Int numberIterations,
99 const Vector<Float>& maxima,
100 const Block<IPosition>& posMaximum,
101 const Float strengthOptimum,
102 const Int optimumScale,
103 const IPosition& positionOptimum,
104 const Float& totalFlux,
105 const Vector<Float>& totalFluxScale,
106 const Bool resetBase=False);
107
108protected:
109
110private:
111
112 // initizalize the arrays and such
113 void initialize(const uInt nScales,
114 const Float& maxResidual,
115 const uInt numIterations);
116
117 // As the iterations trickle in, we will from time to time
118 // need to make the Matrices larger. Increase to 2*n+1
120
121 // this will redraw the plot with a new scale;
122 // if plotMatrices = False, just draw the boxes,
123 // else, replot all past data.
124 //
125 void basicSetUp(Bool plotMatrices = False);
126
127 // Note: you MUST call basicSetUp before calling this.
128 void plotOne(const Int iteration,
129 const Vector<Float>& resid, const Vector<Float>& flux);
130
132
145
151
154
156
158
159};
160
161
162
163} //# NAMESPACE CASACORE - END
164
165#endif
simple 1-D array
Definition Block.h:198
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
this file contains all the compiler specific defines
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