A Python script for estimating the grain size and grain size populations from thin sections

View the Project on GitHub

GrainSizeTools script is a free open-source cross-platform script written in Python that provides several tools to visualize and characterize the grain size from thin sections. The script is suitable to use for paleopiezometry (paleowattmetry) studies and to derive the actual 3D grain size distribution using the Saltykov and the two-step methods. The script only requires measuring the grain sectional areas from a thin section and does not require a previous experience with Python programming language (see documentation or FAQ). For users with coding skills, the script is organized in a modular way using Python functions, which facilitates to modify, reuse or extend the code if needed.


Figure 1. Screenshots (right)
enlarge image

Features at a glance


You can download the script at the following sites (Last release 2017/03/13: v1.3.2):


Look at the table of contents. You can also download a manual in pdf format here.

Citation guidelines

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

Script reference
Lopez-Sanchez, Marco A. (2016): GrainSizeTools script. figshare. doi:10.6084/m9.figshare.1383130

Frequency peak grain size based on Gaussian KDE
Lopez-Sanchez, M.A. 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, M.A. and Llana-Fúnez, S. (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-ShareAlike 4.0 International License.
Creative Commons License