Showing posts with label Crystallite Size. Show all posts
Showing posts with label Crystallite Size. Show all posts

Sunday, July 8, 2018

Python code for Williamson-Hall plot

In this post I am adding a new calculator for crystallite size and strain calculation. This is based on  Williamson-Hall plot. However, this time calculator is written in python language and anyone can download this small code snippet as a local copy on your computer to calculate size and strain.

Before you use this calculator, you need to install the following  on your computer.

1. Python 2.7 or more
2. numpy
3. scipy
4. matplotlib

You can google it and install the above very easily.
  1. You download the file williamson-hall_plot.py file
  2.  Prepare a data file with peak position in column-1 and fwhm in column-2.
  3. Save this file as "data.txt" . You can use another name for this file provided you could able to change the same in the *.py file.
  4. You open a terminal (in linux and OSX) or cmd window in WINDOWS.
  5. Direct the terminal to the place where you want to work. Means move to that folder where your *.py  and "data.txt" file exists.
  6. run the command "python williamson-hall_plot.py" 
That generates a plot with size and strain printed in the terminal as well as it saves the png file.  The *py file and example data file are zipped and can be downloaded here. You can edit the data file with your own data.


Please read about Williamson-Hall plot before using this code.
In due course of time I will add more notes to this post. Till then
enjoy calculation.

In case of any difficulty please post a comment.

Sunday, July 7, 2013

XRD Crystallite Size calculator


Here is the online crystallite size calculator  
Using Scherrer equation one can calculate crystallite size from XRD data.


Crystallite size = 0.94 * x ray wavelength / beta * cos (theta)




Dp Calculator : Using Scherrer formula
Wavelength: Ang
Peak Width: degrees
Peak Position: degrees
Crystallite size: nm
Lattice Strain:
Note: Don't bother about  β in radians. All the entries are in degrees. The conversions are taken care in the computing code.

Caution: The crystallite size may appear large from the above method compared to the size determined from other methods. However, these numbers will be within the tolerance limits. More suitable for entry level research students.