Maintained by Marco A. Lopez-Sanchez - This website was last modified: 2019/04/25
GrainSizeTools is a free, open-source, cross-platform script written in Python that provides several tools for (1) estimating average grain size in polycrystalline materials, (2) characterizing the nature of the distribution of grain sizes (either from apparent distributions or approximating 3D grain size distributions via stereology), and (3) estimating differential stress via paleopizometers. The script requires as the input the areas of the grain profiles measured grain-by-grain on planar sections and does not require previous experience with Python programming language (see documentation below and FAQ). For users with coding skills, the script is organized in a modular (functional) way facilitating the reuse and code extension.
Latest release: v2.0.3
Date of the latest release: 2019/04/22
IMPORTANT! Versions 2.0+ are only compatible with Python 3.5 or higher.
- Extract data automatically from tabular-like files including txt, csv, or excel formats.
- Estimate different statistical descriptors to characterize grain size distributions. Average grain size measures include the arithmetic, geometric, RMS and area-weighted means, median, and frequency peak ("mode") using a Gaussian Kernel Density Estimator. Grain size can be represented in linear, logarithmic, and square root scales.
- Estimate normalized apparent grain size distributions to compare between different grain size populations.
- Estimate differential stress via paleopiezometers including multiple piezometric relations for quartz, olivine, calcite, and feldspar.
- Estimate robust confidence intervals using the student's t-Distribution
- Include several algorithms to estimate the optimal bin size of histograms and the optimal bandwidth of the Gaussian KDE based on population features.
- Approximate the actual 3D grain size distribution from data collected in plane sections (2D data) using the Saltykov method. This includes estimating the volume of a particular grain size fraction.
- Approximate the lognormal shape of the 3D grain size distribution via the two-step method and characterize the shape using a single parameter (the MSD - Multiplicative Standard Deviation) .
- Check lognormality using quantile-quantile plots (new in v2.0.3!)
- Ready-to-publish plots in bitmap or vector format (see screenshots below for examples).
You can download the script at the following sites:
https://github.com/marcoalopez/GrainSizeTools/releases
http://figshare.com/articles/GrainSizeTools_script/1383130
https://sourceforge.net/projects/grainsizetools/
- Requirements & Development
- Scope
- Getting started: A step-by-step tutorial
- Open and running the script
- A brief note on the organization of the script
- Loading and extracting the data
- Estimate equivalent circular diameters using the areas of the grain profiles
- Estimate different average grain size values and characterize the apparent grain size distribution
- Differential stress estimation using piezometric relations (paleopiezometry)
- Estimating a robust confidence interval
- Approximate the actual 3D grain size distribution and estimate the volume of a specific grain size fraction using the Saltykov method
- Approximate the lognormal shape of the actual grain size distribution using the two-step method
- Using quantile-quantile (q-q) plots to check lognormality
- Comparing different grain size populations using box plots
- Merging datasets
- Using the script with Jupyter Notebooks
- How to measure the areas of the grain profiles with ImageJ
- How to reconstruct the grains from SEM-EBSD data using the MTEX toolbox
- References
- FAQs
Estimate the distribution of apparent grain size using linear, logarithmic, or square root scales.
Estimate the area-weighted apparent grain size distribution
Estimate normalized apparent grain size distributions using the mean, the median, or the frequency peak as normalized factor. In the example above normalized to median =1
Estimate of the actual (3D) grain size distribution and volume of a particular grain size fraction using the Saltykov method
Estimate of the shape of the grain size distribution using the two-step method
Testing lognormality via quantile-quantile plots
Boxplots comparing different unimodal grain size distributions
In case you need references, the following are available:
Script reference
Lopez-Sanchez, Marco A. (2018). GrainSizeTools: a Python script for grain size analysis and paleopiezometry based on grain size. Journal of Open Source Software, 3(30), 863, https://doi.org/10.21105/joss.00863
Frequency peak apparent grain size based on the Gaussian kernel density estimator
Lopez-Sanchez MA and Llana-Fúnez S (2015) An evaluation of different measures of dynamically recrystallized grain size for paleopiezometry or paleowattmetry studies. Solid Earth 6, 475-495. http://doi.org/10.5194/se-6-475-2015
Two-step method
Lopez-Sanchez MA and Llana-Fúnez (2016) An extension of the Saltykov method to quantify 3D grain size distributions in mylonites. Journal of Structural Geology, 93, 149-161. http://doi.org/10.1016/j.jsg.2016.10.008
Saltykov method
The procedure implemented in the GrainSizeTools script is partially based on the general formulation provided in Sahagian and Proussevitch (1998) J. Volcanol. Geotherm. Res. 84, 173–196. http://doi.org/10.1016/S0377-0273(98)00043-2, but taken the midpoints of the classes instead of the left edges as described in the Appendix A in Lopez-Sanchez and Llana-Fúnez (2016) http://doi.org/10.5194/se-6-475-2015
GrainSizeTools script is licensed under the Apache License, Version 2.0 (the "License")
The documentation of GrainSizeTools script is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License (CC BY-NC-SA 4.0).
-
Did you find a bug in the code or an error in the documentation? Let me know by opening an issue here.
-
Do you want to contribute new ideas or miss a feature? Let me know by sending me an email (see here) or better open an issue with the label
enhancement
here and I'll see what I can do -
Do you want to develop your own code based on the GrainSizeTools script? You're in luck since the script is open source and free, simply clone the project and develop!
# Copyright © 2019 Marco A. Lopez-Sanchez
Information presented on this website and the documentation of the script is provided without any express or implied warranty and may include technical inaccuracies or typing errors; the author reserve the right to modify or enhance the content of this website as well as the documentation of the script at any time without previous notice. This webpage and the documentation is not liable for the content of external links.
Hosted on GitHub Pages — This website was created with Typora