Glue Logo
rtd
  • Installing and running glue
  • Getting started
  • Advanced User Interface Guide
  • Using the IPython terminal in Glue
  • Working with Data objects
  • Starting Glue from Python
  • Visualizing Astronomical Dendrograms
  • Introduction to customizing/extending glue
  • List of available plugins
  • Configuring Glue via a startup file
  • Customizing your Glue environment
  • Distributing your own plugin package
  • Customizing the coordinate system of a data object
  • Programmatically configuring viewers
  • Writing a simple custom data viewer
  • Watching data for changes
  • Custom fitting plugins
  • Writing a custom viewer for glue
  • Writing a custom viewer for glue with Qt
  • Writing a custom viewer for glue with Qt and Matplotlib
  • Custom tools for viewers and custom toolbars
  • Defining your own data objects
  • Demo Videos
  • Frequently Asked Questions
  • Getting Help with Glue
  • Known issues and solutions
  • The selection/subset framework
  • The communication framework
  • The linking framework
  • Developer Guide
  • API
    • Core Data
      • glue.core.component Module
      • glue.core.component_id Module
      • glue.core.component_link Module
        • Classes
      • glue.core.coordinates Module
      • glue.core.data Module
      • glue.core.data_collection Module
      • glue.core.hub Module
      • glue.core.subset Module
      • glue.core.subset_group Module
      • glue.core.roi Module
      • glue.core.link_helpers Module
      • glue.core.data_factories Package
      • glue.core.fitters Module
      • glue.core.state_objects Module
      • glue.core.exceptions Module
      • glue.core.session Module
    • User Interface
    • Utilities
    • Bundled third-party packages
Glue
  • Docs »
  • API »
  • BinaryComponentLink
  • Edit on GitHub

BinaryComponentLink¶

class glue.core.component_link.BinaryComponentLink(left, right, op)[source]¶

Bases: glue.core.component_link.ComponentLink

A ComponentLink that combines two inputs with a binary function

Parameters
  • left – The first input argument. ComponentID, ComponentLink, or number

  • right – The second input argument. ComponentID, ComponentLink, or number

  • op – A function with two inputs that works on numpy arrays

The CompoentLink represents the logic of applying op to the data associated with the inputs left and right.

Methods Summary

compute(self, data[, view])

For a given data set, compute the component comp_to given the data associated with each comp_from and the using function

replace_ids(self, old, new)

Replace all references to an old ComponentID with references to new

Methods Documentation

compute(self, data, view=None)[source]¶

For a given data set, compute the component comp_to given the data associated with each comp_from and the using function

This raises an glue.core.exceptions.IncompatibleAttribute if the data set doesn’t have all the ComponentIDs needed for the transformation

Parameters
data~glue.core.data.Data

The data set to use

viewNone or slice or tuple

Optional view (e.g. slice) through the data to use

Returns
result

The data associated with comp_to component

replace_ids(self, old, new)[source]¶

Replace all references to an old ComponentID with references to new

Parma old

ComponentID to replace

Parameters

new – ComponentID to replace with

Next Previous

© Copyright 2012-2019, Chris Beaumont, Thomas Robitaille, Michelle Borkin Revision cfc88f18.

Built with Sphinx using a theme provided by Read the Docs.