Python and MATLAB versions of a simple module to generate three-dimensional reciprocal space maps from X-ray diffraction data.
Use
git clone https://github.com/rafaela-felix/rsm.git
for obtaining the source codes.
The following requirements are needed for using the Python code:
- Python (version >= 3.6)
- Python packages (pip installable):
- numpy (>= 1.22.0)
- matplotlib (>= 3.5.0)
- imageio (>= 2.9.0)
- pyvista (>= 0.34.1) or any other library for mesh visualization (Paraview, vtkplotter, ParaView, Open3D, Vedo, etc)
Inside the rsm folder or any directory containing the codes,
- Call the function
ReciprocalSpaceMapsin the MATLAB Command Window.
ReciprocalSpaceMaps(wl, twoth_d, phi_d, D, p, Ny, Nx, n0, m0, nb, mb, folder, fnamepng, sclfactor, Az, El, th0, dth)
- Import the module
rms, then call it on a Python terminal.
from rms import rms
rsm(detector_info, scan_info, path, sclfactor, fnamepng, cmap, op, md, nd, el, az)
The following input is required for both codes:
-
path: location of image files -
fnamepng: output file name -
Detector parameters:
D: sample-detector distance (mm)p: pixel size (mm)Nx: number of pixels alongxd(horizontal direction)Ny: number of pixels alongyd(vertical direction)m0, n0: central pixel - hit by the direct beam (horizontal and vertical coordinates)
-
Scan parameters:
wl: wavelength (angstrom)twoth_d: elevation of detector arm (deg)phi_d: azimuth of detector arm (deg)th0: initialthvalue (deg)dth: increment in the rocking curve angle th (deg)
-
Plot parameters:
Az, El: Azimuthal and elevation angles of 3D plotsclfactor: isointensity curve levels (% of max value)md, nd: dead pixels ((horizontal and vertical coordinates, if there is)
The Python code has two additional (optional) parameters: op and cmap remaining for opacity and color of each isosurface. Also, the detector and scan parameters are expected as dictionaries (detector_info and scan_info).
If you use the codes in your research, please consider citing the following work:
@article{3d_reciprocal_space_maps,
title={A simple recipe to create three-dimensional reciprocal space maps},
author={Penacchio, Rafaela F. S. and Estradiote, Maurício B. and Morelhão, Sérgio L. and Fornari, Celso I.
and Kagerer, Philipp and Dittmar, Marco and Müller, Simon and Reinert, Friedrich},
year={2022},
doi={10.48550/ARXIV.2210.05427}
publisher = {arXiv}
}