This project is maintained by Marco A. Lopez-Sanchez - Last update (website): 2018/03/12

GrainSizeTools script is a free open-source cross-platform script written in Python that provides several tools to visualize and characterize the grain size in polycrystalline materials from thin sections. The script is suitable to estimate differential stress via paleopiezometry (with multiple piezometric relations for comparison!), and to derive the actual 3D grain size distribution using the Saltykov and the two-step methods. The script does not require a previous experience with Python programming language (see below and FAQ). For users with coding skills, the script is organized in a modular way using functions facilitating to modify, reuse or extend the code if needed.

Last release 2018/03/12, v1.4.3

Features at a glance


You can download the script at the following sites:

View the Project on GitHub


You can also download a manual in pdf format here


Estimate of different apparent grain size measures in the same population, in this example using a linear (number- and area-weighted), square root, and logarithmic scales.

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

Boxplots comparing different unimodal grain size distributions

Citation guidelines

If you need to cite the script or the methods the following references are available:

Script reference
Lopez-Sanchez, Marco A. (2017): GrainSizeTools script. figshare.

Frequency peak apparent grain size based on 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. doi: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. doi:10.1016/j.jsg.2016.10.008.

Saltykov method
The method as implemented in the GrainSizeTools script is described in the Appendix A in Lopez-Sanchez and Llana-Fúnez (2016) doi:10.5194/se-6-475-2015 The procedure is partially based on general formulation developed by Sahagian and Proussevitch (1998) J. Volcanol. Geotherm. Res. 84, 173–196. doi:10.1029/95JB02500


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).


Copyright © 2018 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