xraytools.

Peak Finding

A diffractometer hands you thousands of points and every page that does anything with a powder pattern wants a handful of numbers instead. Peak finding is that step: fit the background, subtract it, decide which bumps are peaks, and measure each one. This page does it without fitting a peak shape, and it hands the answer straight to the pages that index the positions and take the widths apart.

You supply
A raw scan — two columns, a position in degrees 2θ and a count, one point per line. No peak list, no widths and no wavelength except for the d column. If you have no scan to hand, the page simulates one from a structure it ships, so you can see what the search does to a pattern whose answer is already known.
Reading it
A peak finder can be wrong in two ways and neither of them shows in its output: it can invent a peak out of noise, and it can report two reflections as one peak. Those are different words on purpose — a reflection is a point of the reciprocal lattice, a peak is something a detector recorded, and several reflections at one d make one peak. A found peak here has to be the tallest point within one peak width and clear five times the local noise — local, because counting noise grows as the square root of the counts, so one number for a whole scan is too small on the baseline and it is the baseline that manufactures peaks. Against merging there is no defence: reflections closer than about one width come back as a single peak between them.

Worked examples: albite – 200 reflections, and the scan cannot resolve them all · rutile at 5 nm – the peaks merge, and nothing can undo that · a 0.1° step – the width that comes back is the step

See also: Bragg Calculator · HKL Calculator · Line Broadening · Intensity Corrections · Powder Indexing

Input

Your scan

One point per line, whitespace-, comma- or semicolon-separated — .xy, .xye, .dat and what a spreadsheet puts on the clipboard all work. A third column is ignored, so an .xye keeps its error bars. Anything after a # is ignored and a header row of words is skipped. A decimal comma cannot work here: a comma also separates the columns.

% of the tallest
Or simulate one
° 2θ
× √counts
nm, blank for large
% of the tallest

A scan this site generates rather than measures, so every line in it is known before the search runs — which is what makes the panel below a score rather than a claim. Drop the crystallite size to a few nanometres and watch the peaks merge.

This scan is simulated

Nothing was pasted in, so this is a scan this site generated rather than measured: rutile at Cu Kα, through the same forward model the powder simulator draws with, on a broad amorphous background with counting noise on top. The background and the noise are there on purpose: a finder shown clean peaks on a flat line demonstrates nothing, and the background is the step this page spends most of its care on. Paste your own scan over it.

What came back

19 peaks, at a full width of 0.081°. That width is a measurement in its own right: it is what the instrument contributes plus whatever the sample adds, and the line broadening page is where the two come apart.

