Skip to content

Fitting diffraction peaks

The Fitting Diffraction Peaks (F) tool fits the peaks of a diffraction profile with an appropriate function, derives the d-spacing from each peak position 2θ, and refines the lattice constants by least squares. It is launched from the toolbar of the main window.

Whole peak-fitting window

Basic workflow

  1. Select the target crystal in the crystal list (in multi-profile mode, also select the profile you want to work on).
  2. In the main window, drag the diffraction lines with the mouse so that they overlap the measured peaks as closely as possible.
  3. Choose the indices of the diffraction lines you want to fit from the diffraction-peak list (a checked list box).
  4. Once enough independent indices are chosen for the least-squares calculation to be solvable, the most-probable lattice constants appear, with their errors, in the Optimized cell constants panel at the lower right.
  5. Press Apply to the crystal to push the refined lattice constants back to the crystal in the main program.

Checking and selecting a crystal

The crystal list mirrors the one in the main window. For fitting to take effect, the target crystal must be both checked and selected.

Crystal list

Crystal list

The crystal list at the top left contains the same crystals as the main window. The crystal you check and select here becomes the fitting target. See Crystal parameters for details.

Diffraction-peak list

Diffraction-peak list

The diffraction lines of the selected crystal are listed here. Turning on the checkbox of a row makes that diffraction line a fitting target. The list contains columns such as the following.

Column Content
Check Whether to include the line in the fit
PeakColor Display color
Crystal Crystal name
HKL Reflection indices
Calc X Calculated diffraction-line position
Func Peak function used
X Peak position obtained by fitting
X Err Error of the peak position
FWHM Full width at half maximum
Intensity Peak intensity
Weight Weight in the least-squares fit
R Residual index of the fit

The buttons below the list export the results.

  • Copy to Clipboard: Copies the table to the clipboard. It can be pasted directly into Excel and similar applications.
  • Save as CSV: Saves the table as a .csv file. Effective digit sets the number of significant digits shown in the table.
  • Clear peaks: Deletes all peaks added manually to the Flexible Crystal.

Fitting option

Fitting option

Here you make detailed settings used when fitting the peak profiles.

Search Range / Initial FWHM

Search Range and Initial FWHM

  • Search Range: Sets the range over which fitting is performed. That is, the region within ±Search Range of the calculated diffraction-line position is taken as the fitting target for that peak.
  • Initial FWHM: Specifies the initial full width at half maximum of the profile function. It is used as the starting value for least-squares convergence.

Pressing Apply to all applies the current settings to all diffraction lines at once.

Peak function

Selects the peak function used for fitting.

Peak function Content
Simple Search Performs no function fitting; it recognizes the strongest point within ±Search Range of the calculated diffraction-line position as the peak position. Only the position is measured, so the FWHM, the intensity and the errors are NaN. A flat range is treated as not measured.
Symmetric Pseudo Voigt Fits with a left-right symmetric pseudo-Voigt function.
Symmetric Pearson VII Fits with a left-right symmetric Pearson VII function.
Split Pseudo Voigt Fits with a left-right asymmetric (split) pseudo-Voigt function.
Split Pearson VII Fits with a left-right asymmetric (split) Pearson VII function.

Recommended function

Unless there is a particular reason not to, Symmetric Pseudo Voigt is recommended because of its superior stability.

The pseudo-Voigt function is a linear combination of a Gaussian \(G(x)\) and a Lorentzian \(L(x)\) with mixing parameter \(\eta\), given by:

\[ \mathrm{pV}(x) = \eta\, L(x) + (1-\eta)\, G(x), \qquad 0 \le \eta \le 1 \]

where \(\eta\) is the fraction of the Lorentzian component. The split form represents an asymmetric profile by taking parameters such as the FWHM independently on the left and right of the peak position.

Pattern Decomposition

Pattern Decomposition

When the Search Range regions of two or more selected diffraction lines overlap, this option selects whether to perform pattern decomposition (simultaneous fitting of the overlapping peaks).

  • in each crystal: Performs pattern decomposition independently for each crystal.
  • between crystals: Performs pattern decomposition across all crystals.

Optimized cell constants

Optimized cell constants panel

Once enough independent indices are chosen for the least-squares calculation to become solvable, this panel displays the most-probable lattice constants \(a, b, c, \alpha, \beta, \gamma\) and the volume \(V\), each with its error (±).

About the NA display

When the number of fitted reflections equals the number of independent lattice constants, the residuals cannot provide standard errors, so NA is displayed in the error fields. When there are too few independent reflections to solve for the lattice constants, the program keeps the original cell shape and changes only its overall scale, and the errors are shown as NA. Choosing enough independent reflections allows the errors to be computed.

  • Apply to the crystal: Pushes the refined lattice constants back to the selected crystal in the main program. If the profile is processed after the fit (shift, background, etc.), it is fitted again automatically.
  • Copy to Clipboard: Copies the optimized lattice constants to the clipboard.

Remove fitted peaks

This subtracts the fitted peaks from the profile and outputs the residual profile as a new profile. Enter the destination name in New profile name and press Remove fitted peaks to perform the subtraction. It is useful for checking the background or the separation of overlapping peaks. On the logarithmic intensity axis, too, the peaks are fitted again to the linear intensity and then subtracted. If any of the peaks cannot be fitted, nothing is subtracted and a message is shown.

Pressing Send d-values to CellFinder && AtomicPositionFinder sends the d-values obtained from the fit of the checked reflections to Cell Finder. Open Cell Finder from the toolbar.

Cell Finder

Cell Finder

Cell Finder searches for candidate lattice constants that explain a set of measured peak positions (a list of d-values). It is used to index unknown samples.

Identifying an unknown sample

After determining the lattice constants with Cell Finder, register that crystal in the crystal list, and you can refine the lattice constants further with the least-squares fitting of this tool.