Table of Contents

FitAllB

FitAllB is tailored to do centre-of-mass (COM) refinements of grain orientations, positions and strain tensors from far-field images of a polycrystalline material. The name FitAllB originates because the routine fits all Bi (1), the grain specific reciprocal space metrics, which contain information about the strain states of the individual grains.

It was written by Jette Oddershede, formerly at DTU in Denmark and now working for Xnovo Technology ApS. The source code, along with a complete manual is available online at https://github.com/FABLE-3DXRD/FitAllB.

Jette Oddershede, Søren Schmidt, Henning Friis Poulsen, Henning Osholm Sørensen, Jonathan Wright and Walter Reimers, Determining grain resolved stresses in polycrystalline materials using three-dimensional X-ray diffraction, J. Appl. Cryst. 43, 539-549 (2010) doi: 10.1107/S0021889810012963

Capabilities

Taken from the manual:

The aim is to be able to handle several hundred illuminated grains and obtain the strain tensors to an accuracy of 10−4. The strain tensors are output both in the Cartesian grain coordinate system relative to the grain orientation and in the sample system for overall comparisons, and if the components of the stiffness tensor C are provided, the stress tensors in the same two representations will also be output.

FitAllB includes an error estimation routine to give standard deviations of all refined parameters. In addition the relative volumes of the grains (from the peak intensities with the possibility to take absorption effects into account) are refined, so in principle a 3D orientation and stress/strain map of the polycrystal can be obtained using tessellation.

Lately an algorithm to extract the peak widths(median 2θ and η) for each grain has been added as an indicator of intragranular orientation and/or strain gradients.

Application to DAC experiments

In DAC experiments, FitAllB is a second stage refinement. You use FitAllB after finding and indexeding your grains with another piece of software.

Usage

Prerequisites

fitallb.py is the script that allows you to refine grain positions and orientations and to compute the strain tensor in the sample. To make it work, you need :

It furthermore requires PolyXSim and Iminuit. Both can be downloaded with Anaconda or is found on GitHub.

The input file should have this look :

title 'title'
log_file grains.log
flt_file peaks_t50.flt
par_file Olivine.prm
structure_file Forsterite.cif
#res_file .cif
sgno 62
#
w_step 0.5
w_limit -28 28
bg 0
dety_size 2048
detz_size 2048
#beampol_factor 0
#beampol_factor 0
#
crystal_system orthorombic
stress 0
#abs_mu 0
abs_xlim 0.1
abs_ylim 0.1
#
xyz 1 # Fit cms positions on farfield
rod 1 # Fit orientations and thus Rodrigues vectors on farfield
eps 1 # Fit strain tensors on farfield
do 0# Fit cell parameters
#
fixx 0
fixy 0
fixz 0
#rej_ia 1
rej_vol 42
rej_resmean 10
rej_resmedian 5
min_refl 7
#
tol_grain 1e-2

Modifying the parameters

Now, about the parameters of the refinement, these are the four lines starting with rej_ and min_refl (maybe also the tol_grain line but it didn't do much in my tests..).

rej_ia is for internal angle, meaning the difference between the position of the measured peak and the position of the corresponding theoretical peak. In my data, I had a hard time decreasing it below 2° but I read that C. Langrand happened to have a maximum of 0.2° in internal angle misorientation.

rej_vol is linked to the intensity relativly to the volume of the grain (?). This means that the peaks have a too weak intensity. By default, it is set to 10 but I needed to increase it for my data. I succeeded in increasing up to 41 before FitAllB crashed (and it still rejected a lot of peaks because of intensity).

rej_resmean and rej_resmedian define, how strong a single peak is allowed to be compared to the mean/median intensity of a certain grain. If you use the value 10 it means that any peak, which is more than 10 times higher intensity compared to the mean/median peak intensity of that grain, is rejected.

min_refl is the minimum number of peaks you need to validate a grain. As it is a refinement step, during each run the grains will loose the “bad” peaks. If they go below the min_refl threshold, they are rejected. Check your log-file before the refinement to see, how many peaks are usually there to make a grain.

Running the refinement

Edit this input file to your purposes (modify file names, experimental conditions, crystallographic info, …) and then type this to your command line:

fitallb.py -i inputfilename.inp

As a result, FitAllB will run several fits in the terminal and if it succeeds to refine your grains, it will finish with normal termination of fitallb.

Evaluating the results

Your current working directory should now contain a new folder named after your input file. In this new folder you can find several output files, which FitAllB created during the run. As I understand it now, the most usefull output files are the _final.gff and the _rej files.

The _final.gff file contains the final results of the refinement, with the new positions, orientations, stress tensor, and so on of the grains. This is the one you need to keep going with the data processing. The _rej files list all the peaks rejected during the refinement and tell you why they were rejected. Most of the time it is a problem of intensity or internal angle (marked with ia).

Reported crashs

loop_
_atom_type_symbol
_atom_type_description 
'Mg' 'Mg' 
'Fe' 'Fe' 
'O' 'O'

Fitgloball

fitgloball.py is a script linked to FitAllB that does the same kind of things: refining grains. I used it only for refining cell parameters.

It is working the same way as FitAllB, with the same input file, just change d0 to 1 instead of 0 to ask the script to refine the cell parameters.

A good advice to use it to refine cell parameters is to index grains with only the lowest tth (where it's easy for GrainSpotter to index peaks) and then use Fitgloball on these “perfect” grains. You can then go back to ImageD11 to modify the parameters and calculate new (and hopefully better) G-vectors, then continue with GrainSpotter, FitAllB,…