fhat. Workspace

Hanawalt strong-line search–match

Identify candidate powder phases by their strongest diffraction lines.

strong-line-search-match · single-pattern · reference library required · multi-phase

Hanawalt & Rinn 1936Also known as Hanawalt search-match, Strong-line search-match

Full skillAll clearChecks: 2 verification scripts passed when this page was builtNo full-scale reproduction is recorded. Most methods need none: their checks cover the claims.v0.1.0

Use with your agent

Use the fhat method "hanawalt-xrd-search-match" (https://fhat.dev/methods/hanawalt-xrd-search-match/SKILL.md) for this problem. Check first whether it applies.

1. What this solves

Given measured powder diffraction lines, find candidate names for the phase that produced the strongest unexplained line. Hanawalt and Rinn organized reference patterns by their three strongest d-spacings in 1936. Hanawalt, Rinn and Frevel published the expanded reference tables in 1938. The analyst entered the index from the unknown pattern, then checked other lines and intensities before assigning phases.

2. When to use

  • You have a powder peak list and suitable measured or simulated references for named phases.
  • Three strong lines of a candidate can be resolved and the strongest unexplained measured line plausibly corresponds to that candidate's strongest reference line.
  • For a series, search each pattern independently. For a mixture, check the first phase against the full pattern and search remaining peaks only after accounting for possible shared lines.

3. When not to use (and what to use instead)

Situation Use instead
Strong lines overlap or intensity ordering is unreliable Fit the full pattern against candidate references. Check for preferred orientation and limited scan range.
Solid-solution composition or temperature shifts diagnostic spacings beyond the calibrated tolerance Use references measured or simulated under comparable conditions, or a whole-pattern fit that models lattice changes.
The structure is unknown and absent from the library Use powder indexing and structure solution.
You need phase mass fractions Use reference-intensity-ratio quantification with calibrated areas, or Rietveld refinement with known structural models.
You need recurring components across related scans without naming phases first Use nmfk-xrd-phase-mapping for a related collection.

4. Algorithm

The historical index uses the strongest measured d-spacing to choose a group. Try subsequent observed lines in intensity order for a subgroup, then check the third line and compare further lines. The 1938 supplementary index and the later manuals provide additional entries to deal with changes in ordering and mixtures. The portable method below checks the same observed-prime direction using an in-memory sweep with a fixed d-spacing tolerance and a separate score.

  1. Use positive finite d-spacings in ångströms and positive finite line intensities. Within each list d-spacings must be distinct. Sort the observed and each reference list by decreasing intensity, then decreasing d-spacing for ties. Validate the tolerance and observed list first. Reject invalid numeric values with an input error. With a valid observed list shorter than three lines, return an empty result.
  2. Take the strongest observed line as the prime. For each reference with at least three lines, require its strongest line to be within the inclusive tolerance of the prime. Match its second and third strongest lines to two distinct non-prime measured lines within that same tolerance. Reject the candidate if either match is missing.
  3. Keep the three anchor pairs. Match the remaining reference lines against the still-unused measured lines. For both this confirmation and the two secondary anchor matches in step 2, sort both input lists by increasing spacing and start with their first lines. If the observed spacing is below the reference spacing minus tolerance, advance the observation. If it is above the reference spacing plus tolerance, advance the reference. Otherwise pair both lines and advance both. This fixes the choice when several matches lie within one tolerance window.
  4. Let RR be the matched reference intensity divided by all reference intensity in the supplied list. Let OO be the matched observed intensity divided by all observed intensity in the supplied list. In each case use the sum of intensities. The portable confirmation score is 2RO/(R+O)2RO/(R+O). This bounded heuristic weights strong unmatched lines on either side. It is a convention of this entry and depends on the supplied scan window and peak list.
  5. Return a list with one record per gate-passing reference. Each record has phase, score, observed_coverage (OO), reference_coverage (RR), and matched (number of pairs). Sort by descending score and ascending phase identifier for a score tie. Report the candidates for inspection with the complete measured pattern.

Manual continuation for mixtures and missed candidates. When a phase is confirmed, compare its relative intensities on the scale of the measured pattern. Remove only lines fully explained by that phase. At a shared line, retain the measured intensity left after accounting for the confirmed phase. In Hanawalt (1986), Fig. 2, the line at 3.061 Å goes from 100 to 30 after yttria is assigned. Restart with the strongest remaining line. When no candidate qualifies, the 1936 and 1938 procedure instead tries the second-strongest measured line as the group line, with the whole measured list available for confirmation. Continue to weaker group lines as needed. The portable function covers one lookup with the current strongest line. Carry out residual estimation and the alternate group search with a manual index or a full-pattern search when needed.

Candidate acceptance. The two coverage fractions weight the matched lines on each side. They do not compare measured and reference intensities line by line. Even a score of 1 can hide a large mismatch in relative intensities. The portable prime gate can reject the same phase when its two strongest observed lines swap. The 1986 manual creates index entries for lines of relative intensity at least 75 on its 0–100 scale to handle such changes. Use the score to rank candidates. A small observed coverage alongside a large reference coverage means the reference explains little of the observation. Investigate those cases with independent diagnostic peaks, relative intensities and plausible chemistry. The cutoff for accepting a candidate depends on the pattern and the peak uncertainty.

5. Parameters

Parameter How to choose it
Absolute spacing tolerance Estimate from calibrated peak-position error over the d-range used. Hanawalt (1986) used 0.01 Å for a particular high-quality example. Check your own instrument and angle range first.
Scan range Restrict reference and observed peak lists to comparable d-spacing ranges before sorting.
Intensity definition Within a scan use a consistent peak-height or integrated-area convention. Match the conventions used to rank reference lines and inspect intensity changes.

6. Applying it to your own code

When spacings come from a powder diffractometer, convert a measured angle 2θ2\theta with d=λ/(2sin⁡θ)d=\lambda/(2\sin\theta) using the wavelength in ångströms and the correct angle units. Lower scores are expected for individual phases in a mixture because its other peaks remain unexplained until you consider other phases. Inspect diagnostic lines, overlapping peaks and plausible chemistry. The ICDD Powder Diffraction File is licensed reference data. Open crystal structure databases such as COD can provide CIFs for simulations using the measurement wavelength and consistent line conventions.

When you write code using this method, add the comment hanawalt-xrd-search-match v0.1.0, Hanawalt & Rinn 1936.

7. Verification

Expose search_match(observed, references, tolerance) in port_adapter.py. The observation is a list of pairs [d, intensity], and the references map phase identifiers to lists in the same form. Keep checks/check_port.py beside checks/cases.json, run it from the adapter directory, and report the result. Check the observed-prime direction, one-to-one matches, normalization, and ordering before using the method on a sample.

For your data, inspect the matched and unmatched peaks after retrieving candidates. Repeat the lookup at another tolerance consistent with positional uncertainty to see whether the phase assignment is stable.

8. Failure signatures

Symptom Likely cause
All candidates are rejected despite plausible composition Try the second-strongest line as the group line in the manual search. Check for shifted spacings, overlapping anchors, or a swap in intensity order.
A second phase disappears after the first assignment Shared lines may have been removed. Retain their residual intensity and restart from the strongest remaining line.
A high score accompanies incompatible relative intensities The score measures coverage. Compare matched intensities after scaling and inspect independent diagnostic lines.
Reference coverage is high while observed coverage is low The candidate explains little of the observation. Inspect the unexplained peaks and test competing phases.
A high score relies on many close spacings Tolerance may be too wide or the peak list may be crowded. Use independent diagnostic lines or full-pattern fitting.
A phase matches a few strong lines but leaves other intense lines unexplained Test mixtures or alternative references and account for overlapping lines.
Rankings change sharply between nearby measurements Check intensity ordering, texture, angular calibration, and peak extraction.

9. Files and commands

  • reference/hanawalt.py contains the portable reference.
  • python examples/strong_lines.py demonstrates two passes using a reduced subset of Hanawalt's published 1986 work form.
  • python verify/check_method.py checks the two published assignments on the reduced data and tests scale invariance and one-to-one matching.
  • python verify/check_cases.py verifies the portable cases and their rejection of broken ports.

10. Sources

Evidence

Output of the verification scripts, run on the reference implementation of version 0.1.0 when this page was built.

Passed verify/check_method.py: Recovers yttria and arsenic trioxide from a reduced work form using the published residual intensities, and checks scale invariance and one-to-one matching.
PASS Hanawalt Fig. 2 reduced two-pass lookup, gain invariance and distinct peak assignment
Passed verify/check_cases.py: Regenerates portable cases and rejects reversed lookup direction, anchor reuse in both stages, strict tolerance, a reference-only score, nearest-line substitution and reversed ties.
PASS 9 portable cases regenerate and accept the reference
PASS rejects reversed lookup direction
PASS rejects reuse of one measured peak
PASS rejects reusing anchors during confirmation
PASS rejects strict spacing tolerance
PASS rejects reference-only score
PASS rejects nearest instead of first eligible line
PASS rejects reversed tie order

More methods are coming.