Kinematic Diffraction Forward Model
Description
The package includes a Mathematica notebook that can be used to simulate 2-D diffractograms. The notebook is very well-detailed and explains every single chunk of code. You first define a material and the phases present. The phases can be modelled with different grain size distributions. Textures can also be included in the material modelling section. One can even take in real micrographs and simulate a diffractogram based on the micrograph. The number of grains, and the number of diffractograms can be specified. Each diffractogram is accompanied with a JSON file that contains all the metadata. All the parameters that were used to generate that diffractogram are present in the accompanying JSON file. Then, the model takes in the wavelength and the energy spread of the instrument that was used for obtaining diffractograms. A random grain in a random orientation is selected and the Bragg’s condition is tested for the given wavelength. If it satisfies the Bragg’s condition, a reflection from this grain is taken. Once the number of iterations end, it takes all the reflections and convolutes it on a 2049*2049 pixels image.