peak — 2θ 27.457°, d 3.2485 Å, I 100.0, FWHM 0.0806°peak — 2θ 27.457°, d 3.2485 Å, I 100.0, FWHM 0.0806°peak — 2θ 36.106°, d 2.4876 Å, I 45.7, FWHM 0.0813°peak — 2θ 36.106°, d 2.4876 Å, I 45.7, FWHM 0.0813°peak — 2θ 39.221°, d 2.2970 Å, I 7.1, FWHM 0.0763°peak — 2θ 39.221°, d 2.2970 Å, I 7.1, FWHM 0.0763°peak — 2θ 41.272°, d 2.1874 Å, I 18.7, FWHM 0.0818°peak — 2θ 41.272°, d 2.1874 Å, I 18.7, FWHM 0.0818°peak — 2θ 44.077°, d 2.0545 Å, I 6.9, FWHM 0.0816°peak — 2θ 44.077°, d 2.0545 Å, I 6.9, FWHM 0.0816°peak — 2θ 54.363°, d 1.6876 Å, I 58.7, FWHM 0.0803°peak — 2θ 54.363°, d 1.6876 Å, I 58.7, FWHM 0.0803°peak — 2θ 56.670°, d 1.6243 Å, I 17.0, FWHM 0.0831°peak — 2θ 56.670°, d 1.6243 Å, I 17.0, FWHM 0.0831°peak — 2θ 62.808°, d 1.4795 Å, I 8.2, FWHM 0.0812°peak — 2θ 62.808°, d 1.4795 Å, I 8.2, FWHM 0.0812°peak — 2θ 64.099°, d 1.4528 Å, I 8.4, FWHM 0.0814°peak — 2θ 64.099°, d 1.4528 Å, I 8.4, FWHM 0.0814°peak — 2θ 65.574°, d 1.4236 Å, I 0.6, FWHM 0.0870°peak — 2θ 65.574°, d 1.4236 Å, I 0.6, FWHM 0.0870°peak — 2θ 69.061°, d 1.3600 Å, I 21.6, FWHM 0.0803°peak — 2θ 69.061°, d 1.3600 Å, I 21.6, FWHM 0.0803°peak — 2θ 69.861°, d 1.3464 Å, I 10.8, FWHM 0.0774°peak — 2θ 69.861°, d 1.3464 Å, I 10.8, FWHM 0.0774°peak — 2θ 72.482°, d 1.3040 Å, I 1.1, FWHM 0.0782°peak — 2θ 72.482°, d 1.3040 Å, I 1.1, FWHM 0.0782°peak — 2θ 76.604°, d 1.2438 Å, I 2.4, FWHM 0.0731°peak — 2θ 76.604°, d 1.2438 Å, I 2.4, FWHM 0.0731°peak — 2θ 79.900°, d 1.2006 Å, I 1.3, FWHM 0.0786°peak — 2θ 79.900°, d 1.2006 Å, I 1.3, FWHM 0.0786°peak — 2θ 82.411°, d 1.1702 Å, I 4.6, FWHM 0.0810°peak — 2θ 82.411°, d 1.1702 Å, I 4.6, FWHM 0.0810°peak — 2θ 84.322°, d 1.1485 Å, I 3.4, FWHM 0.0743°peak — 2θ 84.322°, d 1.1485 Å, I 3.4, FWHM 0.0743°peak — 2θ 87.560°, d 1.1142 Å, I 1.1, FWHM 0.0835°peak — 2θ 87.560°, d 1.1142 Å, I 1.1, FWHM 0.0835°peak — 2θ 89.634°, d 1.0937 Å, I 7.8, FWHM 0.0825°peak — 2θ 89.634°, d 1.0937 Å, I 7.8, FWHM 0.0825°reflection — 2θ 27.456°, I 100.0reflection — 2θ 27.456°, I 100.0reflection — 2θ 36.107°, I 45.7reflection — 2θ 36.107°, I 45.7reflection — 2θ 39.220°, I 6.9reflection — 2θ 39.220°, I 6.9reflection — 2θ 41.271°, I 18.9reflection — 2θ 41.271°, I 18.9reflection — 2θ 44.077°, I 6.9reflection — 2θ 44.077°, I 6.9reflection — 2θ 54.363°, I 58.5reflection — 2θ 54.363°, I 58.5reflection — 2θ 56.670°, I 17.5reflection — 2θ 56.670°, I 17.5reflection — 2θ 62.810°, I 8.4reflection — 2θ 62.810°, I 8.4reflection — 2θ 64.099°, I 8.5reflection — 2θ 64.099°, I 8.5reflection — 2θ 65.563°, I 0.7reflection — 2θ 65.563°, I 0.7reflection — 2θ 69.061°, I 21.5reflection — 2θ 69.061°, I 21.5reflection — 2θ 69.861°, I 10.6reflection — 2θ 69.861°, I 10.6reflection — 2θ 72.479°, I 1.2reflection — 2θ 72.479°, I 1.2reflection — 2θ 76.605°, I 2.3reflection — 2θ 76.605°, I 2.3reflection — 2θ 79.901°, I 1.3reflection — 2θ 79.901°, I 1.3reflection — 2θ 82.409°, I 4.6reflection — 2θ 82.409°, I 4.6reflection — 2θ 84.323°, I 3.2reflection — 2θ 84.323°, I 3.2reflection — 2θ 87.559°, I 1.2reflection — 2θ 87.559°, I 1.2reflection — 2θ 89.633°, I 7.9reflection — 2θ 89.633°, I 7.9102030405060708090foundreflectionscounts / degrees
The dashed curve is the background this page fitted and subtracted; every height, width and area in the table is measured above it. Hover any mark to read its own numbers. The upper row of marks is where the peaks were found. The lower row is where the simulator actually put the reflections, which is not the same list: several reflections at one d make one peak. They are drawn in separate rows rather than on top of each other, because two marks at one place look like one mark and a near miss would look like a hit. There is no hover on a touch screen: the table below carries the same numbers.

