mat-xrd-digitizer
Digitize an image of an XRD plot into a numeric .xy data file by extracting visual peaks.
Skill by learningmatter-mit
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/learningmatter-mit-mat-xrd-digitizer
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: data
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
- Runs as
- Python package
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/mat-xrd-digitizer
What's inside
- Skill name
mat-xrd-digitizer- Description
- Digitize an image of an XRD plot into a numeric .xy data file by extracting visual peaks.
- License
- MIT
- Instructions
- 77 lines in SKILL.md · view on GitHub
Before installing
- Ships executable scripts
Files (7)
- SKILL.md
- README.md · examples/digitize-ybco/
- example_ybco.png · examples/digitize-ybco/
- example_ybco.xy · examples/digitize-ybco/
- original_plot.png · examples/digitize-ybco/
- peaks.json · examples/digitize-ybco/
- digitize_plot.py · scripts/
SKILL.md (first lines)
# XRD Digitizer
## Goal
To convert an image or screenshot of an X-Ray Diffraction (XRD) pattern into a digitized, numeric `.xy` data file, which can then be used by downstream analysis tools like `mat-xrd-phase-analysis`.
This skill leverages the AI Agent's built-in Vision/Language Model (VLM) capabilities. The Agent will visually parse the provided image to extract key peak positions (2-theta) and approximate relative intensities, and then use a provided script to mathematically generate a representative pseudo-Voigt profile.
## Instructions
### 1. Extract Peaks Visually
Provide the agent with an image (e.g., screenshot) of the XRD plot. The agent will visually inspect the plot and identify the coordinates of the major peaks.
**Handling Multiple Curves/Colors:**
If the image contains multiple XRD patterns, the user should specify which curve to digitize by its color, label, or position (e.g., *"digitize the red curve"* or *"digitize the curve labeled 'sample A'"*). The agent will then selectively extract peaks from only that specific curve.
**Agent Action:** The agent should:
1. Create a JSON file (e.g., `peaks.json`) containing the extracted peaks as an array of objects for the target curve. **CRITICAL: You must ensure every single visible peak, including the tiny minor peaks, is reported and digitized to ensure accurate full-profile refinement downstream.**
2. Save a copy of the original image (e.g., `original_plot.png`) in the same directory as the JSON file for future reference.
Example `peaks.json` format:
```json
[
{"2theta": 8.8, "intensity": 0.05, "fwhm": 0.3},
{"2theta": 15.8, "intensity": 0.08, "fwhm": 0.3},
{"2theta": 33.1, "intensity": 1.00, "fwhm": 0.3}
]
```
*Note: `intensity` should be normalized between 0 and 1.0 (where the highest peak is 1.0). `fwhm` defaults to 0.3.*
### 2. Generate the Digitized `.xy` File
Use the provided script to generate the experimental `.xy` file based on the extracted peaks.
```bash
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/digitize_plot.py peaks.json --output digitized_plot.xy --min-x 5.0 --max-x 80.0
```
**Parameters:**
- `input`: The JSON file containing the extracted peak parameters.
- `--output`: Path to save the resulting `.xy` file.
- `--min-x`: Minimum 2-theta value to generate (default: 5.0).
- `--max-x`: Maximum 2-theta value to generate (default: 90.0).
- `--points`: Number of data points in the `.xy` file (default: 4000).
- `--noise`: Amplitude of experimental noise to add (default: 0.01).
- `--background`: Amplitude of exponential background baseline (default: 0.05).
## Examples
For a full working example of extracting and digitizing a YBCO plot:
See [`examples/digitize-ybco/README.md`](examples/digitize-ybco/README.md).
```bash
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/digitize_plot.py ${CLAUDE_SKILL_DIR}/examples/digitize-ybco/peaks.json --output test_ybco.xy
```
## Constraints
- **Approximation:** The digitized plot is a mathematical approximation using pseudo-Voigt profiles. It does not perfectly recreate the exact pixel-by-pixel raw data of the original scan, but it is highly effective for downstream phase matching tools.
- **Vision Accuracy:** The accuracy of the 2-theta positions entirely depends on the clarity of the provided image axes.
- **Environments:** Scripts require the `cpu` environment. **Each code block MUST specify the environment.**
## References
- Pseudo-Voigt profile generation is standard practice in XRD peak fitting (e.g., Rietveld refinement tools).
## Related Skills
- [mat-xrd-phase-analysis](../mat-xrd-phase-analysis/SKILL.md): Use the generated `.xy` file to identify the material phases.
---
**Author:** Bowen Deng
**Contact:** [GitHub @learningmatter-mit](https://github.com/learningmatter-mit)From learningmatter-mit/AtomisticSkills, MIT.
More from learningmatter-mit/AtomisticSkills
- 0.681score
drug-complex-system-builder
learningmatter-mit
Build a solvated, charge-neutralized protein-ligand complex for OpenMM molecular dynamics simulation.
SkillAFreshness: A★ 183Claude Code +9 - 0.681score
drug-binding-site-definition
learningmatter-mit
Define a docking search box (center coordinates + box dimensions in Angstroms) from a co-crystal ligand, binding-site residues, or a saved JSON specification.
SkillAFreshness: A★ 183Claude Code +9 - 0.681score
drug-mmpbsa-gbsa
learningmatter-mit
Compute single-trajectory MM-GBSA and / or MM-PBSA binding free energy estimates from a protein-ligand MD trajectory.
SkillAFreshness: A★ 183Claude Code +9 - 0.681score
drug-pocket-detection
learningmatter-mit
Identify and rank ligandable pockets on a protein structure or model using geometry (fpocket) or an ML predictor (P2Rank).
SkillAFreshness: A★ 183Claude Code +9 - 0.678score
chem-sorption-relax
learningmatter-mit
Prepares supercells for porous frameworks based on minimum interplanar distance and relaxes them using standard MLIP relaxation tools.
SkillAFreshness: A★ 183Claude Code +9 - 0.678score
drug-protein-ligand-md
learningmatter-mit
Run a protein-ligand MD simulation in OpenMM with energy minimization, restrained equilibration, and production NPT, producing trajectory and checkpoint files…
SkillAFreshness: A★ 183Claude Code +9 - 0.678score
chem-db-qmof
learningmatter-mit
Query the Quantum MOF (QMOF) database via Materials Project's MPContribs platform for DFT-computed properties (bandgap) and optimized crystal structures of…
SkillAFreshness: A★ 183Claude Code +9 - 0.678score
chem-bond-dissociation
learningmatter-mit
Calculate homolytic and heterolytic bond dissociation energies (BDEs) for all single bonds in a molecule using MLIPs with RDKit fragmentation.
SkillAFreshness: A★ 183Claude Code +9 - 0.678score
chem-hazard-toxicity
learningmatter-mit
Extract explicit safety warnings, GHS classifications, LD50 toxicity profiles, and acute oral toxicity triage from PubChem PUG VIEW.
SkillAFreshness: A★ 183Claude Code +9 - 0.678score
drug-redocking-rmsd
learningmatter-mit
Compute symmetry-corrected heavy-atom RMSD between docked poses and a reference crystal ligand to validate docking protocols.
SkillAFreshness: A★ 183Claude Code +9 - 0.678score
drug-pose-validation
learningmatter-mit
Validate docked or generated ligand poses for physical plausibility using PoseBusters, filtering out chemically invalid or clashing poses before downstream…
SkillAFreshness: A★ 183Claude Code +9 - 0.678score
chem-dft-orca-optimization
learningmatter-mit
Run DFT geometry optimization (minimization or TS search) on a molecular structure using ORCA via SCINE/ReaDuct wrapper.
SkillAFreshness: A★ 183Claude Code +9
Signals
- Stars
- 183
- Forks
- 31
- Open issues
- 0
- Last commit (this folder)
- Oct 5, 2026 (24 days ago)
- Last release
- Oct 6, 2026 (23 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Website
- arxiv.org/abs/2605.24002
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from learningmatter-mit
- 0.681score
drug-binding-site-definition
learningmatter-mit
Define a docking search box (center coordinates + box dimensions in Angstroms) from a co-crystal ligand, binding-site residues, or a saved JSON specification.
SkillAFreshness: A★ 183Claude Code +9 - 0.681score
drug-complex-system-builder
learningmatter-mit
Build a solvated, charge-neutralized protein-ligand complex for OpenMM molecular dynamics simulation.
SkillAFreshness: A★ 183Claude Code +9 - 0.681score
drug-mmpbsa-gbsa
learningmatter-mit
Compute single-trajectory MM-GBSA and / or MM-PBSA binding free energy estimates from a protein-ligand MD trajectory.
SkillAFreshness: A★ 183Claude Code +9 - 0.681score
drug-pocket-detection
learningmatter-mit
Identify and rank ligandable pockets on a protein structure or model using geometry (fpocket) or an ML predictor (P2Rank).
SkillAFreshness: A★ 183Claude Code +9 - 0.678score
drug-pose-validation
learningmatter-mit
Validate docked or generated ligand poses for physical plausibility using PoseBusters, filtering out chemically invalid or clashing poses before downstream…
SkillAFreshness: A★ 183Claude Code +9 - 0.678score
chem-sorption-relax
learningmatter-mit
Prepares supercells for porous frameworks based on minimum interplanar distance and relaxes them using standard MLIP relaxation tools.
SkillAFreshness: A★ 183Claude Code +9
Cite this page
mat-xrd-digitizer skill. Agent Mart. https://agentmart.dev/skills/learningmatter-mit-mat-xrd-digitizer (last updated 2026-10-24)