API¶
Core Data¶
glue.core.component Module¶
Classes¶
|
Stores the actual, numerical information for a particular quantity |
|
A component which derives its data from a function. |
|
Container for categorical data. |
|
Components associated with pixel or world coordinates |
|
A component representing a date/time. |
glue.core.component_id Module¶
Classes¶
|
References a |
|
The ID of a component which is a pixel position in the data - this allows us to make assumptions in certain places. |
|
|
|
glue.core.component_link Module¶
Classes¶
|
ComponentLinks represent transformation logic between ComponentIDs |
|
A ComponentLink that combines two inputs with a binary function |
|
glue.core.coordinates Module¶
Functions¶
|
Convert a FITS header into a glue Coordinates object. |
|
Convert an Astropy WCS object into a glue Coordinates object. |
|
Convert a string to a FITS header. |
Classes¶
|
Base class for coordinate transformation |
|
|
|
Coordinates determined via an affine transformation represented by an augmented matrix of shape N+1 x N+1 matrix, where N is the number of pixel and world coordinates. |
glue.core.data Module¶
Classes¶
|
The basic data container in Glue. |
|
Base class for any glue data object which indicates which methods should be provided at a minimum. |
|
Base class for any glue data object which indicates which methods should be provided at a minimum. |
glue.core.data_collection Module¶
Classes¶
|
The top-level object for interacting with datasets in Glue. |
glue.core.hub Module¶
Classes¶
|
The hub manages communication between subscribers. |
The base class for any object that subscribes to hub messages. |
glue.core.subset Module¶
Functions¶
|
|
|
Given a 2D ROI and attributes on the x and y axis, determine the corresponding subset state. |
Classes¶
|
Base class to handle subsets of data. |
The base class for all subset states. |
|
|
A subset defined as the set of points in N dimensions that lie inside a region of interest (ROI). |
|
A subset defined as the set of points in two dimensions that lie inside a region of interest (ROI). |
|
A subset defined as the set of values for a categorical data attribute that fall inside a categorical region of interest (ROI). |
|
A subset defined as the set of values inside a range. |
|
A subset state defined by multiple discontinuous ranges |
|
The base class for combinations of subset states. |
|
An 'or' logical combination of subset states. |
|
An 'and' logical combination of subset states. |
|
An 'exclusive or' logical combination of subset states. |
|
An inverted subset state. |
|
A subset defined by a boolean mask. |
|
A subset defined by the set of categorical values that are equal to a set of categories. |
|
A subset defined by a set of indices to apply to the data. |
|
A subset defined by a mathematical comparison of a attribute values to a reference value or attribute values. |
|
A subset state defined by two attributes where one attribute is categorical and the other is numerical, and where for each category, there are multiple possible subset ranges. |
|
A subset defined as the set of values for two categorical data attributes that fall inside a categorical region of interest (ROI). |
|
A subset defined by a set of array slices. |
|
A state for many states to be combined together with an 'or' operation. |
glue.core.subset_group Module¶
A SubsetGroup
unites a group of
Subset
instances together with a consistent state,
label, and style.
While subsets are internally associated with particular datasets, it’s confusing for the user to juggle multiple similar or identical subsets, applied to different datasets. Because of this, the GUI manages SubsetGroups, and presents each group to the user as a single entity. The individual subsets are held in-sync by the SubsetGroup.
Client code should only create Subset Groups via
glue.core.data_collection.DataCollection.new_subset_group()
.
It should not call add_subset()
or
new_subset()
directly
Classes¶
|
A member of a SubsetGroup, whose internal representation is shared with other group members |
|
Create a new empty SubsetGroup |
glue.core.roi Module¶
Classes¶
|
A geometrical 2D region of interest. |
|
A 2D rectangular region of interest. |
|
A 2D circular region of interest. |
|
A class to define 2D polygonal regions of interest. |
|
Base class for objects which use Matplotlib user events to edit/display ROIs. |
|
Matplotlib ROI for rectangular selections |
|
Matplotlib ROI for circular selections |
|
Matplotlib ROI for polygon selections |
|
Matplotlib ROI for x range selections |
|
Matplotlib ROI for y range selections |
|
|
|
A region of interest representing all points within a range in either x or y. |
|
|
|
Class representing a set of vertices e.g. |
|
A ROI abstraction to represent selections of categorical data. |
|
A 2D elliptical region of interest with semimajor/minor axes radius_[xy]. |
glue.core.link_helpers Module¶
This module provides several classes and LinkCollection classes to assist in linking data.
The LinkCollection
class and its sub-classes are factories to create
multiple ComponentLinks easily. They are meant to be passed to
add_link()
Classes¶
|
A collection of links between two datasets. |
|
A bi-directional identity link between two components. |
|
Return two links that connect input ComponentIDs in both directions |
|
A link collection that is generated on-the-fly based on forward and backward transformation functions and lists of input/output component IDs. |
|
Compute all the links to specify that the input data are pixel-aligned. |
|
A link collection that is generated on-the-fly based on forward and backward transformation functions and lists of input/output component IDs. |
|
A collection of links between two datasets. |
|
glue.core.data_factories Package¶
Functions¶
|
|
|
Build a data set from a table. |
|
Attempt to automatically construct a data object |
|
This provides special support for 4D CASA FITS - like cubes, which have 2 spatial axes, a spectral axis, and a stokes axis in that order. |
|
|
|
|
|
Convert a file path into a data label, by stripping out slashes, file extensions, etc. |
|
|
|
Read in all extensions from a FITS file. |
|
A simple default filetype identifier function |
|
Read in all datasets from an HDF5 file |
|
Load common image files into a Glue data object |
|
|
|
Check if a FITS file is a CASA like cube, with (P, P, V, Stokes) layout |
|
|
|
|
|
The first bytes are x93NUMPY (for npy) or PKx03x04 (for npz) |
|
|
|
Use a factory to load a file and assign a label. |
|
Read in a Numpy structured array saved to a .npy or .npz file. |
|
A factory for reading tabular data using pandas. |
|
|
|
A factory for reading ASCII table data using |
Classes¶
|
Watch a path for modifications, and perform an action on change |
|
This class attaches some metadata to data created from load_data, so that the data can be re-constructed when loading saved state. |
glue.core.fitters Module¶
Glue’s fitting classes are designed to be easily subclassed for performing custom model fitting in Glue.
See the guide on writing custom fit plugins for help with using custom fitting utilities in Glue.
Classes¶
|
Base class for 1D fitters. |
|
A polynomial model. |
|
A base class for wrapping |
|
Gaussian fitter using astropy.modeling. |
|
Fallback Gaussian fitter, for astropy < 0.3. |
glue.core.state_objects Module¶
Classes¶
|
A class to represent the state of a UI element. |
|
Generic class to help with caching values on a per-attribute basis |
|
This class is a helper for attribute-dependent min/max level values. |
|
glue.core.exceptions Module¶
Classes¶
glue.core.session Module¶
Classes¶
|
User Interface¶
glue.viewers.common.viewer Module¶
Classes¶
|
The base class for all viewers. |
|
A viewer class that uses a state class to represent the overall viewer state, and uses layer artists and state classes to handle each dataset and subset in the data viewer. |
glue.viewers.common.qt.data_viewer Module¶
Classes¶
|
Base class for all Qt DataViewer widgets. |
glue.viewers.common.qt.base_widget Module¶
glue.viewers.matplotlib.state Module¶
Classes¶
A callback property where drawing is deferred until after notify has called all callback functions. |
|
|
A callback property where drawing is deferred until after notify has called all callback functions. |
|
A base class that includes common attributes for viewers based on Matplotlib. |
|
A base class that includes common attributes for all layers in viewers based on Matplotlib. |
glue.viewers.matplotlib.layer_artist Module¶
Classes¶
|
Create a new LayerArtist |
glue.viewers.matplotlib.qt.data_viewer Module¶
Classes¶
|
glue.core.layer_artist Module¶
LayerArtist classes handle the visualization of an individual subset or dataset.
Visualization clients in Glue typically compose visualizations by stacking visualizations of several datasets and subsets on top of each other. They do this by creating and managing a collection of LayerArtists, one for each Data or Subset to view.
LayerArtists contain the bulk of the logic for actually rendering things
Classes¶
|
Create a new LayerArtist |
A collection of LayerArtists |
glue.viewers.common.state Module¶
Classes¶
|
A base class for all viewer states. |
|
A base class for all layer states. |
glue.viewers.common.layer_artist Module¶
Classes¶
|
Create a new LayerArtist |
glue.viewers.common.tool Module¶
Classes¶
|
The base class for all toolbar tools. |
|
A tool that is checkable. |
|
A base class for all tools that show a drop-down menu. |
|
A base class for tools that have no action it themselves but show a dropdown of other tools. |
glue.viewers.matplotlib.mouse_mode Module¶
MouseModes define various mouse gestures.
MouseModes are generally activated and deactivated by toolbar buttons, although not necessarily so. The toolbar maintains a list of MouseModes from the visualization it is assigned to, and sees to it that only one MouseMode is active at a time.
Each MouseMode appears as an Icon in the toolbar. Classes can assign methods to the press_callback, move_callback, and release_callback methods of each Mouse Mode, to implement custom functionality
- The basic usage pattern is thus:
visualization object instantiates the MouseModes it wants
each of these is passed to the add_tool method of the toolbar
visualization object optionally attaches methods to the 3 _callback methods in a MouseMode, for additional behavior
Classes¶
|
The base class for all MouseModes. |
glue.viewers.matplotlib.toolbar_mode Module¶
ToolbarModes are CheckableTools that enable various MouseModes.
The toolbar maintains a list of MouseModes from the visualization it is assigned to, and sees to it that only one MouseMode is active at a time.
Each ToolbarMode appears as an Icon in the toolbar. Classes can assign methods to the press_callback, move_callback, and release_callback methods of each Mouse Mode, to implement custom functionality
- The basic usage pattern is thus:
visualization object instantiates the MouseModes it wants
each of these is passed to the add_tool method of the toolbar
visualization object optionally attaches methods to the 3 _callback methods in a MouseMode, for additional behavior
All the mouse modes and tools in this file are Matplotlib-specific.
Classes¶
|
All ToolbarModes are both MouseModes and CheckableTools |
|
Base class for defining ROIs. |
|
Define Roi Modes via click+drag events. |
|
Same functionality as RoiMode, but the Roi is never finalized, and remains rendered after mouse gestures |
|
Generate ROIs using clicks and click+drags. |
|
Defines a Rectangular ROI, accessible via the |
|
|
|
Defines a Circular ROI, accessible via the |
|
Defines a Polygonal ROI, accessible via the |
|
Defines a Range ROI, accessible via the |
|
Defines a Range ROI, accessible via the |
|
Defines a PointROI. |
glue.viewers.matplotlib.qt.toolbar_mode Module¶
Classes¶
|
Uses right mouse button drags to set bias and contrast, DS9-style. |
|
A tool to change the colormap used in a viewer. |
glue.viewers.common.qt.toolbar Module¶
glue.viewers.matplotlib.mpl_axes Module¶
Functions¶
|
glue.viewers.matplotlib.viewer Module¶
Classes¶
glue.viewers.matplotlib.qt.toolbar Module¶
Classes¶
|
|
|
|
|
|
|
|
|
|
|
glue.viewers.scatter.viewer Module¶
Classes¶
glue.viewers.scatter.state Module¶
Classes¶
|
A state class that includes all the attributes for a scatter viewer. |
|
A state class that includes all the attributes for layers in a scatter plot. |
glue.viewers.scatter.qt Package¶
Functions¶
|
Classes¶
|
glue.viewers.profile.viewer Module¶
Classes¶
glue.viewers.profile.state Module¶
Classes¶
|
A state class that includes all the attributes for a Profile viewer. |
|
A state class that includes all the attributes for layers in a Profile plot. |
glue.viewers.profile.qt Package¶
Functions¶
|
Classes¶
|
glue.viewers.image.viewer Module¶
Classes¶
glue.viewers.image.state Module¶
Classes¶
|
A state class that includes all the attributes for an image viewer. |
|
A state class that includes all the attributes for data layers in an image plot. |
|
A state class that includes all the attributes for subset layers in an image plot. |
|
glue.viewers.image.qt Package¶
Functions¶
|
Classes¶
|
glue.viewers.histogram.viewer Module¶
Classes¶
glue.viewers.histogram.state Module¶
Classes¶
|
A state class that includes all the attributes for a histogram viewer. |
|
A state class that includes all the attributes for layers in a histogram plot. |
glue.viewers.histogram.qt Package¶
Functions¶
|
Classes¶
|
glue.viewers.table.qt Package¶
Functions¶
|
Classes¶
|
Create a new LayerArtist |
|
|
glue.viewers.custom.qt.custom_viewer Module¶
This module provides utilities for creating custom data viewers. The goal of this module is to make it easy for users to make new data viewers by focusing on matplotlib visualization logic, and not UI or event processing logic.
The end user typically interacts with this code via glue.custom_viewer()
Classes¶
An array subclass wrapping a Component of a dataset It is an array with the following additional attributes: |
|
Empty object for users to store data inside. |
|
|
Descriptor to specify a UserDefinedFunction. |
|
Base class for custom data viewers. |
|
Metaclass to construct CustomViewer and subclasses |
|
A SubsetState subclass that uses a CustomViewer's "select" function |
|
Base class for custom data viewers. |
|
LayerArtist for simple custom viewers that use Matplotlib |
|
Base Qt widget class for simple custom viewers that use Matplotlib |
glue.core.application_base Module¶
Classes¶
|
glue.app.qt.application Module¶
Classes¶
|
The main GUI application for the Qt frontend |
glue Package¶
Functions¶
|
Create a custom interactive data viewer. |
|
Quickly send python variables to Glue for visualization. |
|
Utilities¶
glue.config Module¶
Classes¶
|
Container to hold groups of objects or settings. |
Stores key/value settings that code can use to customize Glue |
|
Stores functions which can export an application to an output file |
|
Stores colormaps for the Image Viewer. |
|
Stores data factories. |
|
Stores QT widgets to visualize data. |
|
Stores functions to convert between quantities |
|
Stores helper objects that compute many ComponentLinks at once |
|
Stores custom menu actions available when the user select one or more datasets, subset group, or subset in the data collection view. |
|
Base class for registries that are based on dictionaries instead of lists of objects. |
|
Stores preference panes |
|
Stores data exporters. |
|
Stores mask exporters. |
|
Stores mask importers. |
|
Stores Qt pre-defined tabs (non-MDI) |
|
Stores keyboard shortcuts. |
|
A registry that allows customization of layer artists based on the data and viewer type. |
|
A registry that allows in-place patch of the session file |
|
Registry for auto-linking functions that given a data collection can suggest links. |
|
Stores data translators, which are classes that define methods to translate between |
|
Stores subset state translators, which are classes that define methods to translate between |
|
Stores unit converters, which are classes that can be used to determine conversion between units and find equivalent units to other units. |
glue.core.simpleforms Module¶
The descriptors in this module are meant to be added to classes, to specify simple user-settable forms. These classes are used to automatically construct GUIs, without having to write GUI code in the form class itself.
Option
objects are defined at the class-level. To instances of
these classes, an Option
behaves like a normal instance attribute.
See Custom fitting plugins for example usage.
Classes¶
|
A boolean-valued option. |
|
A floating-point option. |
|
An integer-valued option. |
|
Base class for other options. |
glue.core.data_combo_helper Module¶
Classes¶
|
The purpose of this class is to set up a combo (represented by a SelectionCallbackProperty) showing componentIDs for one or more datasets, and to update these componentIDs if needed, for example if new components are added to a dataset, or if componentIDs are renamed. |
|
This is a helper for combo boxes that need to show a list of data objects that is manually curated. |
|
This is a helper for combo boxes that need to show a list of data objects that is always in sync with a |
|
Base class for any combo helper represented by a SelectionCallbackProperty. |
|
This is a base class for helpers for combo boxes that need to show a list of data objects. |
glue.core.message Module¶
Classes¶
|
Base class for messages that the hub handles. |
|
Used to send general purpose error messages |
|
A general message issued by a subset. |
|
A message that a subset issues when its state changes |
|
A message that a subset issues when its state changes. |
|
A message that a subset issues when it is deleted |
|
The base class for messages that data objects issue |
|
Create a new message |
|
Create a new message |
|
Create a new message |
|
Create a new message |
|
Create a new message |
|
Create a new message |
|
Create a new message |
|
A general message issued when Glue application is closed. |
|
Create a new message |
|
Create a new message |
|
Create a new message |
|
Create a new message |
|
Create a new message |
|
Create a new message |
glue.core.util Module¶
Functions¶
|
|
|
Split the input to data or subset.__getitem__ into its pieces. |
|
Pack a ComponentID and optional view into single tuple. |
|
Create a series of subsets that partition the values of a particular attribute into several bins |
|
Re-color a list of subsets according to a colormap. |
|
If necessary, add a suffix to label to avoid name conflicts |
|
Extract a downsampled view from a dataset, for quick statistical summaries |
|
Same as small_view, except using a numpy array as input |
|
Determines the data limits for the data in a set of artists. |
|
|
|
Changes the axes to have the proper tick formatting based on the type of component. |
Classes¶
|
Used to format the theta tick labels in radians |
|
|
|
glue.core.visual Module¶
Classes¶
|
This class is used to define visual attributes for any kind of objects. |
glue.utils.array Module¶
Functions¶
|
Return the unique elements of the array U, as well as the index array I such that U[I] == array |
|
On Windows, shape tuples use long ints which results in formatted shapes such as (2L, 3L). |
|
Return the shape of a view of an array. |
|
|
|
Coerce an array into a numeric array, replacing non-numeric elements with nans. |
|
Return True if the array is sorted, False otherwise. |
|
Given an array, return a new array that is the smallest subset of the original array that can be re-broadcasted back to the original array. |
|
Given a data shape and a chunk shape (or maximum chunk size), iteratively return slice objects that can be used to slice the array. |
|
Given two slices that can be applied to a 1D array and the length of that array, this returns a new slice which is the one that should be applied to the array instead of slice2 if slice1 has already been applied. |
|
Find the shortest float format that can be used to represent all values in an array such that all the string representations are different. |
|
Compute a statistic for the data. |
|
Lookup which index in items each data value is equal to |
|
|
|
Unbroadcast arrays then broadcast to smallest common shape. |
|
Return a list of views to extract random values from a dask array in an efficient way taking into account the chunk layout. |
Classes¶
|
A Numpy array subclass that includes properties to find the categories and unique integer codes for array values. |
glue.utils.geometry Module¶
Functions¶
|
Test if coordinates |
|
Find all the segments of intersection between a polygon and an infinite horizontal/vertical line. |
|
|
|
Return rotation matrix for angle alpha around origin. |
glue.utils.matplotlib Module¶
Functions¶
|
Build a set of all Matplotlib artists in a Figure |
|
Find the newly-added artists in a figure. |
|
Remove a collection of matplotlib artists from a scene. |
|
|
|
Return a set of views progressively zoomed out of input at roughly constant pixel count. |
|
Quickly estimate percentiles in an array, using a downsampled version. |
|
Decorator that globally defers all Agg canvas draws until function exit. |
|
|
|
Calculate the contour that passes through (x,y) in data |
|
Set up caching for an axes object. |
Convert numpy.datetime64 or an ndarray of those types to Gregorian date as UTC float. |
|
|
glue.utils.misc Module¶
Functions¶
|
Like functools.partial, this returns a function which, when called, calls |
|
Look up an object via its module string (e.g., 'glue.core.data.Data') |
Convert a string to a legal python variable name |
|
|
|
|
|
|
Given a list of strings, find the longest prefix common to all of them |
Get all the values in a |
|
|
Return a string with an error message formatted as: |
Classes¶
|
This class stubs out a method, and provides a callable interface that logs its calls. |
A mixin that provides a utility for attaching callback functions to methods |
|
An object that provides a set of properties that are meant to encapsulate state information |
|
|
glue.utils.qt Package¶
Functions¶
|
Convert a matplotlib colormap into a QPixmap |
|
Return the text labels of a combo box as a string to make it easier to check the content of a combo box in tests. |
|
|
|
Because of a bug in Qt, tab titles on MacOS X don't have the right font size |
|
|
|
Prompt the user to enter text using Qt |
|
Load a .ui file |
|
Convert a matplotlib color string into a Qt QColor object |
|
Prompt the user to pick from a list of classes using Qt |
|
Prompt the user to choose an item |
|
Context manager to automatically capture the active dialog and carry out certain actions. |
|
|
|
Convert a QColor object into a string that matplotlib understands |
|
Convert a local QUrl to a normal path |
|
Set the Qt cursor for the duration of a function call, and unset |
|
Context manager equivalent for |
|
Re-color a monochrome pixmap object using color |
|
Redefine the items in a QComboBox |
Updates the global font size through the current UI backend |
Classes¶
A dialog that is centered on the screen. |
|
|
|
|
|
|
A mixin for QtWidgets.QListWidget/GlueTreeWidget subclasses, that provides drag+drop functionality. |
|
|
An item delegate that can be used for e.g. |
|
|
A custom MimeData object that stores live python objects |
|
A Qt Model that wraps a python list, and exposes a list-like interface |
|
|
|
|
|
glue.utils.qt.widget_properties Module¶
The classes in this module provide a property-like interface to widget instance variables in a class. These properties translate essential pieces of widget state into more convenient python objects (for example, the check state of a button to a bool).
Example Use:
class Foo(object):
bar = ButtonProperty('_button')
def __init__(self):
self._button = QtWidgets.QCheckBox()
f = Foo()
f.bar = True # equivalent to f._button.setChecked(True)
assert f.bar == True
Classes¶
|
Base class for widget properties |
|
Wrapper around the data in QComboBox. |
|
Wrapper around the text in QComboBox. |
|
Wrapper around QTabWidget. |
|
Wrapper around the text() and setText() methods for QLabel etc |
|
Wrapper around the check state for QAbstractButton widgets |
|
Wrapper around the text state for QLineEdit widgets. |
|
Wrapper around widgets with value() and setValue() |
Plugins¶
glue.plugins.wcs_autolinking.wcs_autolinking Module¶
Functions¶
|
Classes¶
|
A collection of links that link the pixel components of two datasets via WCS transformations. |
|
|
|
|