GithubHelp home page GithubHelp logo

que-vector / eelstoolbox Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sophiatem/eelstoolbox

0.0 0.0 0.0 1.98 MB

Toolbox for the automated analysis of large EELS datasets

Python 100.00%

eelstoolbox's Introduction

EELStoolbox

WORK IN PROGRESS Toolbox for the automated analysis of large EELS datasets e.g. time series or spectrum images. The toolbox comprises several steps and lets you choose between different alignment methods, background models and deconvolution models. I hope it can help you with the automation of your data analysis. I have tested several datasets, but I greatly appreachiate feedback about problems with your specific dataset so that I can adjust the functions accordingly.

Step 1 - Import dataset:

If you recorded a spectrum image using Gatan Digital Micrograph Version GMS3.4 I recommend the dm3Reader provided by NCEM to convert the dataset to a python script. The functions expect your data as an array with the form [xaxis, (yaxis,) spectrum].

Step 2 - Alignment of the spectra:

Alignment of the dataset. In dependence of the nature of your dataset different methods are available. Method 1: If your spectra contain the zero-loss peak (ZLP) you can directly use the ZLP to align you data. The function requires the dispersion (eV/channel) and a threshold value for the intensity of the ZLP maximum.

[EELSaligned, energyscale, appliedShifts] = eels.ZLPalignment(EELSdata, Dispersion, IntensityZLP)

Method 2: If you recorded the spectra in Dual-EELS mode you can use the ZLP spectra to align your high-loss data.

[EELSaligned, energyscale, appliedShifts] = eels.ZLPalignment(EELSdata, Dispersion, IntensityZLP)

Method 3: If your data do not contain the ZLP, but all contain the same edge (whose shape doesn't change dramatically, e.g. C-K edge) you can use this edge to align your data using cross-correlation of your spectra. This requires a little more adjustements as described in the following.

Step 3 - Background correction:

Different models to subtract the background from the EELS dataset are available. The background is fitted within a small energy window defined close to the onset of the elemental edge (startBkg and endBkg). The powerlaw ('PL') model works best for most high-loss edges, while the polynomial models fit low-loss data best. The underlying mathematic equations are summarized in the following together with the respective literature reference. Especially for the functions 'Poly1' and 'Poly2' starting parameters (fitpara) and bounds (fitbounds) should be provided, otherwise the fitting most likely fails.

Keyword Equation Literature reference
'PL' A*x^(-r)
'Poly1' A*(x + m)^(-r) + b
'Poly2' A*(x + m)^(-r-(c*x))
'Linear' A*x + t
Bkg_fit(EELSdata, EnergyValues, startBkg, endBkg, BkgModel, fitpara, fitbounds)

Step 4 - Deconvolution of the signal:

Method 1: Deconvolution of the spectra

Method 2: Energy window between the peaks is fixed, well suited for spectra where the ZLP data are not available and slight shifting of the peaks during the acquisition must be compensated. Doesn't currently work for spectrum images, but I will add this functionality as soon as possible.

eelstoolbox's People

Contributors

sophiatem avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.