User Tools

Site Tools


evaluation:extractgrainsizes

This is an old revision of the document!


Determine Grain Sizes

The TIMEleSS tools contain two scripts to determine the volume of each grain in the sample. These are timelessExtractGrainSizes.py to obtain relative grain volume and timelessRelToAbsGrainSize.py to convert these relative grain sizes into absolute values. The scripts provide both a list of the grain volumes and a simple histogram of the grain size distribution.

The

Estimation of relative grain volumes based on diffraction intensities

Example:
    timelessGrainSizes.py -w 0.3738 mylogfile.log peaks-t100.flt crystal.cif

This is part of the TIMEleSS project
http://timeless.texture.rocks

positional arguments:
  logfile               Path and name for GrainSpotter output file
  fltfile               Path and name for fltfile
  ciffile               Path and name for CIF file

optional arguments:
  -h, --help            show this help message and exit
  -w WAVELENGTH, --wavelength WAVELENGTH
                        Wavelength (angstrom, required)
  -m TTHETA_MIN, --ttheta_min TTHETA_MIN
                        If set, minimum 2 theta for calculation of peaks from cif file (degrees). Guessed from GS output file otherwise.
  -M TTHETA_MAX, --ttheta_max TTHETA_MAX
                        If set, maxium 2 theta for calculation of peaks from cif file (degrees). Guessed from GS output file otherwise.
  -o OUTPUT, --output OUTPUT
                        If set, saves result to this file. Default is None (no filter)
  -HV HISTOGRAM_VOL, --histogram_vol HISTOGRAM_VOL
                        If set, plots a histogram of the grain volumes on the screen. Default is False
  -HR HISTOGRAM_RAD, --histogram_rad HISTOGRAM_RAD
                        If set, plots a histogram of the grain radii on the screen. Default is False
  -b HISTOGRAM_BINS, --histogram_bins HISTOGRAM_BINS
                        Sets the number of histrogram bins. Only works if histogram is set True. Default is 60
  -r REJECT, --reject REJECT
                        Reject grains with AverageI > reject*MedianI. Default is 20.0

Usage

To use this method, the process of indexing has to be finished, i.e. a GrainSpotter output file is required.

Try this:

timelessGrainSizes.py -o myoutputfile.txt -w 0.3738 -HV True mylogfile.log peaks-t100.flt crystal.cif

This command should do the following:

  1. Display a number of rejected grains in the command window
  2. Display the relative grain volumes in the command window
  3. Save the list of grain volumes into the file myoutputfile.txt and
  4. Plot a simple histogram of the grain volumes (see below)

Histogram example

Rejected grains

Since the script is based on the analysis of the peak intensities, it also detects outliers in a grain, e.g. if one of the peaks is significantly more intense than the others. If this mismatch is above a certain threshold, the grain is rejected by the script. You can adjust the threshold by adding the parameter -r when executing the script (see help message above).

evaluation/extractgrainsizes.1618922163.txt.gz · Last modified: 2021/04/20 12:36 by matthias