Skip to content
S.-H. Dan Shim edited this page Jul 30, 2022 · 8 revisions

Once you explain most of the peaks found in your diffraction pattern in JCPDS Twk then you are ready to conduct peak fitting. The function can be found in the PeakFit tab. The PeakFit tab consists of three sub tabs: Sections, Peaks, and Config.

A few tips:

  • I strongly recommend to divide a pattern into 4-5 different angular ranges and then fit them separately as sections. You do not want to have more than 10 peaks to fit simultaneously in one section for example. This will make the fitting extremely slow and sometimes inaccurate.
  • The unit-cell fitting menu in PeakPo allow you to collect peak fitting results from different sections and then use them together for unit-cell fitting. So it is completely fine to have peaks from different phases in a section. It is also fine to have peaks from a phase in multiples of sections. They will be all collected properly and fitting to single phases in PeakPo's unit-cell fitting menu.
  • Don't be afraid of excluding very weak peaks at noise level. They are going to make your unit-cell fitting worse.

Setup a fit section

It is challenging and slow to fit the entire angular range of a diffraction pattern in once. In PeakPo, I recommend to divide your diffraction pattern into 5-10 or even more sections and then conduct fitting individually.

It is normally good idea to include 1-5 lines per section. It is also important to make sure that peaks are sufficiently away from the edges of a section. The pattern below shows a good example.

To select a section, activate the zoom mode by clicking the magnifying lens shape icon in the matplotlib toolbar (top left). Then you can draw a red dashed rectangle for an angular range to fit. Then a zoom-in view of the selected area will appear as above.

Once you are happy with the section setup, you can go to the Peaks subtab in the PeakFit tab and then click the Set button. Now you can see the table area becomes pink, ready for peak position inputs.

Import starting peak positions from JCPDS Tweak

The next step is to input starting values for peak position. The real strength of PeakPo is to be able to use the tweak information for the starting values of peak fitting. Click the From jlist button, you will see many vertical dashed lines showing up and many new rows showing up in the pink table area. You may find that Miller indices and phase names are successfully populated in the table.

Sometimes you may have some extra lines from unknown phases. In this case, you may manually provide starting values for peak positions. Click the From mouse button. In the 1D pattern graph, click the positions of unidentified lines. When you left click you will see a dashed vertical line showing up in the graph. At the same time you will find a row added to the pink table area with hkl = 000. To remove a line, you do right click at the peak position.

Note that if your zoom button in the matplotlib toolbar is at pressed state (darkened), then the manual mouse input would not work. In this case, you have to click the zoom icon button once more to release the state to mouse input.

As shown below, some JCPDS predicted lines do not exist with sufficient intensity in your diffraction pattern, likely because they are weak lines. In this case, you can delete those lines by moving your mouse cursor near to those peaks and do right click.

Configure starting values and conditions for fitting

A weak line at 10.75 degrees in the figure above would be very difficult to fit because the optimization code would just try decrease residue wherever they exist. To prevent such behavior, the Config subtab in the PeakFit tab provides some controls for the peak fitting process.

In the Config sub tab, Center range defines angular range where peak position should exist from the starting value. For example, 0.3 means the peak position change will be limited to +/-0.3 degrees from the starting value during the peak fitting. If you have done very nice tweak, a smaller value for this would give you tight control. In general, 0.3 degree works fine.

In the Config sub tab, Initial FWHM defines initial values for peak widths. The default value is optimized for synchrotron data.

In the Config sub tab, Max FWHM defines maximum value of peak widths. This prevents a situation where peak fitting function tries to fit broad background features left after after background subtraction.

In the Config tab, you can also control order of polynomial background function. Note that this background is different from the background you define in the Bkgn tab. This function is normally to remove small background residue after subtracting background from the Bkgn function.

Another important feature in the Config tab is the Vary checkboxes. Each check box is assigned to a peak parameter, such as amplitude, center, FWHM, or n_L. You can fix some parameters during peak fitting if necessary. For unstable peak fitting, this provides a very powerful handle on the problem.

Conduct fitting and save the results

Now you are ready to perform fitting. You just have to go back to the Peaks subtab and click the Fit button.

After sometime (typically a few second), you will see red pattern appearing on top of white pattern. The red pattern is the calculated diffraction pattern after peak fitting. Now your pink area table shows the fit result.

If you are not happy with the fitting result, you may click the Fit button once more. If that does not fix your problem, then you may want to reconfigure the fitting setup (meaning that you go back a few steps back).

Once you are happy with the result, then click the Save button. Once you click the Save button, the pink area turns white and the table becomes empty. Now the fit information is moved and saved to the Sections tab. You can click the Sections tab and check the last row. That row should have your latest peak fitting result.

Now, if you click the disk-shaped Save icon in the PeakPo toolbar (top right), the table area becomes white, which means the information is now saved in the dpp file.

Some tips

It is normally good idea to check Cake image when you conduct peak fitting. You can check if some features in 1D pattern is indeed diffraction rings or diffraction dots in the cake pattern.

If you find that some features are not from diffraction, you must mask the feature for more accurate peak fitting. PeakPo provides some level of masking (see azimuthal integration). Or you can use Dioptas to do masking. In that case, don't forget to reintegrate to a chi file and read the new chi file in PeakPo.

Clone this wiki locally