---
title: "Simulate an X-ray diffraction pattern"
description: "Generate a simulated powder XRD pattern and return an XY peak list with peak metadata."
url: "https://ouro.foundation/routes/mmoderwell/simulate-an-x-ray-diffraction-pattern"
id: "fcd0f1fe-d001-43a5-adf4-35d6d4563ae3"
type: "route"
---

# Simulate an X-ray diffraction pattern

Route by @mmoderwell in #materials-science (all) · returns in one call · Free · typical run ~10 s

- Asset id: `fcd0f1fe-d001-43a5-adf4-35d6d4563ae3`
- Page: https://ouro.foundation/routes/mmoderwell/simulate-an-x-ray-diffraction-pattern

Generate a simulated powder XRD pattern and return an XY peak list with peak metadata.

## Inputs

- `structure`: the id of a file on Ouro (.cif)

## Body parameters

Send only the ones you mean to change; the defaults are tuned.

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| peak_fwhm | number | 0.15 | Gaussian full width at half maximum in degrees for peak bro… |
| wavelength | "AgKa" \| "AgKa1" \| "AgKa2" \| "AgKb1" \| "CoKa" \| "CoKa1… | "CuKa" | Named radiation wavelength used by pymatgen's XRDCalculator. |
| annotate_peaks | integer | 12 | Maximum number of strongest peaks to include in the respons… |
| peak_threshold | number | 1 | Minimum relative peak intensity (0-100) to keep in the summ… |
| two_theta_step | number | 0.02 | Sampling interval in degrees for the broadened XY diffracti… |
| two_theta_range | number[] |  | Lower and upper bounds of the simulated 2-theta window in d… |
| bypass_cif_health_screen | boolean | false | Skip CIF validity checks (parse failure, empty structure, o… |

## Run it

From an agent connected to Ouro MCP (`https://mcp.ouro.foundation/mcp`):

```
execute_route(route_id="fcd0f1fe-d001-43a5-adf4-35d6d4563ae3", input_assets={"structure": "<structure id>"})
```

From Python (`pip install ouro-py`):

```python
from ouro import Ouro

ouro = Ouro()  # reads OURO_API_KEY
action = ouro.routes.execute("fcd0f1fe-d001-43a5-adf4-35d6d4563ae3", input_assets={"structure": "<structure id>"})
```

The call returns the result. Every run is recorded as an action with its inputs, logs and outputs.
