casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
asap.interactivemask.interactivemask Class Reference

List of all members.

Public Member Functions

def __init__
def set_basemask
def set_startevent
def set_callback
def select_mask
def finish_selection
def clear_polygon
def get_mask

Public Attributes

 scan
 p
 newplot
 mask
 callback
 event
 once
 showmask
 rect
 xold
 yold
 xdataold
 ydataold

Private Member Functions

def _region_start
def _region_draw
def _region_end
def _update_mask
def _plot_mask

Private Attributes

 _polygons

Detailed Description

The class for interactive mask selection.

Example:
   my_mask=interactivemask(plotter,scan)
   my_mask.set_basemask(masklist=[[0,10],[90,100]],invert=False)
   # Do interactive mask selection
   my_mask.select_mask()
   finish=raw_input('Press return to finish selection.\n')
   my_mask.finish_selection(callback=func)
   mask=my_mask.get_mask()

Modify mask region by selecting a region on a plot with mouse.

Definition at line 6 of file interactivemask.py.


Constructor & Destructor Documentation

def asap.interactivemask.interactivemask.__init__ (   self,
  plotter = None,
  scan = None 
)
Create a interactive masking object.
Either or both 'plotter' or/and 'scan' should be defined.

Parameters:
   plotter: an ASAP plotter object for interactive selection
   scan: a scantable to create a mask interactively

Definition at line 22 of file interactivemask.py.


Member Function Documentation

def asap.interactivemask.interactivemask._region_draw (   self,
  event 
) [private]
def asap.interactivemask.interactivemask._region_end (   self,
  event 
) [private]
def asap.interactivemask.interactivemask._region_start (   self,
  event 
) [private]
def asap.interactivemask.interactivemask.finish_selection (   self,
  callback = None 
)
Execute callback function, reset or close plotter window as
necessary.

Parameters:
    callback: The post processing function to run after
      the mask selections are completed.
  Specifying the callback function here will overwrite
  the one set by set_callback(func)

Note this function is automatically called at the end of
select_mask() if once=True.

Definition at line 326 of file interactivemask.py.

References asap.interactivemask.interactivemask._polygons, asap.customgui_base.CustomFlagToolbarCommon._polygons, asap.interactivemask.interactivemask.callback, asap.interactivemask.interactivemask.clear_polygon(), asap.interactivemask.interactivemask.event, asap.customgui_tkagg.NotationWindowTkAgg.event, asap.customgui_qt4agg.NotationWindowQT4Agg.event, asap.customgui_base.NotationWindowCommon.event, asap.interactivemask.interactivemask.newplot, and asap.interactivemask.interactivemask.p.

Referenced by asap.interactivemask.interactivemask._region_end().

Get the interactively selected channel mask.
Returns:
    A list of channel mask.

Definition at line 368 of file interactivemask.py.

References asap.asapfitter.fitter.mask, and asap.interactivemask.interactivemask.mask.

def asap.interactivemask.interactivemask.select_mask (   self,
  once = False,
  showmask = True 
)
Do interactive mask selection.
Modify masks interactively by adding/deleting regions with
mouse drawing.(left-button: mask; right-button: UNmask)
Note that the interactive region selection is available only
when GUI plotter is active.

Parameters:
    once:     If specified as True, you can modify masks only
      once. Else if False, you can modify them repeatedly.
    showmask: If specified as True, the masked regions are plotted
      on the plotter.
  Note this parameter is valid only when once=True.
  Otherwise, maskes are forced to be plotted for reference.

Definition at line 124 of file interactivemask.py.

References asap.interactivemask.interactivemask._plot_mask(), asap.interactivemask.interactivemask._region_start(), asap.interactivemask.interactivemask.event, asap.customgui_tkagg.NotationWindowTkAgg.event, asap.customgui_qt4agg.NotationWindowQT4Agg.event, asap.customgui_base.NotationWindowCommon.event, asap.interactivemask.interactivemask.newplot, asap.interactivemask.interactivemask.once, asap.interactivemask.interactivemask.p, asap.interactivemask.interactivemask.scan, and asap.interactivemask.interactivemask.showmask.

def asap.interactivemask.interactivemask.set_basemask (   self,
  masklist = [],
  invert = False 
)
Set initial channel mask.

Parameters:
    masklist:  [[min, max], [min2, max2], ...]
       A list of pairs of start/end points (inclusive)
               specifying the regions to be masked
    invert:    optional argument. If specified as True,
       return an inverted mask, i.e. the regions
   specified are excluded
You can reset the mask selection by running this method with
the default parameters.

Definition at line 70 of file interactivemask.py.

References asap.utils._n_bools(), asap.asapfitter.fitter.mask, and asap.interactivemask.interactivemask.mask.

def asap.interactivemask.interactivemask.set_callback (   self,
  callback 
)
Set callback function to run when finish_selection() is executed.
    callback: The post processing function to run after
      the mask selections are completed.
  This will be overwritten if callback is defined in
  finish_selection(callback=func)

Definition at line 114 of file interactivemask.py.

References asap.interactivemask.interactivemask.callback.

Inherit an event from the parent function.

Parameters:
    event: 'button_press_event' object to be inherited to
   start interactive region selection .

Definition at line 99 of file interactivemask.py.

References asap.interactivemask.interactivemask.event, asap.customgui_tkagg.NotationWindowTkAgg.event, asap.customgui_qt4agg.NotationWindowQT4Agg.event, and asap.customgui_base.NotationWindowCommon.event.


Member Data Documentation


The documentation for this class was generated from the following file: