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 |
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.
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.
def asap.interactivemask.interactivemask._plot_mask | ( | self | ) | [private] |
Definition at line 295 of file interactivemask.py.
References asap.interactivemask.interactivemask._polygons, asap.customgui_base.CustomFlagToolbarCommon._polygons, asap.asapfitter.fitter.mask, and asap.interactivemask.interactivemask.mask.
Referenced by asap.interactivemask.interactivemask._update_mask(), and asap.interactivemask.interactivemask.select_mask().
def asap.interactivemask.interactivemask._region_draw | ( | self, | |
event | |||
) | [private] |
Definition at line 224 of file interactivemask.py.
References asap.interactivemask.interactivemask.rect, asap.asaplotbase.asaplotbase.rect, asap.interactivemask.interactivemask.xdataold, asap.customgui_base.CustomToolbarCommon.xdataold, asap.customgui_base.CustomFlagToolbarCommon.xdataold, asap.interactivemask.interactivemask.xold, asap.customgui_base.CustomToolbarCommon.xold, asap.customgui_base.CustomFlagToolbarCommon.xold, asap.interactivemask.interactivemask.ydataold, and asap.interactivemask.interactivemask.yold.
Referenced by asap.interactivemask.interactivemask._region_start().
def asap.interactivemask.interactivemask._region_end | ( | self, | |
event | |||
) | [private] |
Definition at line 239 of file interactivemask.py.
References asap.interactivemask.interactivemask._update_mask(), asap.interactivemask.interactivemask.callback, asap.interactivemask.interactivemask.finish_selection(), asap.interactivemask.interactivemask.once, asap.interactivemask.interactivemask.rect, asap.asaplotbase.asaplotbase.rect, asap.interactivemask.interactivemask.xdataold, asap.customgui_base.CustomToolbarCommon.xdataold, asap.customgui_base.CustomFlagToolbarCommon.xdataold, asap.interactivemask.interactivemask.xold, asap.customgui_base.CustomToolbarCommon.xold, asap.customgui_base.CustomFlagToolbarCommon.xold, asap.interactivemask.interactivemask.ydataold, and asap.interactivemask.interactivemask.yold.
Referenced by asap.interactivemask.interactivemask._region_start().
def asap.interactivemask.interactivemask._region_start | ( | self, | |
event | |||
) | [private] |
Definition at line 207 of file interactivemask.py.
References asap.interactivemask.interactivemask._region_draw(), asap.interactivemask.interactivemask._region_end(), asap.interactivemask.interactivemask.rect, and asap.asaplotbase.asaplotbase.rect.
Referenced by asap.interactivemask.interactivemask.select_mask().
def asap.interactivemask.interactivemask._update_mask | ( | self | ) | [private] |
Definition at line 268 of file interactivemask.py.
References asap.interactivemask.interactivemask._plot_mask(), asap.asapfitter.fitter.mask, asap.interactivemask.interactivemask.mask, asap.utils.mask_and(), asap.utils.mask_or(), asap.interactivemask.interactivemask.rect, asap.asaplotbase.asaplotbase.rect, and asap.interactivemask.interactivemask.showmask.
Referenced by asap.interactivemask.interactivemask._region_end().
Erase masks plots from the plotter.
Definition at line 357 of file interactivemask.py.
References asap.interactivemask.interactivemask._polygons, and asap.customgui_base.CustomFlagToolbarCommon._polygons.
Referenced by asap.interactivemask.interactivemask.finish_selection().
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().
def asap.interactivemask.interactivemask.get_mask | ( | self | ) |
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.
def asap.interactivemask.interactivemask.set_startevent | ( | self, | |
event | |||
) |
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.
Definition at line 67 of file interactivemask.py.
Referenced by asap.interactivemask.interactivemask._plot_mask(), asap.interactivemask.interactivemask.clear_polygon(), and asap.interactivemask.interactivemask.finish_selection().
Definition at line 58 of file interactivemask.py.
Referenced by asap.interactivemask.interactivemask._region_end(), asap.interactivemask.interactivemask.finish_selection(), and asap.interactivemask.interactivemask.set_callback().
Definition at line 59 of file interactivemask.py.
Referenced by asap.interactivemask.interactivemask.finish_selection(), asap.interactivemask.interactivemask.select_mask(), and asap.interactivemask.interactivemask.set_startevent().
Definition at line 57 of file interactivemask.py.
Referenced by asap.interactivemask.interactivemask._plot_mask(), asap.interactivemask.interactivemask._update_mask(), asap.interactivemask.interactivemask.get_mask(), asap.interactivemask.interactivemask.set_basemask(), and tests.test_clean.clean_multims_test.test_multims5().
Definition at line 45 of file interactivemask.py.
Referenced by asap.interactivemask.interactivemask.finish_selection(), and asap.interactivemask.interactivemask.select_mask().
Definition at line 60 of file interactivemask.py.
Referenced by asap.interactivemask.interactivemask._region_end(), and asap.interactivemask.interactivemask.select_mask().
Definition at line 44 of file interactivemask.py.
Referenced by asap.interactivemask.interactivemask.finish_selection(), and asap.interactivemask.interactivemask.select_mask().
Definition at line 43 of file interactivemask.py.
Referenced by task_sdplot.sdplot_worker.__dogrid(), task_sdfit.sdfit_worker.__get_initial_guess(), task_sdfit.sdfit_worker._set_linelist_auto(), task_sdfit.sdfit_worker._set_linelist_interact(), task_sdflag.sdflag_worker.command_flag(), task_sdflagmanager.sdflagmanager_worker.execute(), task_sdscale.sdscale_worker.execute(), task_sdsmooth.sdsmooth_worker.execute(), task_sdcal.sdcal_worker.execute(), task_sdplot.sdplot_worker.execute(), parallel.parallel_cont.imagecont.imagechan(), parallel.parallel_cont.imagecont.imagechan_new(), parallel.parallel_cont.imagecont.imagechan_selfselect(), parallel.parallel_cont.imagecont.imagecont(), parallel.parallel_cont.imagecont.imagecontbychan(), parallel.parallel_cont.imagecont.imagecontmultims(), task_sdflag.sdflag_worker.interactive_flag(), task_sdcoadd.sdcoadd_worker.merge(), task_sdplot.sdplot_worker.plot_azel(), task_sdplot.sdplot_worker.plot_grid(), task_sdplot.sdplot_worker.plot_pointing(), task_sdplot.sdplot_worker.plot_spectra(), task_sdplot.sdplot_worker.plot_totalpower(), task_sdscale.sdscale_worker.save(), task_sdsave.sdsave_worker.save(), task_sdsmooth.sdsmooth_worker.save(), task_sdbaseline.sdbaseline_worker.save(), task_sdcoadd.sdcoadd_worker.save(), task_sdmath.sdmath_worker.save(), task_sdflag.sdflag_worker.save(), asap.interactivemask.interactivemask.select_mask(), and task_sdcoadd.sdcoadd_worker.set_to_scan().
Definition at line 61 of file interactivemask.py.
Referenced by asap.interactivemask.interactivemask._update_mask(), and asap.interactivemask.interactivemask.select_mask().
Definition at line 65 of file interactivemask.py.
Referenced by asap.interactivemask.interactivemask._region_draw(), and asap.interactivemask.interactivemask._region_end().
Definition at line 63 of file interactivemask.py.
Referenced by asap.interactivemask.interactivemask._region_draw(), and asap.interactivemask.interactivemask._region_end().
Definition at line 66 of file interactivemask.py.
Referenced by asap.interactivemask.interactivemask._region_draw(), and asap.interactivemask.interactivemask._region_end().
Definition at line 64 of file interactivemask.py.
Referenced by asap.interactivemask.interactivemask._region_draw(), and asap.interactivemask.interactivemask._region_end().