/XPSfitting

SolarSpec group script for fitting XPS data using a Shirley background

Primary LanguageMATLABBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

Contributors Forks Stargazers Issues MIT License LinkedIn


SolarSpec

XPSfitting

SolarSpec group script for fitting XPS data using a Shirley background
Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

About The Project

XPSfitting Screenshot Fitting XPS data using a Shirley background

(back to top)

Built With

(back to top)

Getting Started

To begin using this app is very simple. Just verify you have the necessary prequisites and follow the installation instructions.

Prerequisites

Make sure MATLAB is installed. It is available for download in the Software Distribution section under the Help tab after you log into Canvas. Click on the "Add-Ons" dropdown menu of your MATLAB Home screen. Then click on "Manage Add-Ons" and ensure you have the Image Processing Toolbox and the Signal Processing Toolbox. If not, click on the "Get Add-Ons" button instead and search for the aforementioned products.

Installation

  1. Clone the repo to your PC

    git clone https://github.com/SolarSpec/TaucPlotGUI.git
  2. Now enter the repository and install the application in MATLAB

    Click on the .mlappinstall file in your repository
    
  3. Browse the APPS header and click on the drop down.

    You will find the recently installed application under 'MY APPS' and can add it to your favourites
    

(back to top)

Usage

XPS is a technique using high energy light (X-rays) to eject electrons from a material. If one knows the energy of the X-ray, then on can determine how strongly the the released electron is bound to the core of the material. The fitted peaks tell the user about the center and relative energies of the material which can describe how many unique atoms are present in said material.

Begin by loading some XPS data in the form of an .ascii file. The user can either set the fit range by mouse or by keyboard (KBD) input using the respective "Set Fit Range" buttons, which will draw xlines on the specified x-coordinates. Next is to choose the type of background to set, either "Shirley BG" or "Linear BG" using the respective buttons which will actively iterate to find the Shirley Background or you can draw an ROI line between the ends of the peak regions for the Linear Background. The three edit fields below the Background axes allow the user to manually input the minimum and maximum values of the Linear background line and the tolerance value determines how much the slope change from the initial endpoints.

Next the user can click the "Select Initial Peaks" button to approximate the initial peaks of the loaded data by clicking the cursor on the "Initial Peak Positions" axes. When complete, the user can press enter to continue. Next determine the Full Width Half Max value (FWHM) by clicking on the "Generate Uniqueness Plot of FWHM" button, which uses a mix of Gaussian and Lorentz distributions (this app uses sum of each distribution instead of the product). The FWHM can also be constrained to a default value of +- 10% or any inputted percentage.

The Uniqueness plot generates the fit for all the FWHM values with the bounds and step inbetween. It outputs the Mean Squared Error (MSE) vs FWHM. The user can see where the fitting is best with the least amount of error and has the desired value outputted on the plot itself. Next, with this minimum error FWHM value, the user can enter this value back into the "FWHM +- X%" field and click the "Perform Fit" button for the best looking Fit Result plot.

After clicking "Perform Fit", the GUI gives the peak center and relative areas in percentage. Change the axes limits from the bottom left table, which only affects the Fit Result plot. The residuals are also plotted beneath the fit where the dashed line is effectively zero and the solid line is the difference between the original data and the calculated fit. You can shift it this object on the plot by editing the value beneath the Fit Results plot and clicking the "Shift" button. Export the fit results in the folder where the data was grabbed; the button returns a fit parameters file and an .emf figure of the Fit Result plot. The user can fit using previous settings if you open new but similar data by clicking the "Fit Using Previous Settings" button. This button saves the Fit Range bounds as well as the Inital Peak guesses and then reruns the same functions as before.

This app is currently lacking in any examples to be shown as it is still being created

For more information on any of the internal functions, please refer to the MATLAB Documentation

(back to top)

Roadmap

  • Plot XPS Intensity vs. Binding Energy (eV)
    • Use the cursor to approximate initial peak positions
  • Set the fit range by keyboard or mouse input
  • Set either a Shirley or Linear background
  • Generate a Uniqueness Plot to determine the best FWHM value
  • Perform a Fit Results
    • View residuals of data below results

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the BSD 3-Clause License. See LICENSE.txt for more information.

(back to top)

Contact

SolarSpec - SolarSpec Website - vidihari@student.ubc.ca

Project Link: https://github.com/SolarSpec/XPSfitting

(back to top)

Acknowledgments

(back to top)