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: 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: 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: 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: 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().

Return type:

None

class hyperspy.signal_tools.IntegrateArea(signal)

Bases: 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: 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.LineInSignal2D(signal)

Bases: HasTraits

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

Attributes:

x0, y0, x1, y1floats

Position of the line in scaled units.

lengthfloat

Length of the line in scaled units.

onbool

Turns on and off the line

colorwx.Colour

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

class hyperspy.signal_tools.Load

Bases: HasTraits

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

Bases: 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: 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: SpanSelectorInSignal1D

class hyperspy.signal_tools.Signal2DCalibration(signal)

Bases: LineInSignal2D

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.SimpleMessage(text='')

Bases: 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: HasTraits

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

Bases: 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: 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: 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: HasTraits

class hyperspy.signal_tools.SpikesRemovalInteractive(signal, max_num_bins=1000, **kwargs)

Bases: SpikesRemoval, 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)