casagui.toolbox._cube

This provides an implementation of CubeMask which allows interactive clean and makemask to share a common implementaton. The user calls member functions to create widgets which can be placed in the GUI created by the calling application. Once all of the widgets have been created. The connect member function creates all of the Bokeh/JavaScript callbacks that allow the widgets to interact

Module Contents

Classes

CubeMask

Class which provides a common implementation of Bokeh widget behavior for

class casagui.toolbox._cube.CubeMask(image, mask=None, abort=None)

Class which provides a common implementation of Bokeh widget behavior for interactive clean and make mask

path()

return path to CASA image

shape()

return shape of image cube

channel(pixel_type=np.float64)

return array for the current channel

jsmask_to_raw(jsmask)

The CubeMask raw format uses tuples for dictionary keys but tuples are not a type that can be created in javascript…

set_all_mask_pixels(value)

Set all pixels to the specified boolean value.

image(maxanno=50, **kw)

Create the 2D raster display which displays image planes. This widget is should be created for all cube_mask objects because this is the GUI component that ties all of the other GUIs together.

Parameters:
  • maxanno (int) – maximum number of masks that can be drawn in each image channel

  • kw (keyword and value) – extra keyword/value paramaters passed on to figure

slider(callback=None, **kw)

Return slider that is used to change the image plane that is displayed on the 2D raster display.

Parameters:

kw (keyword and value) – extra keyword/value paramaters passed on to Slider

spectrum(**kw)

Return the line graph of spectrum from the image cube which is updated in response to moving the cursor within the 2D raster display.

Parameters:

kw (keyword and value) – extra keyword/value paramaters passed on to figure

statistics(**kw)

retrieve a DataTable which is updated in response to changes in the image cube display

palette(**kw)

retrieve a Select widget which allow for changing the pseudocolor palette

channel_ctrl()

Return a text label for the current channel being displayed. It will be updated as the channel or stokes axis changes.

coord_ctrl()

Return a text label for the current channel being displayed. It will be updated as the channel or stokes axis changes.

connect()

Connect the callbacks which are used by the masking GUIs that have been created.

js_obj()

return the javascript object that can be used for control. This object should contain a done function which will cause the masking GUI to exit and return the masks that have been drawn Also provides JavaScript functions:

disable_masking( ) enable_masking( )

result()

Retrieve the masks that have been drawn by the user. The return value is a dictionary with two elements masks and polys.

The value of the masks element is a dictionary that is indexed by tuples of (stokes,chan) and the value of each element is a list whose elements describe the polygons drawn on the channel represented by (stokes,chan). Each polygon description in this list has a polygon index (p) and a x/y translation (d).

The value of the polys element is a dictionary that is indexed by polygon indexes. The value of each polygon index is a dictionary containing type (whose value is either 'rect' or 'poly) and geometry (whose value is a dictionary containing 'xs' and 'ys' (which are the x and y coordinates that define the polygon).

help(rows=[], **kw)

Retrieve the help Bokeh object. When this button is clicked, a tab/window containing the help information is opened or receives focus.