xdart · Peak Fitter · physics and fitting guide
What a diffraction peak measures, and how the Peak Fitter fits it
A diffraction peak is the signature of one family of lattice planes. Its position gives their spacing, its width the size and strain of the crystallites, and its area how much of the phase is there. This guide starts with that physics, then shows how each number the Peak Fitter reports follows from it.
6 profilespseudo-Voigt, Gaussian, Lorentzian, Voigt, Pearson VII, split pseudo-Voigt
6 backgroundsnone, a polynomial or Chebyshev of a chosen degree, and three template backgrounds
1 to 12 peaksfound automatically, counted, or placed at typed centres
Notebook exporta fit exports to Jupyter and marimo, with its template once a fit has
recorded the template's file
The physics
Where a peak comes from
What a peak measures
From fit to physics
| Fitted value | What it measures | Read it as |
|---|---|---|
Center, p0_center | position in the displayed x unit; for total q, d = 2π/q | spacing changes can show strain or thermal expansion; a 2θ centre needs the source wavelength in Bragg's law |
FWHM, p0_fwhm | size and microstrain broadening, plus the instrument | size from Scherrer, D ≈ 2πK/FWHMsize, with the size-only width in total-q units after instrument correction and negligible or separately resolved strain broadening |
Amplitude, p0_amplitude | the peak's area, its integrated intensity | phase amount × |F|² × multiplicity × texture: compare one reflection across frames |
p0_fraction | the Lorentzian share of a pseudo-Voigt | size broadening tends to be Lorentzian, strain and instrument broadening Gaussian |
bg_A | the template's scale | relative substrate scattering; thickness, absorption and intensity normalization can all change it |
| the trend | any of these against frame or a scan column | in-situ change: expansion on heating, a phase growing |
How the Peak Fitter fits
What a fit is made of
datafit
backgroundpeak 1
peak 2peak 3residual
Choosing a peak profile
GaussianLorentzian
pseudo-Voigt, fraction 0.5Pearson VII, m = 1.5
split pseudo-Voigt
A measured background: the template
measured substrate (template)
template × bg_Asample data
fit
bg_A
(never below 0), and adds the peaks; here the fitted bg_A comes out close to the 1.6 the sample was made
with.
Template + polynomial or Template + Chebyshev add a small correction, of the degree in the box beside the choice, under bgx_
names. Beyond the template's own range, its value is held flat.Where a template comes from
Units that convert
| Template unit | Fit unit | Result | Why |
|---|---|---|---|
| q (nm⁻¹) | q (Å⁻¹) | converts | the same axis, a factor of 10 |
| 2θ (rad) | 2θ (°) | converts | the same angle |
| 2θ | q | refused | it needs a wavelength the template does not record |
| q_ip or q_oop | q | refused | different axes of a grazing-incidence pattern |
An .xye file's name only suggests its unit. xdart writes iq_ for q in Å⁻¹ and in nm⁻¹ alike, so
the Peak Fitter waits for you to choose the unit before it reads the file.
Range, uncertainties and weights
- Full, on by default, fits the whole trace and shows its ends greyed; turn it off to type a range, or drag the shaded range on the plot.
- Auto, beside No. of peaks, finds up to twelve peaks in the range; turn it off to fit the count, or type centres in Peak parameters.
- σ initial seeds each peak's width; σ min / max bound the fitted width, and Center ± delta bounds the fitted centre around its start. Max iterations caps the solver.