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)

Bases: hyperspy.signal_tools.SpanSelectorInSignal1D

apply()
bg_to_plot(axes_manager=None, fill_with=nan)
create_background_line()
create_remainder_line()
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.

on_disabling_span_selector()
rm_to_plot(axes_manager=None, fill_with=nan)
set_background_estimator()
span_selector_changed()
class hyperspy.signal_tools.ButterworthFilter(signal)

Bases: hyperspy.signal_tools.Smoothing

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

model2plot(axes_manager=None)
class hyperspy.signal_tools.DerivativeTextHandler

Bases: object

legend_artist(legend, orig_handle, fontsize, handlebox)
class hyperspy.signal_tools.DerivativeTextParameters(text, color)

Bases: object

class hyperspy.signal_tools.ImageContrastEditor(image)

Bases: traits.has_traits.HasTraits

apply()
close()
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.

on_disabling_span_selector()
plot_histogram()
reset()
span_selector_switch(on)
update_histogram()
update_span_selector_traits(*args, **kwargs)
class hyperspy.signal_tools.IntegrateArea(signal, signal_range=None)

Bases: hyperspy.signal_tools.SpanSelectorInSignal1D

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

positionfloat

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

onbool

Turns on and off the line

colorwx.Colour

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

draw()
switch_on_off(obj, trait_name, old, new)
update_position(*args, **kwargs)
class hyperspy.signal_tools.Load

Bases: traits.has_traits.HasTraits

hyperspy.signal_tools.SPIKES_REMOVAL_INSTRUCTIONS = 'To remove spikes from the data:\n\n 1. Click "Show derivative histogram" to determine at what magnitude the spikes are present.\n 2. Enter a suitable threshold (lower than the lowest magnitude outlier in the histogram) in the "Threshold" box, which will be the magnitude from which to search. \n 3. Click "Find next" to find the first spike.\n 4. If desired, the width and position of the boundaries used to replace the spike can be adjusted by clicking and dragging on the displayed plot.\n 5. View the spike (and the replacement data that will be added) and click "Remove spike" in order to alter the data as shown. The tool will automatically find the next spike to replace.\n 6. Repeat this process for each spike throughout the dataset, until the end of the dataset is reached.\n 7. Click "OK" when finished to close the spikes removal tool.\n\nNote: Various settings can be configured in the "Advanced settings" section. Hover the mouse over each parameter for a description of what it does.\n'
class hyperspy.signal_tools.Signal1DCalibration(signal)

Bases: hyperspy.signal_tools.SpanSelectorInSignal1D

apply()
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

close()
diff_model2plot(axes_manager=None)
property line_color_rgb
plot()
turn_diff_line_off()
turn_diff_line_on(diff_order)
update_lines()
class hyperspy.signal_tools.SmoothingLowess(*args, **kwargs)

Bases: hyperspy.signal_tools.Smoothing

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

model2plot(axes_manager=None)
class hyperspy.signal_tools.SmoothingSavitzkyGolay(signal)

Bases: hyperspy.signal_tools.Smoothing

apply()
diff_model2plot(axes_manager=None)
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.

model2plot(axes_manager=None)
class hyperspy.signal_tools.SmoothingTV(signal)

Bases: hyperspy.signal_tools.Smoothing

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

model2plot(axes_manager=None)
class hyperspy.signal_tools.SpanSelectorInSignal1D(signal)

Bases: traits.has_traits.HasTraits

on_disabling_span_selector()
reset_span_selector()
span_selector_switch(on)
update_span_selector_traits(*args, **kwargs)
class hyperspy.signal_tools.SpikesRemoval(signal, navigation_mask=None, signal_mask=None)

Bases: hyperspy.signal_tools.SpanSelectorInSignal1D

apply()
create_interpolation_line()
detect_spike()
find(back=False)
get_interpolated_spectrum(axes_manager=None)
get_interpolation_range()
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.

interpolator = None
on_disabling_span_selector()
span_selector_changed()
update_plot()
update_spectrum_line()