hyperspy.datasets.artificial_data module

Functions for generating artificial data.

For use in things like docstrings or to test HyperSpy functionalities.

hyperspy.datasets.artificial_data.get_atomic_resolution_tem_signal2d()

Get an artificial atomic resolution TEM Signal2D.

Returns

artificial_tem_image

Return type

HyperSpy Signal2D

Example

>>> s = hs.datasets.artificial_data.get_atomic_resolution_tem_signal2d()
>>> s.plot()
hyperspy.datasets.artificial_data.get_core_loss_eels_line_scan_signal()

Get an artificial core loss electron energy loss line scan spectrum.

Similar to a Mn-L32 and Fe-L32 edge from a perovskite oxide.

Returns

artificial_core_loss_line_scan_signal

Return type

HyperSpy EELSSpectrum

Example

>>> s = hs.datasets.artificial_data.get_core_loss_eels_line_scan_signal()
>>> s.plot()

See also

get_low_loss_eels_model()

get a low loss signal

get_core_loss_eels_model()

get a model instead of a signal

get_low_loss_eels_line_scan_signal()

get low loss signal with the same size

hyperspy.datasets.artificial_data.get_core_loss_eels_model(add_powerlaw=False)

Get an artificial core loss electron energy loss model.

Similar to a Mn-L32 edge from a perovskite oxide.

Parameters

add_powerlaw (bool) – If True, adds a powerlaw background to the spectrum. Default False.

Returns

artificial_core_loss_model

Return type

HyperSpy EELSModel

Example

>>> import hs.datasets.artifical_data as ad
>>> s = ad.get_core_loss_eels_model()
>>> s.plot()

With the powerlaw background

>>> s = ad.get_core_loss_eels_model(add_powerlaw=True)
>>> s.plot()

See also

get_low_loss_eels_model()

get a low loss signal

get_core_loss_eels_signal()

get a model instead of a signal

hyperspy.datasets.artificial_data.get_core_loss_eels_signal(add_powerlaw=False)

Get an artificial core loss electron energy loss spectrum.

Similar to a Mn-L32 edge from a perovskite oxide.

Some random noise is also added to the spectrum, to simulate experimental noise.

Parameters

add_powerlaw (bool) – If True, adds a powerlaw background to the spectrum. Default False.

Returns

artificial_core_loss_signal

Return type

HyperSpy EELSSpectrum

Example

>>> import hs.datasets.artifical_data as ad
>>> s = ad.get_core_loss_eels_signal()
>>> s.plot()

With the powerlaw background

>>> s = ad.get_core_loss_eels_signal(add_powerlaw=True)
>>> s.plot()

To make the noise the same for multiple spectra, which can be useful for testing fitting routines

>>> np.random.seed(seed=10)
>>> s1 = ad.get_core_loss_eels_signal()
>>> np.random.seed(seed=10)
>>> s2 = ad.get_core_loss_eels_signal()
>>> (s1.data == s2.data).all()
True

See also

get_low_loss_eels_model()

get a low loss signal

get_core_loss_eels_model()

get a model instead of a signal

get_low_loss_eels_line_scan_signal()

get EELS low loss line scan

get_core_loss_eels_line_scan_signal()

get EELS core loss line scan

hyperspy.datasets.artificial_data.get_low_loss_eels_line_scan_signal()

Get an artificial low loss electron energy loss line scan spectrum.

The zero loss peak is offset by 4.1 eV.

Returns

artificial_low_loss_line_scan_signal

Return type

HyperSpy EELSSpectrum

Example

>>> s = hs.datasets.artificial_data.get_low_loss_eels_signal()
>>> s.plot()

See also

get_core_loss_eels_signal()

get a core loss signal

get_core_loss_eels_model()

get a core loss model

get_core_loss_eels_line_scan_signal()

core loss signal with the same size

hyperspy.datasets.artificial_data.get_low_loss_eels_signal()

Get an artificial low loss electron energy loss spectrum.

The zero loss peak is offset by 4.1 eV.

Returns

artificial_low_loss_signal

Return type

HyperSpy EELSSpectrum

Example

>>> s = hs.datasets.artificial_data.get_low_loss_eels_signal()
>>> s.plot()

See also

get_core_loss_eels_signal()

get a core loss signal

get_core_loss_eels_model()

get a core loss model

get_low_loss_eels_line_scan_signal()

get EELS low loss line scan

get_core_loss_eels_line_scan_signal()

get EELS core loss line scan