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.
- 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.
- 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.
- 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.
- Let be the matched reference intensity divided by all reference intensity in the supplied list. Let 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 . 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.
- Return a list with one record per gate-passing reference. Each record has
phase,score,observed_coverage(),reference_coverage(), andmatched(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. |
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.pycontains the portable reference.python examples/strong_lines.pydemonstrates two passes using a reduced subset of Hanawalt's published 1986 work form.python verify/check_method.pychecks the two published assignments on the reduced data and tests scale invariance and one-to-one matching.python verify/check_cases.pyverifies the portable cases and their rejection of broken ports.
10. Sources
- J. D. Hanawalt and H. W. Rinn (1936), classification by strong lines and the procedure for unknowns. Original paper and public reprint.
- J. D. Hanawalt, H. W. Rinn and L. K. Frevel (1938), expanded reference tables and supplementary index. Original paper and public reprint.
- J. D. Hanawalt (1986), Fig. 2 and the worked example. Original paper and public copy.
- S. Gražulis et al. (2009), an open source for crystal structures. COD paper.