GrainSizeTools Icon



A Python script to estimate the grain size from thin sections

Add a Review
3 Downloads (This Week)
Last Update:
Browse All Files
Windows Mac Linux



GrainSizeTools is a free cross-platform script written in Python that provides a robust method to obtain a single measure of dynamically recrystallized grain size in deformed rocks. There is no need of prior knowledge of Python language to use the script and get the results. The script only requires the previous measurement of the grain sectional areas from a thin section. The aim of the script is to use this value in paleopiezometry and paleowattometry studies. A full paper describing the method applied by the script can be found here: It is planned to extend the capabilities of the script in the future.

see a brief tutorial here:
about the author:

GrainSizeTools Web Site


  • The script is free, open-source and cross-platform
  • It allows to load text files -txt or csv- with the sectional areas of the grains
  • It allows to calculate the apparent diameters of the grains from the sectional areas via the equivalent circular diameter
  • It allows to correct the diameters calculated by adding the perimeter of the grains
  • It returns the mean, the median and the area-weighted grain size of the apparent population of grain sizes.
  • It returns the frequency peak via the Gaussian kernel density estimator
  • It produces ready-to-publish number- and area-weighted grain size plots, allowing to save the graphical output as a bitmap or vector images
  • It returns the modal intervals and their central values in the number- and area-weighted approaches
  • The script implements several algorithms to estimate the optimal bin size of the histogram and the bandwidth of the Gaussian KDE
  • The script is organized in a modular way using Python functions, which facilitates to modify, reuse or extend the code


Write a Review

User Reviews

Be the first to post a review of GrainSizeTools!

Additional Project Details

Intended Audience


Programming Language



Screenshots can attract more users to your project.
Features can attract more users to your project.

Icons must be PNG, GIF, or JPEG and less than 1 MiB in size. They will be displayed as 48x48 images.