---
title: "Check a batch against reference XRD patterns"
description: "Pull reference powder patterns with opXRD, then refine an experimental pattern against them with PYWPEM."
tags:
  - recipes
  - structure
tools:
  - opxrd
  - pywpem
generated: true
source: quickActionConfig:xrd-database-analysis
---

> **Generated recipe**

> Seeded from a curated quick-action prompt. The prompt below runs the real
> routing — copy it, change the target, and run.

**Best fit:** analyze XRD patterns — a structure goal.

**Try this prompt** — [open in a guest chat](/chat/new?guest=true&prompt=Retrieve%20reference%20XRD%20patterns%20for%20ibuprofen%20RS-racemate%20and%20S-enantiomer%20from%20the%20ICDD%2FCSD%2C%20overlay%20with%20an%20experimental%20pattern%20from%20a%20manufacturing%20batch%2C%20and%20perform%20Rietveld%20refinement%20%E2%80%94%20does%20the%20batch%20contain%20any%20racemic%20contamination%20above%202%25%20and%20do%20the%20refined%20lattice%20parameters%20match%20the%20reference%20within%20acceptable%20limits%3F).

> Retrieve reference XRD patterns for ibuprofen RS-racemate and S-enantiomer from the ICDD/CSD, overlay with an experimental pattern from a manufacturing batch, and perform Rietveld refinement — does the batch contain any racemic contamination above 2% and do the refined lattice parameters match the reference within acceptable limits?

_A real `xrd-database-analysis` quick-action prompt — open it in a guest chat, then swap in your own compound and batch pattern._

## The prompt

```text
Retrieve reference XRD patterns for ibuprofen RS-racemate and S-enantiomer from the ICDD/CSD, overlay with an experimental pattern from a manufacturing batch, and perform Rietveld refinement — does the batch contain any racemic contamination above 2% and do the refined lattice parameters match the reference within acceptable limits?
```

## What each tool contributes

- [opxrd](/docs/opxrd) — Reference pattern lookup by elements, spacegroup, formula, or similarity
- [pywpem](/docs/pywpem) — Whole-pattern refinement and quantitative analysis against reference CIFs

## Why these tools pair

Search opXRD for reference patterns matching experimental data, then use PYWPEM for detailed refinement, background subtraction, or phase quantification against matched references

## Data flow

Every tool operates on the same input: `query`.

## See also

- [Polymorph Screening](/docs/workflows/polymorph-screening) — the guided version: predict crystal forms with XtalNet, then match PXRD data.
- [Which tool?](/docs/which-tool) — match a single goal to a tool.
- [Workflows](/docs/workflows) — every workflow and recipe.
- [How the orchestrator picks tools](/docs/how-orchestration-works) — the same chain from a plain-language goal.
