LatticeCleanerProgress.h
Classes
- LatticeCleanerProgress -- Abstract base class to monitor progress in lattice operations (full description)
Interface
- Public Members
- LatticeCleanerProgress(PGPlotter* pgplotter=0)
- virtual ~LatticeCleanerProgress()
- Bool info(const Bool lastcall, const Int iteration, const Int numberIterations, const Lattice<T>& model, const Vector<Float>& maxima, const Vector<Block>& posMaximum, const Float strengthOptimum, const Int optimumScale, const Block& positionOptimum, const Float& totalFlux, const Vector<Float>& totalFluxScale, const PtrBlock<TempLattice<T>* >& residuals, const Bool resetBase=False)
- Private Members
- void initialize(const uInt nScales, const Float& maxResidual, const uInt numIterations)
- void resizeDataStorage()
- void basicSetUp(Bool plotMatrices = False)
- void plotOne(const Int iteration, const Vector<Float>& resid, const Vector<Float>& flux)
Review Status
- Date Reviewed:
- yyyy/mm/dd
Synopsis
This is an abstract base class for classes to monitor the
progress of an operation on a Lattice. The default implementation
offered by this class does nothing.
However, a derived class could show the progress using for example
a ProgressMeter. A derived
class should override the virtual functions from this class.
The user of the LatticeCleanerProgress object should first call
function init with the total number of steps
that are to be done. Thereafter, after each step has been
executed, function nstepsDone should be called
after each step. Finally, function done should
be called.
Example
Motivation
Since operations on Lattices can take a while, it can be useful
to show the progress. However, making module Lattices dependent on
the class ProgressMeter sounded bad. This abstract class serves
as a bridge between the Lattice module and the ProgressMeter class
(or any other class showing the progress).
Member Description
Bool info(const Bool lastcall, const Int iteration, const Int numberIterations, const Lattice<T>& model, const Vector<Float>& maxima, const Vector<Block>& posMaximum, const Float strengthOptimum, const Int optimumScale, const Block& positionOptimum, const Float& totalFlux, const Vector<Float>& totalFluxScale, const PtrBlock<TempLattice<T>* >& residuals, const Bool resetBase=False)
Print and plot the information.
Currently, not all information is utilized.
void initialize(const uInt nScales, const Float& maxResidual, const uInt numIterations)
initizalize the arrays and such
As the iterations trickle in, we will from time to time
need to make the Matrices larger. Increase to 2*n+1
void basicSetUp(Bool plotMatrices = False)
this will redraw the plot with a new scale;
if plotMatrices = False, just draw the boxes,
else, replot all past data.
void plotOne(const Int iteration, const Vector<Float>& resid, const Vector<Float>& flux)
Note: you MUST call basicSetUp before calling this.