ClarkCleanProgress.h

Classes

ClarkCleanProgress -- Abstract base class to monitor progress in lattice operations (full description)

class ClarkCleanProgress

Interface

Public Members
ClarkCleanProgress(PGPlotter* pgplotter=0, Int plotterIncrement=10)
virtual ~ClarkCleanProgress()
Bool info(const Bool lastcall, const Int iteration, const Int numberIterations, const Float& maximum, const IPosition& posMaximum, const Float& totalFlux, const Bool majorIteration, const Bool resetBase=False)
Bool finalize()
Bool hasPGPlotter()
Private Members
void basicSetUp(Bool doPlot = False)
void plotOne(const Int iteration, const Float resid, const Float flux)
void plotVectors()

Description

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 ClarkCleanProgress 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

ClarkCleanProgress(PGPlotter* pgplotter=0, Int plotterIncrement=10)

virtual ~ClarkCleanProgress()

delete its PGPlotter

Bool info(const Bool lastcall, const Int iteration, const Int numberIterations, const Float& maximum, const IPosition& posMaximum, const Float& totalFlux, const Bool majorIteration, const Bool resetBase=False)

Plot the information if it has a PGPlotter

Bool finalize()

Finish up any aspects of the plot which need to be finished

Bool hasPGPlotter()

returns true if we have a live pgplotter_pointer Use: do a try { progress_pointer->hasPGPlotter(); }

void basicSetUp(Bool doPlot = False)

draw the outline of the plot; If doplot = True, redraw all the past data as well. THIS ASSUMES WE HAVE A VALID PGPLOTTER

void plotOne(const Int iteration, const Float resid, const Float flux)

plot just the current points THIS ASSUMES WE HAVE A VALID PGPLOTTER

void plotVectors()

replot all points, but don't redraw plotter THIS ASSUMES WE HAVE A VALID PGPLOTTER