hyperspy._signals.eds_sem module

class hyperspy._signals.eds_sem.EDSSEMParametersUI(signal)

Bases: hyperspy.signal.BaseSetMetadataItems

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.

mapping = {'Acquisition_instrument.SEM.Detector.EDS.azimuth_angle': 'azimuth_angle', 'Acquisition_instrument.SEM.Detector.EDS.elevation_angle': 'elevation_angle', 'Acquisition_instrument.SEM.Detector.EDS.energy_resolution_MnKa': 'energy_resolution_MnKa', 'Acquisition_instrument.SEM.Detector.EDS.live_time': 'live_time', 'Acquisition_instrument.SEM.beam_energy': 'beam_energy', 'Acquisition_instrument.TEM.Stage.tilt_alpha': 'tilt_stage'}
class hyperspy._signals.eds_sem.EDSSEMSpectrum(*args, **kwards)

Bases: hyperspy._signals.eds_sem.EDSSEM_mixin, hyperspy._signals.eds.EDSSpectrum

class hyperspy._signals.eds_sem.EDSSEM_mixin(*args, **kwards)

Bases: object

create_model(auto_background=True, auto_add_lines=True, *args, **kwargs)

Create a model for the current SEM EDS data.

Parameters
  • auto_background (boolean, default True) – If True, adds automatically a polynomial order 6 to the model, using the edsmodel.add_polynomial_background method.

  • auto_add_lines (boolean, default True) – If True, automatically add Gaussians for all X-rays generated in the energy range by an element using the edsmodel.add_family_lines method.

  • dictionary ({None, dict}, optional) – A dictionary to be used to recreate a model. Usually generated using hyperspy.model.as_dictionary()

Returns

model

Return type

EDSSEMModel instance.

get_calibration_from(ref, nb_pix=1)

Copy the calibration and all metadata of a reference.

Primary use: To add a calibration to ripple file from INCA software

Parameters
  • ref (signal) – The reference contains the calibration in its metadata

  • nb_pix (int) – The live time (real time corrected from the “dead time”) is divided by the number of pixel (spectrums), giving an average live time.

Examples

>>> ref = hs.datasets.example_signals.EDS_SEM_Spectrum()
>>> s = hs.signals.EDSSEMSpectrum(
>>>     hs.datasets.example_signals.EDS_SEM_Spectrum().data)
>>> print(s.axes_manager[0].scale)
>>> s.get_calibration_from(ref)
>>> print(s.axes_manager[0].scale)
1.0
0.01
set_microscope_parameters(beam_energy=None, live_time=None, tilt_stage=None, azimuth_angle=None, elevation_angle=None, energy_resolution_MnKa=None, display=True, toolkit=None)

Set the microscope parameters.

If no arguments are given, raises an interactive mode to fill the values.

Parameters
  • beam_energy (float) – The energy of the electron beam in keV

  • live_time (float) – In second

  • tilt_stage (float) – In degree

  • azimuth_angle (float) – In degree

  • elevation_angle (float) – In degree

  • energy_resolution_MnKa (float) – In eV

  • 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.

Examples

>>> s = hs.datasets.example_signals.EDS_SEM_Spectrum()
>>> print('Default value %s eV' %
>>>       s.metadata.Acquisition_instrument.
>>>       SEM.Detector.EDS.energy_resolution_MnKa)
>>> s.set_microscope_parameters(energy_resolution_MnKa=135.)
>>> print('Now set to %s eV' %
>>>       s.metadata.Acquisition_instrument.
>>>       SEM.Detector.EDS.energy_resolution_MnKa)
Default value 130.0 eV
Now set to 135.0 eV
class hyperspy._signals.eds_sem.LazyEDSSEMSpectrum(*args, **kwards)

Bases: hyperspy._signals.eds_sem.EDSSEMSpectrum, hyperspy._signals.eds.LazyEDSSpectrum