hyperspy.signal_tools module

class hyperspy.signal_tools.BackgroundRemoval(signal, background_type='Power law', polynomial_order=2, fast=True, plot_remainder=True, zero_fill=False, show_progressbar=None, model=None)

Bases: hyperspy.signal_tools.SpanSelectorInSignal1D

gui(display=True, toolkit=None, **kwargs)

Display or return interactive GUI element if available.

Parameters
  • display (bool) – If True, display the user interface widgets. If False, return the widgets container in a dictionary, usually for customisation or testing.

  • toolkit (str, iterable of strings or None) – If None (default), all available widgets are displayed or returned. If string, only the widgets of the selected toolkit are displayed if available. If an interable of toolkit strings, the widgets of all listed toolkits are displayed or returned.

class hyperspy.signal_tools.ButterworthFilter(signal)

Bases: hyperspy.signal_tools.Smoothing

gui(display=True, toolkit=None, **kwargs)

Display or return interactive GUI element if available.

Parameters
  • display (bool) – If True, display the user interface widgets. If False, return the widgets container in a dictionary, usually for customisation or testing.

  • toolkit (str, iterable of strings or None) – If None (default), all available widgets are displayed or returned. If string, only the widgets of the selected toolkit are displayed if available. If an interable of toolkit strings, the widgets of all listed toolkits are displayed or returned.

class hyperspy.signal_tools.EdgesRange(signal, active=None)

Bases: hyperspy.signal_tools.SpanSelectorInSignal1D

gui(display=True, toolkit=None, **kwargs)

Display or return interactive GUI element if available.

Parameters
  • display (bool) – If True, display the user interface widgets. If False, return the widgets container in a dictionary, usually for customisation or testing.

  • toolkit (str, iterable of strings or None) – If None (default), all available widgets are displayed or returned. If string, only the widgets of the selected toolkit are displayed if available. If an interable of toolkit strings, the widgets of all listed toolkits are displayed or returned.

class hyperspy.signal_tools.ImageContrastEditor(image)

Bases: traits.has_traits.HasTraits

gui(display=True, toolkit=None, **kwargs)

Display or return interactive GUI element if available.

Parameters
  • display (bool) – If True, display the user interface widgets. If False, return the widgets container in a dictionary, usually for customisation or testing.

  • toolkit (str, iterable of strings or None) – If None (default), all available widgets are displayed or returned. If string, only the widgets of the selected toolkit are displayed if available. If an interable of toolkit strings, the widgets of all listed toolkits are displayed or returned.

plot_histogram(max_num_bins=250)

Plot a histogram of the data.

Parameters

max_num_bins (int, default 250) – When estimating the bins using one of the str methods, the number of bins is capped by this number to avoid a MemoryError being raised by numpy.histogram().

Returns

Return type

None

class hyperspy.signal_tools.IntegrateArea(signal, signal_range=None)

Bases: hyperspy.signal_tools.SpanSelectorInSignal1D

gui(display=True, toolkit=None, **kwargs)

Display or return interactive GUI element if available.

Parameters
  • display (bool) – If True, display the user interface widgets. If False, return the widgets container in a dictionary, usually for customisation or testing.

  • toolkit (str, iterable of strings or None) – If None (default), all available widgets are displayed or returned. If string, only the widgets of the selected toolkit are displayed if available. If an interable of toolkit strings, the widgets of all listed toolkits are displayed or returned.

class hyperspy.signal_tools.LineInSignal1D(signal)

Bases: traits.has_traits.HasTraits

Adds a vertical draggable line to a spectrum that reports its position to the position attribute of the class.

position

The position of the vertical line in the one dimensional signal. Moving the line changes the position but the reverse is not true.

Type

float

on

Turns on and off the line

Type

bool

color

The color of the line. It automatically redraws the line.

Type

wx.Colour

class hyperspy.signal_tools.Load

Bases: traits.has_traits.HasTraits

class hyperspy.signal_tools.PeaksFinder2D(signal, method, peaks=None, **kwargs)

Bases: traits.has_traits.HasTraits

gui(display=True, toolkit=None, **kwargs)

Display or return interactive GUI element if available.

Parameters
  • display (bool) – If True, display the user interface widgets. If False, return the widgets container in a dictionary, usually for customisation or testing.

  • toolkit (str, iterable of strings or None) – If None (default), all available widgets are displayed or returned. If string, only the widgets of the selected toolkit are displayed if available. If an interable of toolkit strings, the widgets of all listed toolkits are displayed or returned.

