Mapping data between sample and detector conjugated spaces in Bragg coherent diffraction imaging.
Bragg coherent X-ray diffraction imaging (BCDI) is a non-destructive, lensless method for 3D-resolved, nanoscale strain imaging in micro-crystals. A challenge, particularly for new users of the technique, is accurate mapping of experimental data, collected in the detector reciprocal space coordinate frame, to more convenient orthogonal coordinates, e.g. attached to the sample. This is particularly the case since different coordinate conventions are used at every BCDI beamline. The reconstruction algorithms and mapping scripts composed for individual beamlines are not readily interchangeable. To overcome this, a BCDI experiment simulation with a plugin script that converts all beamline angles to a universal, right-handed coordinate frame is introduced, making it possible to condense any beamline geometry into three rotation matrices. The simulation translates a user-specified 3D complex object to different BCDI-related coordinate frames. It also allows the generation of synthetic coherent diffraction data that can be inserted into any BCDI reconstruction algorithm to reconstruct the original user-specified object. Scripts are provided to map from sample space to detector conjugated space, detector conjugated space to sample space and detector conjugated space to detector conjugated space for a different reflection. This provides the reader with the basis for a flexible simulation tool kit that is easily adapted to different geometries. It is anticipated that this will find use in the generation of tailor-made supports for phasing of challenging data and exploration of novel geometries or data collection modalities.