casa
$Rev:20696$
|
#include <TPPlotter.h>
Public Member Functions | |
TPPlotter () | |
Default Constructor. | |
TPPlotter (Bool usegui) | |
Constructor that is to be used to decide between GUI + command-line vs only commmand-line mode. | |
~TPPlotter () | |
Destructor. | |
Int | setPlotOptions (PtrBlock< PanelParams * > &ppar) |
Set Plotting options from an input record of plot options. | |
Int | plotData (PtrBlock< BasePlot * > &PBP, Int panel, Int newplot) |
Read data from Baseplots and plot the data. | |
Int | markRegions (Int nrows, Int ncols, Int panel, Vector< Double > ®ion) |
Mark a rectangular region on the chosen panel with two mouse clicks at diagonally opposite corners. | |
Vector< Int > | setMarkedRegions (PtrBlock< PtrBlock< BasePlot * > * > &PPBP) |
Passes on the list of marked flag regions (created by single or multiple calls to MarkFlags) to each of the tables/subtables in the input list of BasePlot objects. | |
Int | runPlotCommand (String command) |
PPDF : Back door for issuing commands to matplotlib. | |
Int | clearPlot (Int panel=0, Bool delaxes=True) |
PPDF : Clear the plot window. | |
Int | setupPlotter () |
Set up the plotter. | |
Bool | changeGuiButtonState (String button, String state) |
Change the state of a button button : 'iternext','markregion','flag','unflag','locate' PPDF : state : 'enable','disable'. | |
Bool | closeWindow () |
function to close the plot window.....\. | |
Int | show () |
Private Member Functions | |
Int | setPlotRange (PtrBlock< BasePlot * > &PBP, Int panel) |
Consolidate ranges from all BasePlots and set plot range. | |
Int | thePlot (BasePlot &BP, Int panel, Int layer) |
Do the actual plotting. | |
Int | startPlot (Int panel, Int newplot) |
PPDF : Set plot environment parameters for a panel. | |
Int | endPlot (Int panel) |
Int | initPlot () |
The following are Plotting Package Specific functions. | |
Int | closePlot () |
PPDF : Clean up leftovers from the python interpreter. | |
Int | setWindowOptions (Double windowsize, Double aspectratio) |
PPDF : Set windowsize, aspectratio. | |
Int | setPlotLabels (Int panel) |
PPDF : Set Plot labels from internally stored Vector of label strings. | |
Int | markInteractiveRegion () |
PPDF :Mark a Rectangular region (currently via 2 mouse clicks) and draw a hatched rectangle to mark the region. | |
Int | readInRegions () |
PPDF : Read in the user-selected flag regions from the plotting device. | |
Int | allocPlotArrays (Int size) |
PPDF : Manage memory for plot arrays into which data-to-be-plotted is accumulated while plotting. | |
Int | fillPlotArrays (Double xvalue, Double yvalue, Int index) |
Int | resizePlotArrays (Int numpoints) |
Int | plotXY (Int panel, Int layer, Int colour) |
PPDF : Call the plotting function draw routines. | |
Int | adjustPlotRange (Int panel) |
Adjust the plot range. | |
void | TPPlotterError (String msg) |
Exceptions ! | |
Private Attributes | |
Int | PlotPackage_p |
CasaPyInterpreter * | PyInterp_p |
Execute and check python commands. | |
PyObject * | px_p |
Pointers for PyArrayObject. | |
PyObject * | py_p |
Int | nelem_p |
Vector< String > | pointlabels_p |
Vector< Vector< Int > > | layernplots_p |
Double | Xmin_p |
Double | Xmax_p |
Double | Ymin_p |
Double | Ymax_p |
Int | pcnt_p |
Int | totalpcnt_p |
Int | totalflagpcnt_p |
Double | oldwindowsize_p |
Double | oldaspectratio_p |
Int | nflagmarks_p |
Timer | tmr |
Timer | tmr1 |
Timer | tmr2 |
Double | tcount1 |
Double | tcount2 |
Double | tcount3 |
Double | tcount4 |
Double | tcount5 |
SLog * | log |
PtrBlock< PanelParams * > | PPar_p |
PlotOption and Panel-specific parameters. | |
Bool | usegui_p |
Static Private Attributes | |
static String | clname |
Definition at line 143 of file TPPlotter.h.
casa::TPPlotter::TPPlotter | ( | ) |
Default Constructor.
casa::TPPlotter::TPPlotter | ( | Bool | usegui | ) |
Constructor that is to be used to decide between GUI + command-line vs only commmand-line mode.
casa::TPPlotter::~TPPlotter | ( | ) |
Destructor.
PPDF : Manage memory for plot arrays into which data-to-be-plotted is accumulated while plotting.
Change the state of a button button : 'iternext','markregion','flag','unflag','locate' PPDF : state : 'enable','disable'.
Int casa::TPPlotter::closePlot | ( | ) | [private] |
PPDF : Clean up leftovers from the python interpreter.
Bool casa::TPPlotter::closeWindow | ( | ) |
function to close the plot window.....\.
PPDF : needs to be called just before the destructor.
Int casa::TPPlotter::initPlot | ( | ) | [private] |
The following are Plotting Package Specific functions.
If a new plotting package is to be used, these are the functions that need to be modified.
PPDF : Initialize the plotter object
Int casa::TPPlotter::markInteractiveRegion | ( | ) | [private] |
PPDF :Mark a Rectangular region (currently via 2 mouse clicks) and draw a hatched rectangle to mark the region.
Mark a rectangular region on the chosen panel with two mouse clicks at diagonally opposite corners.
For matplotlib This functions responds to a user-controlled rubber-band box on the plot, to mark the flag region. For pgplot This function grabs two mouse click events via the plotting package,and draws a hatched rectangle on the plot panel.
It then appends the area co-ordinates to a list of flag regions maintained per panel in the TPPlotter class.
Read data from Baseplots and plot the data.
For the chosen panel, this function reads the data from all BasePlots in the input list, applies the stored flags, and (Will be improved to optionally plot with/without applying flags, or plotting only flagged or unflagged data)
PPDF : Call the plotting function draw routines.
Int casa::TPPlotter::readInRegions | ( | ) | [private] |
PPDF : Read in the user-selected flag regions from the plotting device.
PPDF : Back door for issuing commands to matplotlib.
Passes on the list of marked flag regions (created by single or multiple calls to MarkFlags) to each of the tables/subtables in the input list of BasePlot objects.
Returns a vector of the number of flags per panel.
Int casa::TPPlotter::setPlotOptions | ( | PtrBlock< PanelParams * > & | ppar | ) |
Set Plotting options from an input record of plot options.
Consolidate ranges from all BasePlots and set plot range.
For the chosen panel, this function queries all the BasePlot objects held in the input list for the ranges of data being plotted from each BasePlot object. It then combines these ranges along with zooming ranges (if applicable) to create the final world-coordinate plot range for the panel.
Int casa::TPPlotter::setupPlotter | ( | ) |
Set up the plotter.
PPDF : Set windowsize, aspectratio.
Int casa::TPPlotter::show | ( | ) |
PPDF : Set plot environment parameters for a panel.
Sets up the viewport and window (world) coordinates from SetFlagRegions
Do the actual plotting.
Read xdata,ydata,flags from the input BasePlot object, accumulate data-to-be-plotted (usually unflagged data) into plot arrays and call the plotting package draw routines. (Modify (if possible) to not have to accumulate data into separate plot arrays before calling the plot draw routines. This would be trivial if the plotting package draw routines could work with a (Bool) mask.)
void casa::TPPlotter::TPPlotterError | ( | String | msg | ) | [private] |
Exceptions !
String casa::TPPlotter::clname [static, private] |
Definition at line 291 of file TPPlotter.h.
Vector<Vector<Int> > casa::TPPlotter::layernplots_p [private] |
Definition at line 279 of file TPPlotter.h.
SLog* casa::TPPlotter::log [private] |
Definition at line 290 of file TPPlotter.h.
Int casa::TPPlotter::nelem_p [private] |
Definition at line 277 of file TPPlotter.h.
Int casa::TPPlotter::nflagmarks_p [private] |
Definition at line 285 of file TPPlotter.h.
Double casa::TPPlotter::oldaspectratio_p [private] |
Definition at line 283 of file TPPlotter.h.
Double casa::TPPlotter::oldwindowsize_p [private] |
Definition at line 283 of file TPPlotter.h.
Int casa::TPPlotter::pcnt_p [private] |
Definition at line 282 of file TPPlotter.h.
Int casa::TPPlotter::PlotPackage_p [private] |
Definition at line 270 of file TPPlotter.h.
Vector<String> casa::TPPlotter::pointlabels_p [private] |
Definition at line 278 of file TPPlotter.h.
PtrBlock<PanelParams*> casa::TPPlotter::PPar_p [private] |
PlotOption and Panel-specific parameters.
Definition at line 294 of file TPPlotter.h.
PyObject* casa::TPPlotter::px_p [private] |
Pointers for PyArrayObject.
Definition at line 276 of file TPPlotter.h.
PyObject * casa::TPPlotter::py_p [private] |
Definition at line 276 of file TPPlotter.h.
CasaPyInterpreter* casa::TPPlotter::PyInterp_p [private] |
Execute and check python commands.
Definition at line 273 of file TPPlotter.h.
Double casa::TPPlotter::tcount1 [private] |
Definition at line 288 of file TPPlotter.h.
Double casa::TPPlotter::tcount2 [private] |
Definition at line 288 of file TPPlotter.h.
Double casa::TPPlotter::tcount3 [private] |
Definition at line 288 of file TPPlotter.h.
Double casa::TPPlotter::tcount4 [private] |
Definition at line 288 of file TPPlotter.h.
Double casa::TPPlotter::tcount5 [private] |
Definition at line 288 of file TPPlotter.h.
Timer casa::TPPlotter::tmr [private] |
Definition at line 287 of file TPPlotter.h.
Timer casa::TPPlotter::tmr1 [private] |
Definition at line 287 of file TPPlotter.h.
Timer casa::TPPlotter::tmr2 [private] |
Definition at line 287 of file TPPlotter.h.
Int casa::TPPlotter::totalflagpcnt_p [private] |
Definition at line 282 of file TPPlotter.h.
Int casa::TPPlotter::totalpcnt_p [private] |
Definition at line 282 of file TPPlotter.h.
Bool casa::TPPlotter::usegui_p [private] |
Definition at line 296 of file TPPlotter.h.
Double casa::TPPlotter::Xmax_p [private] |
Definition at line 281 of file TPPlotter.h.
Double casa::TPPlotter::Xmin_p [private] |
Definition at line 281 of file TPPlotter.h.
Double casa::TPPlotter::Ymax_p [private] |
Definition at line 281 of file TPPlotter.h.
Double casa::TPPlotter::Ymin_p [private] |
Definition at line 281 of file TPPlotter.h.