Synthetic data sets are useful to learn how to process data. You can input the experimental parameters you will use in your actual experiment and your actual sample. The software to do so is PolyXSim.
For high pressure experiments, the purpose of this step is to simulate the outcome of a DAC experiment (grains with random orientations, random strains etc.). You can check the possible outcome of an actual experiment. You can also check if your workflow for data processing is actually working as the input parameters are known.
The simulation will provide 2D diffraction images but also G-vectors, inverse UB matrices (UBi) for all grains, and some more files. You will get at least 7 different files from the simulation as well as the diffraction images. The amount of diffraction images depends on the ω range and the step size defined in the input file. For example, a ω range Δω = [-28°;+28°] with a step size δω = 0.5° produces 112 images (with numbers from 0 to 111).
PolyXSim -i input_file (.inp or .ini)
Input file can include a collection of parameters. Information on the input parameters can be found here https://sourceforge.net/p/fable/wiki/PolyXSim%20-%20input/
Here are input files for simulating an experiment at the P02.2 beamline in PETRA
Grain information
The full input file is here simu-ppv-basic.inp
This second input file is the same experiment as previous but
This second dataset is more difficult to process. You will really need to work on your background to get it to work.
The full input file is here simu-ppv-bg.inp.
Computations are much longer. Expect 1 minute per image. 2 hours for 112 images.
This third example is a test of calculation from a CIF file for the crystal structure. In order to run this simulation, you need to install the PyCifRW python package otherwise it will not work.
Our problem was that the widely used space group for olivine, Pbnm, do not have a space groupe number and we need a space group number for the index.ini input file for GrainSpotter. So we use a CIF file to translate the crystallographic properties of olivine from Pbnm to Pnma an other space group used for olivine which does have a space group number.
The transformation from Pbnm toPnma is not complicated, it is only an interchange of axis :
But we need to specify it to PolyXSim in order to have the good symetry of the olivine, and hence, the good corresponding diffraction peaks.
First get a Pbnm CIF file from the American Mineralogist crystal structure database and transform it to have a CIF file for Pnma space group. In order to do so, only change the cell length on each axes (a,b,c) like shown before, and the x, y, z axes in the symetry operations (x to z, y to x, z to y). Do not forget to change the space group name from Pbnm to Pnma.
Here is the obtained CIF file.
Then, before the simulation of your data, in the .inp file for PolyXSim you should put a # before the space group line and make the structure_phase_0 line active. You should have :
### Structural unit_cell 10.1902 5.9787 4.7534 90.0 90.0 90.0 #unit_cell a [Å] b [Å] c [Å] alpha [°] beta [°] gamma [°] , Y being the phase number id #sgno 62 #space group number #oR #sgname_phase_0 'Pbnm' #remember to put quotation marks around the string if more phases then have the keywords unit_cell_phase_1, sgno_phase_1 etc. #or structure_phase_0 'Fosterite_Pnma.cif'
Do not forget to change the order of the axes in the unit_cell line of PolyXSim as well!
From here, PolyXSim simulate grains in the Pnma system so the peaks you obtain (and then the G-vectors) are in Pnma. Be carefull when comparing with other studies for which the Pbnm system is more common! Use the space group number 62 in the .ini file of GrainsPotter to find the grains from these Pnma G-vectors.
Here are typical errors that we bumped into
There are a number of possible output files from this procedure. Most are usually created quite fast.
The time consuming process is the creation of synthetic diffraction images. This time highly depends on the parameters in the input file, e.g. the amount of grains, the peak shape, strain tensors, or additional noise. For a simple test, it is wise to use an input file with very simple parameters (only a few grains, no strain tensors, no noise, small ω range etc.).
Possible output files include: