casa  $Rev:20696$
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
casa::TPPlotter Class Reference

#include <TPPlotter.h>

List of all members.

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 > &region)
 Mark a rectangular region on the chosen panel with two mouse clicks at diagonally opposite corners.
Vector< IntsetMarkedRegions (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
CasaPyInterpreterPyInterp_p
 Execute and check python commands.
PyObject * px_p
 Pointers for PyArrayObject.
PyObject * py_p
Int nelem_p
Vector< Stringpointlabels_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
SLoglog
PtrBlock< PanelParams * > PPar_p
 PlotOption and Panel-specific parameters.
Bool usegui_p

Static Private Attributes

static String clname

Detailed Description

Definition at line 143 of file TPPlotter.h.


Constructor & Destructor Documentation

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.


Member Function Documentation

Int casa::TPPlotter::adjustPlotRange ( Int  panel) [private]

Adjust the plot range.

Int casa::TPPlotter::allocPlotArrays ( Int  size) [private]

PPDF : Manage memory for plot arrays into which data-to-be-plotted is accumulated while plotting.

Bool casa::TPPlotter::changeGuiButtonState ( String  button,
String  state 
)

Change the state of a button button : 'iternext','markregion','flag','unflag','locate' PPDF : state : 'enable','disable'.

Int casa::TPPlotter::clearPlot ( Int  panel = 0,
Bool  delaxes = True 
)

PPDF : Clear the plot window.

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::endPlot ( Int  panel) [private]
Int casa::TPPlotter::fillPlotArrays ( Double  xvalue,
Double  yvalue,
Int  index 
) [private]
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.

Int casa::TPPlotter::markRegions ( Int  nrows,
Int  ncols,
Int  panel,
Vector< Double > &  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.

Int casa::TPPlotter::plotData ( PtrBlock< BasePlot * > &  PBP,
Int  panel,
Int  newplot 
)

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)

Int casa::TPPlotter::plotXY ( Int  panel,
Int  layer,
Int  colour 
) [private]

PPDF : Call the plotting function draw routines.

Int casa::TPPlotter::readInRegions ( ) [private]

PPDF : Read in the user-selected flag regions from the plotting device.

Int casa::TPPlotter::resizePlotArrays ( Int  numpoints) [private]
Int casa::TPPlotter::runPlotCommand ( String  command)

PPDF : Back door for issuing commands to matplotlib.

Vector<Int> casa::TPPlotter::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.

Returns a vector of the number of flags per panel.

Int casa::TPPlotter::setPlotLabels ( Int  panel) [private]

PPDF : Set Plot labels from internally stored Vector of label strings.

Int casa::TPPlotter::setPlotOptions ( PtrBlock< PanelParams * > &  ppar)

Set Plotting options from an input record of plot options.

Int casa::TPPlotter::setPlotRange ( PtrBlock< BasePlot * > &  PBP,
Int  panel 
) [private]

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.

Int casa::TPPlotter::setWindowOptions ( Double  windowsize,
Double  aspectratio 
) [private]

PPDF : Set windowsize, aspectratio.

Int casa::TPPlotter::show ( )
Int casa::TPPlotter::startPlot ( Int  panel,
Int  newplot 
) [private]

PPDF : Set plot environment parameters for a panel.

Sets up the viewport and window (world) coordinates from SetFlagRegions

Int casa::TPPlotter::thePlot ( BasePlot BP,
Int  panel,
Int  layer 
) [private]

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 !


Member Data Documentation

String casa::TPPlotter::clname [static, private]

Definition at line 291 of file TPPlotter.h.

Definition at line 279 of file TPPlotter.h.

Definition at line 290 of file TPPlotter.h.

Definition at line 277 of file TPPlotter.h.

Definition at line 285 of file TPPlotter.h.

Definition at line 283 of file TPPlotter.h.

Definition at line 283 of file TPPlotter.h.

Definition at line 282 of file TPPlotter.h.

Definition at line 270 of file TPPlotter.h.

Definition at line 278 of file TPPlotter.h.

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.

Execute and check python commands.

Definition at line 273 of file TPPlotter.h.

Definition at line 288 of file TPPlotter.h.

Definition at line 288 of file TPPlotter.h.

Definition at line 288 of file TPPlotter.h.

Definition at line 288 of file TPPlotter.h.

Definition at line 288 of file TPPlotter.h.

Definition at line 287 of file TPPlotter.h.

Definition at line 287 of file TPPlotter.h.

Definition at line 287 of file TPPlotter.h.

Definition at line 282 of file TPPlotter.h.

Definition at line 282 of file TPPlotter.h.

Definition at line 296 of file TPPlotter.h.

Definition at line 281 of file TPPlotter.h.

Definition at line 281 of file TPPlotter.h.

Definition at line 281 of file TPPlotter.h.

Definition at line 281 of file TPPlotter.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines