Peak-fitting procedures on XPS data by Excel Hideki NAKAJIMA, rev.
20160727
1. Get the Excel XPS macro code on GitHub.
https://github.com/heitler/xps-excel-macro
You can also find the instruction and readme in it.
2. Install the Visual Basic for Applications (VBA) code developed by Hideki and Solver
add-ins in Excel.
a. Install Solver add-ins from Excel Options - Add-Ins - Go... - Solver Add-in.
b. Create a Personal Macro Workbook (personal.xlsb).
i. Show Developer tab in the Ribbon in Excel Options - Popular
ii. Record Macro from Developer tab by any name.
iii. Store macro in: "Personal Macro Workbook"
iv. Stop Recording from Developer tab
c. Copy and paste the VBA code (personal.xlsb) into your personal.xlsb
(VBAProject - Modules - Module1) from VBA editor (Alt+F11 or Developer tab
- Visual Basic).
d. Assign the shortcut keys (Ctrl + q) for the VBA code from Developer tab -
Macros - Personal.xlsb!CLAM2 - Options... - Shortcut key: Ctrl + "q".
e. Check Solver add-ins library in the VBAProject references from VBA editor -
Tools - Solver.
f. Copy and paste your own database (if you have any) into the folder specified
in the VBA code (default folder: D:\Data\hideki\XPS\). WebCross folder is also
in the same place (default folder: D:\Data\hideki\XPS\webCross\). If you have
no database files or folders, the user-defined database workbook will be
generated automatically in the first run of the VBA code as a filename
“UD.xlsx”, and then you can modify or add your elements with binding
energy and sensitivity factors for AlKa. The binding energy data is necessary,
for example, from the link below.
https://userweb.jlab.org/~gwyn/
No sensitivity factor is necessary if webcross folder includes data specified
below . Cross-section database files in webCross folder is also necessary to
normalize the photon energy dependent cross section if the XPS photon
energy is not AlKa.
https://vuo.elettra.eu/services/elements/data/
3. Import data in Excel.
a. Save tab-delimited texts or spreadsheet file with KE/BE scale in the first
column and spectral intensity in the second column. The first line of the first
column should be either “KE/eV” for kinetic energy or “BE/eV” for binding
energy in XPS. XAS used to be “PE/eV”. The first line of the second column
should be either “AlKa” for 1486.6 eV of photon energy or empty for dialog to
be asked for photon energy used.
Note that, if you want to directly load text data in your format, modify Sub
FormatData to specify the row and column positions.
b. Open the text data file or workbook with Excel (right-click on text file).
c. Run the VBA code by the shortcut key (Ctrl + q).
i. Note that run the VBA code to update the analysis, plot or fitting after
you revise any parameters in the following process.
ii. Each sheet has a number of useful commands to be analyzed in
details, but it can be learned afterwards.
d. Input the atomic elements to be analyzed and shown up in graphs.
4. Calibrate the binding energy (BE) of spectrum by changing photon energy (PE), work
function (WF), and charging factor (Char).
a. Compare the standard data (XPS standard BE database given by red marker)
or spectrum (C1s peak as adventitious carbon) to calibrate the binding energy.
b. Change numbers to shift the spectrum in B2:B4 cells as specified.
c. Spectra can be compared by typing "comp" with Ctrl + q (Select the Excel files
to be compared after the shortcut key).
d. Change Offset or Multiple factors in B9:C9 cells to scale the spectral intensity.
e. Show the standard chemical shifts by "chem" in C10 cell with Ctrl + q.
5. Fit peaks based on the element identified with binding energy calibrated in the
Graph sheet.
a. Set up the background shape by typing following in A1 and A2 cells.
i. A1 for "s" to Shirley's BG (default)
ii. A1 for "t" to Tougaard's BG
iii. A1 for "p" to Polynomial BG (including constant and linear)
iv. A1 for "p" and A2 for "s" to Polynomial Shirley BG
v. A1 for "p" and A2 for "t" to Polynomial Tougaard BG
vi. A1 for "v" to Victoreen BG used for XAS
vii. A1 for "a" to Tangent Arc BG used for XAS
viii. A1 for "e" to fit the Fermi edge.
b. Set up the fitting binding energy range in B11 and B12 cells.
c. Set up peak amplitude (E6,F6,...), FWHM (E4,...), BE (E2,...), and number of
peaks (B8). Note that the parameters can be fixed as constraints with bold
type face on each number.
d. Setup peak shape in E7, F7, ... cells as follows;
i. "0" or "Gauss" for a normal distribution
ii. "1" or "Lorentz" for a Cauchy distribution
iii. Any value between 0 and 1 or "Voigt" for pseudo-Voigt function (italic
type face on numbers for asymmetric function)
iv. More peak shapes available from Form cells like G, L, GL, TSGL.
e. Setup amplitude ratios and BE differences if desired.
Name C1 C2 C3
Amp. rat. (2; 1)
BE diff. [ 0.1; 0.2]
Table description above means that amplitude ratio between C1 and
C2 peaks is 2:1 and the binding energy differences among C1, C2, and
C3 are 0.1 and 0.2 eV, respectively.
f. The differences in three peak areas are summarized in the table below. The
corresponding three numerical Trapezoidal integration areas are also shown.
Usages Descriptions Factors to be effective
P/T.I. Single-element Peak area calculated without any Amplitude, FWHM
Area peak factors
S. Multiple-element Peak area calculated with atomic Amplitude, FWHM, PE,
Area peaks sensitivity factor based on photo- Sensitivity based on
ionization cross-section element specified in graph
sheet
N. Multiple-element Peak area calculated in "S. Area" Amplitude, FWHM, PE, KE,
Area peaks measured plus normalized with empirically Sensitivity, CAE, Grating,
under different calculated factors at BL CLAM2 MFP factor, a & b based on
BL or analyzer including XPS mean-free path of formalism from CasaXPS
conditions photoelectrons, transmission
function of electron energy
analyzer based on pass energy,
grating efficiency
6. Sample analysis after the fitting on each spectrum.
a. Compare the peak areas and shifts based on the fitting results by typing
"ana" in D1 cell with Ctrl + q at Fit sheet (Select Excel files to be compared).