Graphical representation of XPS Data

Germain Salvato Vallverdu germain.vallverdu@univ-pau.fr

This notebook shows how make a graphical representation of a series of XPS data experiments.

  • Data are read from a vms file
  • Data are plotted against Binding Energy (BE)

This notebook only deals with how to use the xpsplot. Look at read_XPS_data_long.ipynb for more details on the implementation.

This module relies on matplotlib, pandas and numpy modules.


In [1]:
%matplotlib inline

In [2]:
import xpsplot

First example : plot one file

1) Load the vms file

In [3]:
report1 = xpsplot.XPSData.from_file("report1.TXT")
print(report1)


filename : report1.TXT
path     : /home/user/work/kalpha/compounds/data.vms
title    : C1s Scan
source   : 1486.68 eV
columns  : KE ; Exp ; Comp_1 ; Comp_2 ; Comp_3 ; Comp_4 ; Comp_5 ; Comp_6 ; Comp_7 ; BG ; envelope

2) Manage column names

In [4]:
report1.set_all_column_names("", "", "carb", "", "", "tata", "toto", "titi", "tutu")
report1.list_columns()


KE
Exp
carb
Comp_2
Comp_3
tata
toto
titi
tutu
BG
envelope
3) plot the data.

Here we selected the following options :

  • we select spectif columns according to previously defined names
  • component are fille (fill=True)
  • the name of the file is not written (fname=False)

In [5]:
report1.get_plot(columns=["Exp", "carb", "titi", "tutu"], fill=True, fname=False)


Out[5]:
<matplotlib.axes._subplots.AxesSubplot at 0x7fcb6c06f668>

Example 2 : stack several XPS plots

1) load several vms files

In [6]:
stuff = xpsplot.StackedXPSData("report1.TXT", "report2.TXT", "report2.TXT")
print(stuff)


C1s Scan
------------------------------
filename : report1.TXT
path     : /home/user/work/kalpha/compounds/data.vms
title    : C1s Scan
source   : 1486.68 eV
columns  : KE ; Exp ; Comp_1 ; Comp_2 ; Comp_3 ; Comp_4 ; Comp_5 ; Comp_6 ; Comp_7 ; BG ; envelope

filename : report2.TXT
path     : /home/user/work/kalpha/compounds/data2.vms
title    : C1s Scan
source   : 1486.68 eV
columns  : KE ; Exp ; Comp_1 ; Comp_2 ; Comp_3 ; Comp_4 ; Comp_5 ; Comp_6 ; Comp_7 ; BG ; envelope

filename : report2.TXT
path     : /home/user/work/kalpha/compounds/data2.vms
title    : C1s Scan
source   : 1486.68 eV
columns  : KE ; Exp ; Comp_1 ; Comp_2 ; Comp_3 ; Comp_4 ; Comp_5 ; Comp_6 ; Comp_7 ; BG ; envelope

optionnaly set a title

In [7]:
stuff.title = "C1s of a nice surface"
2) define column names

In [8]:
stuff.set_all_column_names("", "", "carb", "", "", "tata", "toto", "titi", "tutu")
stuff.list_columns()


C1s Scan : report1.TXT
----------------------------------------
KE ; Exp ; carb ; Comp_2 ; Comp_3 ; tata ; toto ; titi ; tutu ; BG ; envelope

C1s Scan : report2.TXT
----------------------------------------
KE ; Exp ; carb ; Comp_2 ; Comp_3 ; tata ; toto ; titi ; tutu ; BG ; envelope

C1s Scan : report2.TXT
----------------------------------------
KE ; Exp ; carb ; Comp_2 ; Comp_3 ; tata ; toto ; titi ; tutu ; BG ; envelope

3) plot the data

In [9]:
fig = stuff.get_plot()


As previously you can select columns :


In [10]:
fig = stuff.get_plot(columns=["Exp", "carb", "titi", "tutu"])


You can also:

  • fill components
  • set horizontal lines at given positions

In [11]:
fig = stuff.get_plot(columns=["Exp", "carb", "titi", "tutu"], fill=True, pos=[284.5, 290.9, 286.5])