How it did

This scan was generated by this site, so the answer was known before the search ran. The forward model put 20 reflections into it, of which 19 are strong enough to clear the reporting threshold. The search returned 19 peaks, and 19 of those reflections lie within one peak width of one of them — worst position out by 0.0112°, worst width out by 0.007°. 0 peaks correspond to no reflection at all. A match counts within one peak width (0.081°), because that is the resolution the scan physically has.

The peaks

# / °d / Åheightrel. / %FWHM / °area
127.4573.2485293211000.08063720
236.1062.48761339345.70.08131711
339.2212.29720807.10.0763247
441.2722.1874547718.70.0818704
544.0772.054520206.90.0816259
654.3631.68761720158.70.08032172
756.671.62434985170.0831658
862.8081.479524048.20.0812308
964.0991.452824548.40.0814315
1065.5741.42361810.60.08727
1169.0611.36632321.60.0803794
1269.8611.3464317210.80.0774383
1372.4821.3043221.10.078240
1476.6041.24387062.40.073183
1579.91.20063811.30.078649
1682.4111.170213524.60.081174
1784.3221.14859923.40.0743116
1887.561.11423361.10.083545
1989.6341.093722737.80.0825300

Heights and areas are in the units of the second column of your scan, above the fitted background. The area is the area between the two half-height crossings, doubled, which is not the integrated intensity: the tails outside those crossings carry about a fifth of a Gaussian peak and about half of a Lorentzian one, and which of those this is cannot be known without fitting a shape. Use it for ratios between peaks of similar shape, where the missing tail cancels, and not as an absolute.

Where these go next

Both links carry the numbers above, so nothing has to be retyped.

The width was measured, not typed

Nobody typed that width in. The search starts at 1°, measures the widths it finds, takes the median and runs again: 1 → 0.3180.180.081. The median rather than the mean, because a merged pair of lines is a large outlier and must not drag the estimate. The starting value is above any laboratory peak width and not far above: a start below the truth sticks, because a width below the truth finds the shoulders of real peaks and shoulders are narrow, which confirms the wrong answer — and a start several times too wide fails in the other direction, sometimes without saying so.

What a peak list is evidence of

A peak finder can be wrong in two ways and neither of them shows in its output: it can invent a peak out of noise, and it can report two reflections as one peak. This page is built against both, and the numbers are measured rather than claimed — run on scans this site generated from structures it ships, so every line is known before the search sees it, rutile gave 18 peaks with none invented and none of its 12 strong lines missed, and the worst position was out by 0.0014°. Against invention there are two tests and a peak has to pass both: it must be the tallest point within one peak width, and it must clear 5 times the local noise. Local matters — counting noise goes as the square root of the counts, so one number for a whole scan is too small on the baseline, and it is the baseline that manufactures peaks. Against merging there is no defence at all: two reflections closer than about one width come back as one peak between them, and the only sign is a width larger than its neighbours’.

Three things this page does not do, each for a reason rather than for want of code. It does not fit peak shapes — there is no least squares here and no eta. A fitted shape gives a better width on an isolated peak and a confidently wrong one on an overlapped pair, and nothing here could tell you which it had just done. It does not separate overlapping lines. And it stores nothing: your scan arrives in the request and leaves with the answer, so there is no file, no upload directory and no retention question to have an opinion about.

Where this comes from