JupyterApplication

class glue_jupyter.JupyterApplication(data_collection=None, session=None)[source]

Bases: glue.core.application_base.Application

The main Glue application object for the Jupyter environment.

This is used as the primary way to interact with glue, including loading data, creating viewers, and adding links.

Parameters
data_collectionDataCollection

A pre-existing data collection. By default, a new data collection is created.

sessionSession

A pre-existing session object. By default, a new session object is created.

Methods Summary

add_link(self, data1, attribute1, data2, …)

Add a simple identity link between two attributes.

add_widget(self, widget[, label, tab])

histogram1d(self[, x, data, widget, color, …])

Open an interactive histogram viewer.

imshow(self[, x, y, data, widget, show])

Open an interactive image viewer.

link(self, links)

Parse and add links.

new_data_viewer(self, \*args, \*\*kwargs)

Create a new data viewer, add it to the UI, and populate with data

profile1d(self[, x, data, widget, show])

Open an interactive 1d profile viewer.

scatter2d(self[, x, y, data, widget, color, …])

Open an interactive 2d scatter plot viewer.

scatter3d(self[, x, y, z, data, show])

Open an interactive 3d scatter plot viewer.

set_subset_mode(self, mode)

Set the current subset mode.

subset(self, name, subset_state)

Create a new selection/subset.

subset_lasso2d(self, x_att, y_att, lasso_x, …)

Create a subset from a programmatic 2d lasso selection.

subset_roi(self, attributes, roi)

Create a subset from a region of interest.

volshow(self[, x, y, z, data, show])

Open an interactive volume viewer.

Methods Documentation

Add a simple identity link between two attributes.

Parameters
data1Data

The dataset containing the first attribute.

attribute1str or ComponentID

The first attribute to link.

data2Data

The dataset containing the first attribute.

attribute2str or ComponentID

The first attribute to link.

add_widget(self, widget, label=None, tab=None)[source]
histogram1d(self, x=None, data=None, widget='bqplot', color=None, x_min=None, x_max=None, n_bin=None, normalize=False, cumulative=False, viewer_state=None, layer_state=None, show=True)[source]

Open an interactive histogram viewer.

Parameters
xstr or ComponentID, optional

The attribute to show on the x axis.

dataData, optional

The initial dataset to show in the viewer. Additional datasets can be added later using the add_data method on the viewer object.

widget{‘bqplot’, ‘matplotlib’}

Whether to use bqplot or Matplotlib as the front-end.

colorstr or tuple, optional

The color to use for the data. Note that this will have the effect of setting the data color for all viewers.

x_minfloat, optional

The lower value of the range to compute the histogram in.

x_maxfloat, optional

The upper value of the range to compute the histogram in.

n_binint, optional

The number of bins in the histogram.

normalizebool, optional

Whether to normalize the histogram.

cumulativebool, optional

Whether to show a cumulative histogram.

viewer_stateViewerState

The initial state for the viewer (advanced).

layer_stateLayerState

The initial state for the data layer (advanced).

showbool, optional

Whether to show the view immediately (True) or whether to only show it later if the show() method is called explicitly (False).

imshow(self, x=None, y=None, data=None, widget='bqplot', show=True)[source]

Open an interactive image viewer.

Parameters
xstr or ComponentID, optional

The attribute to show on the x axis. This should be one of the pixel axis attributes.

ystr or ComponentID, optional

The attribute to show on the y axis. This should be one of the pixel axis attributes.

dataData, optional

The initial dataset to show in the viewer. Additional datasets can be added later using the add_data method on the viewer object.

widget{‘bqplot’, ‘matplotlib’}

Whether to use bqplot or Matplotlib as the front-end.

showbool, optional

Whether to show the view immediately (True) or whether to only show it later if the show() method is called explicitly (False).

Parse and add links.

new_data_viewer(self, *args, **kwargs)[source]

Create a new data viewer, add it to the UI, and populate with data

profile1d(self, x=None, data=None, widget='bqplot', show=True)[source]

