This is a Python script to calculate the reciprocal space from Ga2O3 simulation cells obtained by molecular dynamics.
Before running RS_calculator.py, edit the name of the source files (in this case, they are of the form "{i}-frame.data") and the output files ("RSM_{i}-frame.dat"). The number of rows (i.e., particles) should also be given. In this example, the data file "0-frame.data" corresponds to a pristine cell with 320000 atoms, and the reference system where x||a*, y||b, z||c.
Then, the desired reciprocal space region and step should be given in reciprocal Angstrom units. In this case, the discretisation of the reciprocal space is performed in 3 directions (a*,b,c), between -82 and 82 nm-1, with 101 points per direction.
In order to keep up with the usual conventions, the input is given in Angstrom (as used by LAMMPS) and the output in given in nm-1.
This is easily extended to other materials by using the appropriate Cromer-Mann coefficients.
The results can be easily plotted by the companinon script RS_plotter.py. In this example, we obtain a diffraction pattern corresponding to the [010] zone axis.
The script SP_calculator.py can be used to produce a stereographic projection of the output of RS_calculator.py. In this case, the usual Physics conventions for spherical coordinates are used (i.e., the azimuthal angle φ lies in the x-y plane and the polar angle θ is measured with the respect to the positive z axis). If an different axis perpendicular to the surface is desired, the cell must be suitably rotated. The user must also supply the desired range of interplanar spacings.
The script Powder_calculator.py can be used to produce a powder pattern from the output of RS_calculator.py. The user must supply the desired range for the 2θ angle. It should be noted that this pattern is quite sensitive to the step used in the discretisation of the reciprocal space above. It is usually more efficient to perform the spherical average from the begining, according to the Debye scattering formula.