diffraction_peaks — DRIVE pxrd op

• Data kinds: signal × signal → table

• Call: import fullseye as fs; fs.ledger.diffraction_peaks(two_theta, intensity, min_snr=6.0, baseline_window=None, max_peaks=200, noise=None) (to call the implementation directly, import pxrd; pxrd.diffraction_peaks(two_theta, intensity, min_snr=6.0, baseline_window=None, max_peaks=200, noise=None); from the registry, opsdrive.get("diffraction_peaks"))

Usage

Picks peaks from a 1-D diffraction profile and gives their position, height, FWHM and area by a local Gaussian + linear fit.

> The detailed description below is the original text — the summary and the headings are translated.

手順: 窓 baseline_window [deg] (既定 = 範囲の 4 %)の転がり最小 → 転がり平均で背景を作り、背景を引いた値の局所の最大のうち min_snr × 雑音を超えるものを候補にする(雑音は間隔 1〜8 の差分の MAD の最大から。noise に

数か、azimuthal_integrate の sigma のようなビンごとの配列を渡してもよい —— 中心の近くや隅のように画素の少ないビンの揺れを山と取り違えないためには配列が要る)。各候補の半値幅を目で測る代わりに半値の交点で見積もり、隣の候補との中点で切った窓でガウス + 直線を scipy.optimize.least_squares で当てる。重なった山は窓が切られるぶん偏る(分けたいなら phase_fractions)。

返り値(dict): two_theta・height・fwhm [deg]・area・snr・fit_ok(当てはめが収束し窓の中に収まったか)、noise、baseline(格子と同じ長さ)。山が無ければ長さ 0 の配列(空 = 失敗ではない)。

Raises ValueError: 長さの不一致・非有限・2θ が増えない、min_snr <= 0。

References (sample data, literature)

• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).

• Operator provenance and references — the sources of the research/methods this op family came from.

• The canonical algorithm (author, year) and its uses are named in the family usage guide above.

Runnable examples (verified samples that actually call this op)

• poc_pxrd_phase_peel — py -3.11 examples/poc_pxrd_phase_peel.py

Ops the type connects to (they accept table as input)

course_layout · course_occupancy · course_contains · world_build · world_camera · world_move · lidar_scan · rss_longitudinal_same

Same category (pxrd)

cif_read · cubic_prototype · powder_reflections · scherrer_size · debye_ring_image · detector_two_theta · detector_calibrate · azimuthal_integrate


*Provenance: pxrd.py — DRIVE operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.