Wednesday, July 19, 2017

SEM Spectrum Data Analysis and MATLAB code

The instructions that are provided below are specific to obtain and save EDS x-ray spectrum data to an '*.xls' excel file so that the spectrum can be plotted in MATLAB along with calculating the K-Alpha values of the particular element.

An elemental mapping can be obtained using the 'HYPERMAP' option in the edx application of the SEM. After the application has completed acquiring enough counts to quantify elements, the spectrum could be calculated using manually selecting a specific region using the option highlighted in the red box below. All the options mentioned below can be seen in the bottom right corner of the edx application.
Selecting the option in the red box, allows you to select the region of the captured image to obtain the spectrum from. In general, the whole image is selected to scan for the spectrum.

The option boxed below automatically calculates the 'Maximum Pixel Spectrum' that is the spectrum of the full image with the element of the highest peaked counts. Such an option is beneficial when we calculate the spectrum of a sample with a specific primary element.


Once the option is selected the progress bar, shown below, should indicate the calculation of the high pixel spectrum,


After the spectrum has been successfully calculated using either method, click on the 'spectrum' tab to view the spectrum. Then click on the periodic table icon which will display a periodic table of elements. The 'Auto' button on the bottom right corner of the periodic table will display the elements that are present in the spectrum. Manually selecting the spectrum will show you a series of elements that might or might not be present; Check the peaks of the elements by zooming into the spectrum and thereby determine the presence of the element in the sample. Using the 'Maximum Pixel Spectrum', the 'Auto' button will only show one element in the spectrum that is primarily present. Aditional elements can be selected according to peak heights. It is important to press 'Auto' before quantifying data.


The name of the spectrum could be changed for convenience, by double-clicking the name below the spectrum, as shown in the image below;



Prior to saving the spectrum data, the spectrum should be quantified using the 'quantify' button shown below;



Once the spectrum is quantified, the arrow button to the right side of the tabs, shown below, gives you the option to save the raw spectrum data.


Clicking the 'Save' button prompts a dialog to choose a location and filename to save the raw spectrum data. It also provides the option to save the spectrum in three different data formats, that is .xls, .txt and .spx as shown below. The format '.spx' is the data file accepted by the edx application 'Espirit 1.9'. The format '.xls' is the excel data file with the spectrum data that is accepted by the MATLAB code. It is recommended to save the data using both .spx and .xls formats.


Once the excel file has been created through the edx application 'espirit', simply open the '*.xls' excel data file to make sure the file is not corrupt. Almost every time, the data file is corrupt and you will be prompted to recover data as shown below. Click 'yes' and no data will be altered. 


Click 'Ok' to the message followed by clicking 'yes' to recover data in the previous message. The excel data file with the spectrum data can be seen after.


Even though no changes were made to the data file, SAVE the file with the "recovered" data so that MATLAB can read the spectrum data without any complications. The MATLAB code for the SEM spectrum and the excel X-ray Characteristic line data file can be found in the google drive link provided below (Log-in using your Siena email);

https://drive.google.com/drive/folders/0B2ACmmug9K_UY2h1ejJNZVdsU0k?usp=sharing

[Revised] XRF Spectrum Data Analysis and MATLAB code

The MATLAB code to plot the X-ray spectrum, to find the K-Alpha value of the element and to plot the Moseley's Stright line has been altered and upgraded to accept data files that are directly taken for the XRF HD prime. The procedure to take the spectrum data from the HD prime and convert it into an excel data file is explained in the previous 'XRF HD Prime Spectrum Data Analysis' blog post i.e found at;

https://saintcenter2017.blogspot.com/2017/06/xrf-hd-prime-spectrum-data-analysis.html

Once the excel file has been created through the HD data viewer, simply open the '*.csv' excel data file to make sure the file is not corrupt. Some times, the data file is corrupt and you will be prompted to recover data. Click 'yes' and no data will be altered. Even though no changes were made to the data file, SAVE the file you opened and 'recovered corrupt data'. 

Note; The X-ray Characteristic line data file that is named 'Xrayline.xlsx' , should not be renamed and should be placed in the same location as the MATLAB code file. The MATLAB code that is named 'XRFSpectrum.m' should not be renamed either. The XRF HD prime data could be placed in a different folder since you are prompted to select the data file within the script.

Simply run the MATLAB code and follow the instructions to input and select the information that is required. It is important to accurately insert the Atomic symbol of the element in the correct format when prompted in MATLAB. The First letter of the symbol is UpperCase and the rest lowercase. Example; Iron would be 'Fe', NOT 'FE' or 'fe'. Vanadium would be 'V' and NOT 'v'.

The MATLAB code for the XRF Spectrum and the excel X-ray Characteristic line data file can be found in the google drive link provided below (Log-in using your Siena email);

https://drive.google.com/drive/folders/0B2ACmmug9K_UY2h1ejJNZVdsU0k?usp=sharing


Monday, July 17, 2017

The effect on the magnetic field on the image of SEM

"Various reasons of the distortion is based on measurements of the periodic deformations of the images for different electron beam energies and working distances between the microscope final aperture and the specimen. Using the SEM images, a direct influence of alternating magnetic field on the electron beam was distinguished."

The direct electron beam deflection depends on the magnetic field magnitude and the working distance, i.e. distance between the final aperture of the electron gun and the specimen.

Paper that explains the measurement of a B-field in a SEM;

http://www.sciencedirect.com/science/article/pii/S0968432808000188

Expression states to calculate the magnetic field;


Where Bx and By are two orthogonal components of magnetic field vector B, e is electron charge, E is energy of electrons, Me is relativistic electron mass, Vx0 and Vy0 are orthogonal components of initial electron velocity (initial, i.e. at working distance=0) parallel to Lorentz force direction, dx0 and dy0 are orthogonal components of initial electron beam deflection.