Three-dimensional diffraction mapping by tuning the X-ray energy