This notebook was used for the HyperSpy workshop at the Norwegian University of Science and Technology for the Scandem 2016 conference, 7 June 2016.

The data was acquired on a Jeol ARM200cF using a Gatan Quantum ER with DualEELS capabilities.

The data itself is from La0.7Sr0.3MnO3 thin films deposited on SrTiO3. In the Fine Structure example parts of the film has been exposed to a very long electron beam exposure, inducing oxygen vacancies.

The datasets has been binned to reduce the file size and processing time.

Firstly we use some IPython magic to import the right plotting libraries, then import HyperSpy

In [1]:

%matplotlib nbagg

In [2]:

importhyperspy.apiashs

WARNING:hyperspy_gui_traitsui:The nbAgg matplotlib backend is not supported by the installed traitsui version and the ETS toolkit has been set to null. To set the ETS toolkit independently from the matplotlib backend, set it before importing matplotlib.
WARNING:hyperspy_gui_traitsui:The traitsui GUI elements are not available.

First we take a look at an EELS line scan across an La0.7Sr0.3MnO3/SrTiO3 thin film. The core loss data has several peaks: Ti-L23, O-K, Mn-L23 and La-M54. We can navigate the line scan using the navigation window, and by moving the red line.

In [110]:

s=hs.load("datasets/LSMO_STO_linescan.hdf5")

In [111]:

s.plot()

Now we can quantifiy the first edge (Ti-L23, 460 eV, 0-10 nm). Firstly by removing the background, then integrating the Ti-L23 edge. The remove_background box can disappear (known bug) when using the qt4 toolkit. If it does run the s.remove_background() command again of use ipywidgets GUI instead.

In [112]:

s.remove_background()

To integrate the Ti-L32 edge interactively we can use a region of interest:

Now, lets do some more advanced quantification using HyperSpy's extensive modelling framework. Firstly we load the low loss and core loss spectra.

Firstly we'll have to tell HyperSpy where to find the Digital Micrograph Hartree-Slater cross section files, since they are not included in HyperSpy. Go to the "EELS" tab, then set "GOS directory" to the "H-S GOS Tables" folder. Note that unfortunately this requires a license of Gatan Digital Micrograph.

If you don't have Digital Micrograph you can still perform curve fitting of K and L edges using Ray Egerton's Hydrogenic cross-sections which are included in HyperSpy

In [29]:

hs.preferences.gui()

In [30]:

s_ll=hs.load("datasets/LSMO_STO_linescan_low_loss.hdf5")

In [31]:

s=hs.load("datasets/LSMO_STO_linescan.hdf5")

Here, the metadata has been populated with some of the experimental parameters:

Firstly, we make sure the energy scale is properly aligned by using the zero loss peak in the low loss spectrum. The subpixel argument interpolates the data, so we get sub-pixel alignment. Using the also_align argument, we can also apply the alignment on a another signal. For example when using dualEELS, where both the low loss and core loss is acquired quasi-simultaneously. Note the other signals must have the same navigation shape as the low loss signals.

Then we make a model out of the core loss spectrum. The low loss spectrum is convolved with the model, which means plural scattering is automatically taken into account. In addition this leads to better fits.

NOTE: creating this model requires using the GOS files from Gatan Digital Micrograph. If you don't have these files only K and L edges can be created using Hydrogenic cross sections. If you do have them but HyperSpy can't find them in the default location, you can specify the location using hs.preferences.gui().

In [35]:

m=s.create_model(ll=s_ll)

The model new consist of many different EELSCLEdge components, including a component for the plasmon background

We can fit the model to the experimental data by using the multifit function, with the smart fitting. Which is fits in a way optimized for EELS data, by fitting from the lowest to the highest energy losses.

This fitted mostly ok, but it is still not very good. Firstly we can move the Hartree-Slater onsets interactively

In [41]:

m.plot()m.enable_adjust_position()

Or manually, by directly changing the parameters within the Hartree-Slater edges. The parameter is called onset_energy

In [42]:

m.components.O_K.onset_energy.value=528

However, to change it for all the probe positions we have to use assign_current_value_to_all()

In [43]:

m.components.O_K.onset_energy.assign_current_value_to_all()

We repeat this for the Manganese edges. Since this is an L-edge, there are 3 different ones. However, we only have to set the Mn-L3: the L2 and L1 is a set to an energy relative to the L3.

In [44]:

m.components.Mn_L3.onset_energy.value

Out[44]:

640.0

In [45]:

m.components.Mn_L2.onset_energy.value

Out[45]:

651.0

In [46]:

m.components.Mn_L3.onset_energy.value=638.5

In [47]:

m.components.Mn_L2.onset_energy.value

Out[47]:

649.5

In [48]:

m.components.Mn_L3.onset_energy.assign_current_value_to_all()

This is due to the fine structure not currently taken into account by the model. To get a good fit, we can either not fit to the fine structure regions, or model them somehow.
The easiest way is defining certain regions as fine structure:

In [49]:

m.enable_fine_structure()

This will produce a much better fit, but will be much slower (~2 minutes).