casacore
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>
33 #include <casacore/casa/Quanta/Quantum.h>
34 #include <casacore/lattices/Lattices/Lattice.h>
35 #include <casacore/lattices/Lattices/TempLattice.h>
36 #include <casacore/casa/Arrays/IPosition.h>
37 #include <casacore/casa/Containers/Block.h>
38 #include <casacore/casa/Arrays/Vector.h>
39 #include <casacore/casa/Arrays/Matrix.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:
94 
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
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
casacore::LatticeCleanProgress::totalFluxes
Vector< Float > totalFluxes
Definition: LatticeCleanProgress.h:142
casacore::Matrix< Float >
casacore::LatticeCleanProgress::logMinRes
Float logMinRes
Definition: LatticeCleanProgress.h:150
casacore::LatticeCleanProgress::currentIndex
uInt currentIndex
Definition: LatticeCleanProgress.h:143
casacore::IPosition
Definition: IPosition.h:120
casacore::LatticeCleanProgress::xMax
Float xMax
Definition: LatticeCleanProgress.h:154
casacore::LatticeCleanProgress
Definition: LatticeCleanProgress.h:91
casacore::LatticeCleanProgress::currentFluxScale
Float currentFluxScale
Definition: LatticeCleanProgress.h:145
casacore::LatticeCleanProgress::itsPgplotter
PGPlotter * itsPgplotter
Definition: LatticeCleanProgress.h:135
casacore::LatticeCleanProgress::basicSetUp
void basicSetUp(Bool plotMatrices=False)
this will redraw the plot with a new scale; if plotMatrices = False, just draw the boxes,...
casacore::LatticeCleanProgress::deltaY
Float deltaY
Definition: LatticeCleanProgress.h:152
casacore::LatticeCleanProgress::currentMaxResidual
Float currentMaxResidual
Definition: LatticeCleanProgress.h:147
casacore::LatticeCleanProgress::iterationNumber
Vector< Float > iterationNumber
Definition: LatticeCleanProgress.h:137
casacore::LatticeCleanProgress::currentMinFluxScale
Float currentMinFluxScale
Definition: LatticeCleanProgress.h:146
casacore::Float
float Float
Definition: aipstype.h:54
casacore::LatticeCleanProgress::fluxScaleJump
Float fluxScaleJump
Definition: LatticeCleanProgress.h:156
casacore::LatticeCleanProgress::currentMinResidual
Float currentMinResidual
Definition: LatticeCleanProgress.h:148
casacore::False
const Bool False
Definition: aipstype.h:44
casacore::uInt
unsigned int uInt
Definition: aipstype.h:51
casacore::LatticeCleanProgress::totalFluxesPer
Matrix< Float > totalFluxesPer
Definition: LatticeCleanProgress.h:141
casacore::LatticeCleanProgress::maxResiduals
Matrix< Float > maxResiduals
Definition: LatticeCleanProgress.h:138
casacore::LatticeCleanProgress::forbidden
Float forbidden
Definition: LatticeCleanProgress.h:159
casacore::LatticeCleanProgress::~LatticeCleanProgress
virtual ~LatticeCleanProgress()
casacore::Int
int Int
Definition: aipstype.h:50
casacore
this file contains all the compiler specific defines
Definition: mainpage.dox:28
casacore::LatticeCleanProgress::baseFluxes
Vector< Float > baseFluxes
Definition: LatticeCleanProgress.h:161
casacore::LatticeCleanProgress::logMaxRes
Float logMaxRes
Definition: LatticeCleanProgress.h:151
casacore::LatticeCleanProgress::initialize
void initialize(const uInt nScales, const Float &maxResidual, const uInt numIterations)
initizalize the arrays and such
casacore::LatticeCleanProgress::LatticeCleanProgress
LatticeCleanProgress(PGPlotter *pgplotter=0)
casacore::LatticeCleanProgress::info
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.
casacore::LatticeCleanProgress::negResiduals
Matrix< Float > negResiduals
Definition: LatticeCleanProgress.h:140
casacore::Bool
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
casacore::Block
simple 1-D array
Definition: Block.h:200
casacore::Vector< Float >
casacore::LatticeCleanProgress::xMin
Float xMin
Definition: LatticeCleanProgress.h:153
casacore::LatticeCleanProgress::posResiduals
Matrix< Float > posResiduals
Definition: LatticeCleanProgress.h:139
casacore::PGPlotter
Definition: PGPlotter.h:96
casacore::LatticeCleanProgress::plotOne
void plotOne(const Int iteration, const Vector< Float > &resid, const Vector< Float > &flux)
Note: you MUST call basicSetUp before calling this.
casacore::LatticeCleanProgress::resizeDataStorage
void resizeDataStorage()
As the iterations trickle in, we will from time to time need to make the Matrices larger.
casacore::LatticeCleanProgress::currentTotalIterations
uInt currentTotalIterations
Definition: LatticeCleanProgress.h:144
casacore::LatticeCleanProgress::residScaleJump
Float residScaleJump
Definition: LatticeCleanProgress.h:157