Reciprocal Space Units

Nice to find this database - I have been searching for TiC structure. Even nicer to see XRD patterns. However: mine are already calibrated in Q-space. It would be great to have an option to display against such. Any thoughts?

Yours, best, kdliss

You can retrieve the the simulated XRD data and plot it against yours, as they are just pymatgen spectra (docs). This example is copied from the API tab on mp-149:

from mp_api.client import MPRester
from pymatgen.analysis.diffraction.xrd import XRDCalculator
from pymatgen.symmetry.analyzer import SpacegroupAnalyzer

with MPRester(api_key="<enter your api key>") as mpr:
    # first retrieve the relevant structure
    structure = mpr.get_structure_by_material_id("mp-149")

# important to use the conventional structure to ensure
# that peaks are labelled with the conventional Miller indices
sga = SpacegroupAnalyzer(structure)
conventional_structure = sga.get_conventional_standard_structure()

# this example shows how to obtain an XRD diffraction pattern
# these patterns are calculated on-the-fly from the structure
calculator = XRDCalculator(wavelength="CuKa")
pattern = calculator.get_pattern(conventional_structure)

Then pattern.hkls stores the miller indices from which you can get \vec q, pattern.x stores 2\theta, and pattern.y stores the intensity