Generic peak fitting

This module is used to fit individual or groups of peaks with generic functions.

Getting started

Peak fitting is usually only performed on a short range of the dataset that contains one or a few peaks. As a first step, this range must be defined.

Step 1: Defining the data range

  1. Activate the "Add a new fit range"mode by pressing the corresponding button.
  2. Zoom in on the graph until the range to fit fills a good portion of the screen.
  3. Double-click on the graph at the position where the range starts.
  4. Move the cursor to the position on the graph where the range ends. Double-click to set the end position. While dragging the mouse cursor, the range is indicated visually.
After setting the end position, the range select mode is deactivated automatically and a new range item is added to the functions list. By double-clicking the start and end items, the values can be entered numerically.

Step 2a: Adding functions automatically

The add-function wizard tries to add a new function at the most reasonable location:

  1. Select the range item to which the functions shall be added.
  2. Select the type of function to be added from the dropdown menu.
  3. Click the "Automatically add function" button (magic wand icon).
  4. Verify that the function was added correctly.

It is often recommended to first add a linear or quadratic function to fit the background, and then add one or several peak functions.

If the wizard doesn't recognize a peak correctly, zoom in on the peak and click the wizard button again. Since the wizard only searches for peaks in the visible range, zooming in on a peak often improves the detection. If the peak is still not recognized, proceed with adding the function manually.

Step 2b: Adding functions manually

If automatic function adding doesn't work as expected, functions can be added manually:

  1. Select the range item to which the functions shall be added.
  2. Select the type of function to be added from the dropdown menu.
  3. Activate the "Add a new function" mode by clicking on the corresponding button.
  4. Double-click on the graph to set the location of the first point. Depending on the type of function, the first point represents:
  5. Double-click on the graph again to set the location of the second point. Depending on the type of function, the first point represents:
  6. The peak selection mode remains active. Double-click again to start adding the next function. Change the type of function as needed.
  7. Disable the "Add a new function" mode by clicking the corresponding button.

Step 3: Fitting

Click the "fit" button at the bottom right of the module window.

Coupling parameters

By default, all function parameters are fitted independently. However, it may be recommended to couple certain parameters to reduce the total number of degrees of freedom and to stabilize the fit. For example, using only one shape parameter for all Pseudo-Voigt curves may be recommended. To couple parameters to a common variable, proceed as follows:

  1. Add functions as described above.
  2. Double-click on the "Variable" cell of the parameter that should be coupled.
  3. Select the same variable "$x-y-z" for all function parameters that should be tied to this variable.
  4. Run the curve fit.

Fixing / restricting variables

Variables can be fixed (excluded from the fitting) or restricted to a certain range.

To fix a variable, go to the tab "Variables" and uncheck the box in front of the variable name.

To restrict the range of a variable, go to the tab "Variables" and double click either on the lower or upper boundary of the variable. Enter a value for the lower or upper limit, or enter "-inf" or "+inf" to remove all restrictions.