class hyperspy.signal_tools.Signal1DCalibration(signal)

Bases: hyperspy.signal_tools.SpanSelectorInSignal1D

gui(display=True, toolkit=None, **kwargs)

Display or return interactive GUI element if available.

Parameters
  • display (bool) – If True, display the user interface widgets. If False, return the widgets container in a dictionary, usually for customisation or testing.

  • toolkit (str, iterable of strings or None) – If None (default), all available widgets are displayed or returned. If string, only the widgets of the selected toolkit are displayed if available. If an interable of toolkit strings, the widgets of all listed toolkits are displayed or returned.

class hyperspy.signal_tools.Signal1DRangeSelector(signal)

Bases: hyperspy.signal_tools.SpanSelectorInSignal1D

class hyperspy.signal_tools.SimpleMessage(text='')

Bases: traits.has_traits.HasTraits

gui(display=True, toolkit=None, **kwargs)

Display or return interactive GUI element if available.

Parameters
  • display (bool) – If True, display the user interface widgets. If False, return the widgets container in a dictionary, usually for customisation or testing.

  • toolkit (str, iterable of strings or None) – If None (default), all available widgets are displayed or returned. If string, only the widgets of the selected toolkit are displayed if available. If an interable of toolkit strings, the widgets of all listed toolkits are displayed or returned.

class hyperspy.signal_tools.Smoothing(signal)

Bases: traits.has_traits.HasTraits

class hyperspy.signal_tools.SmoothingLowess(*args, **kwargs)

Bases: hyperspy.signal_tools.Smoothing

gui(display=True, toolkit=None, **kwargs)

Display or return interactive GUI element if available.

Parameters
  • display (bool) – If True, display the user interface widgets. If False, return the widgets container in a dictionary, usually for customisation or testing.

  • toolkit (str, iterable of strings or None) – If None (default), all available widgets are displayed or returned. If string, only the widgets of the selected toolkit are displayed if available. If an interable of toolkit strings, the widgets of all listed toolkits are displayed or returned.

class hyperspy.signal_tools.SmoothingSavitzkyGolay(signal)

Bases: hyperspy.signal_tools.Smoothing

gui(display=True, toolkit=None, **kwargs)

Display or return interactive GUI element if available.

Parameters
  • display (bool) – If True, display the user interface widgets. If False, return the widgets container in a dictionary, usually for customisation or testing.

  • toolkit (str, iterable of strings or None) – If None (default), all available widgets are displayed or returned. If string, only the widgets of the selected toolkit are displayed if available. If an interable of toolkit strings, the widgets of all listed toolkits are displayed or returned.

class hyperspy.signal_tools.SmoothingTV(signal)

Bases: hyperspy.signal_tools.Smoothing

gui(display=True, toolkit=None, **kwargs)

Display or return interactive GUI element if available.

Parameters
  • display (bool) – If True, display the user interface widgets. If False, return the widgets container in a dictionary, usually for customisation or testing.

  • toolkit (str, iterable of strings or None) – If None (default), all available widgets are displayed or returned. If string, only the widgets of the selected toolkit are displayed if available. If an interable of toolkit strings, the widgets of all listed toolkits are displayed or returned.

class hyperspy.signal_tools.SpanSelectorInSignal1D(signal)

Bases: traits.has_traits.HasTraits

class hyperspy.signal_tools.SpikesRemoval(signal, navigation_mask=None, signal_mask=None)

Bases: hyperspy.signal_tools.SpanSelectorInSignal1D

gui(display=True, toolkit=None, **kwargs)

Display or return interactive GUI element if available.

Parameters
  • display (bool) – If True, display the user interface widgets. If False, return the widgets container in a dictionary, usually for customisation or testing.

  • toolkit (str, iterable of strings or None) – If None (default), all available widgets are displayed or returned. If string, only the widgets of the selected toolkit are displayed if available. If an interable of toolkit strings, the widgets of all listed toolkits are displayed or returned.

hyperspy.signal_tools._get_background_estimator(background_type, polynomial_order=1)

Assign 1D component to specified background type.

Parameters
  • background_type (str) – The name of the component to model the background.

  • polynomial_order (int, optional) – The polynomial order used in the polynomial component

Raises

ValueError – When the background type is not a valid string.

Returns

  • background_estimator (Component1D) – The component mdeling the background.

  • bg_line_range (‘full’ or ‘from_left_range’) – The range to draw the component (used in the BackgroundRemoval tool)