Open an interactive 1d profile viewer.

Parameters
xstr or ComponentID, optional

The attribute to show on the x axis. This should be a pixel or world coordinate ComponentID.

dataData, optional

The initial dataset to show in the viewer. Additional datasets can be added later using the add_data method on the viewer object.

widget{‘bqplot’, ‘matplotlib’}

Whether to use bqplot or Matplotlib as the front-end.

showbool, optional

Whether to show the view immediately (True) or whether to only show it later if the show() method is called explicitly (False).

scatter2d(self, x=None, y=None, data=None, widget='bqplot', color=None, size=None, viewer_state=None, layer_state=None, show=True)[source]

Open an interactive 2d scatter plot viewer.

Parameters
xstr or ComponentID, optional

The attribute to show on the x axis.

ystr or ComponentID, optional

The attribute to show on the y axis.

dataData, optional

The initial dataset to show in the viewer. Additional datasets can be added later using the add_data method on the viewer object.

widget{‘bqplot’, ‘matplotlib’}

Whether to use bqplot or Matplotlib as the front-end.

colorstr or tuple, optional

The color to use for the markers. Note that this will have the effect of setting the data color for all viewers.

sizeint or float

The size to use for the markers. Note that this will have the effect of setting the marker size for all viewers.

viewer_stateViewerState

The initial state for the viewer (advanced).

layer_stateLayerState

The initial state for the data layer (advanced).

showbool, optional

Whether to show the view immediately (True) or whether to only show it later if the show() method is called explicitly (False).

scatter3d(self, x=None, y=None, z=None, data=None, show=True)[source]

Open an interactive 3d scatter plot viewer.

Parameters
xstr or ComponentID, optional

The attribute to show on the x axis.

ystr or ComponentID, optional

The attribute to show on the y axis.

zstr or ComponentID, optional

The attribute to show on the z axis.

dataData, optional

The initial dataset to show in the viewer. Additional datasets can be added later using the add_data method on the viewer object.

showbool, optional

Whether to show the view immediately (True) or whether to only show it later if the show() method is called explicitly (False).

set_subset_mode(self, mode)[source]

Set the current subset mode.

By default, selections in viewers update the current subset by replacing the previous selection with the new selection. However it is also possible to combine the current selection with previous selections using boolean operations.

Parameters
mode{‘new’, ‘replace’, ‘and’, ‘or’, ‘xor’, ‘not’}

The selection mode to use.

subset(self, name, subset_state)[source]

Create a new selection/subset.

Parameters
namestr

The name of the new subset.

subset_stateSubsetState

The definition of the subset. See the documentation at http://docs.glueviz.org/en/stable/python_guide/data_tutorial.html#defining-new-subsets for more information about creating subsets programmatically.

subset_lasso2d(self, x_att, y_att, lasso_x, lasso_y)[source]

Create a subset from a programmatic 2d lasso selection.

Parameters
x_attComponentID

The attribute corresponding to the x values being selected.

y_attComponentID

The attribute corresponding to the x values being selected.

lasso_xiterable

The x values of the lasso.

lasso_yiterable

The y values of the lasso.

subset_roi(self, attributes, roi)[source]

Create a subset from a region of interest.

Parameters
attributesiterable

The attributes on the x and y axis

roiRoi

The region of interest to use to create the subset.

volshow(self, x=None, y=None, z=None, data=None, show=True)[source]

Open an interactive volume viewer.

Parameters
xstr or ComponentID, optional

The attribute to show on the x axis. This should be one of the pixel axis attributes.

ystr or ComponentID, optional

The attribute to show on the y axis. This should be one of the pixel axis attributes.

zstr or ComponentID, optional

The attribute to show on the z axis. This should be one of the pixel axis attributes.

dataData, optional

The initial dataset to show in the viewer. Additional datasets can be added later using the add_data method on the viewer object.

showbool, optional

Whether to show the view immediately (True) or whether to only show it later if the show() method is called explicitly (False).