When faced with a complex baseline function and poorly-fitting diffraction intensities, it can be very difficult to bootstrap the fitting process. One can’t fit the intensities without a good background model, but the background will not refine properly as it is compensating for all the badly fit intensities. To address this, some decades back, I added an ability into EXPGUI to place points onto the pattern to guide where the background should go. At that time, my late friend Lachlan Cranswick referred to that feature as genius. I would say it was desperate inspiration. GSAS-II has the same capability, but I think it works even better. I would wish to hear Lachlan’s comments.
The basic idea here is that one uses the mouse to place points overlaying the diffraction pattern where you believe the baseline should be placed. This is done by selecting the Background entry in the data tree for a histogram and then using either the “Fixed Points”/Add menu command or pressing the “k” keyboard command, so select “Add” mode. At this point, fixed background points are added to the plot by clicking on the pattern where those points should be located. Each point will be shown as a red diamond. Note that these red diamonds are only shown when the Background data tree entry is selected and they are only used when this is selected.
There are two other modes for the fixed points that can be selected with either a menu command or pressing the “k” keyboard command: In “move” mode, the points can be dragged with the mouse and in “delete” mode, clicking on a background point will delete it. The plot shows the mode in the upper left.
Once there are enough points to allow fitting of the selected background parameters, one can either use the “Fixed Points”/“Fit background” menu command or the “Fit to fixed bkg” button on the window and the background parameters will be optimized to fit those background points. The number of terms and/or background fitting options can be selected to improve the fit. Frequently, it becomes clear that adding more points will help place the background where you would prefer. Note that I recommend using this method as a way to start fitting the background. It can be very helpful to use this process to define the initial location for the baseline curve and after a good starting place for fitting is determined to turn off refinement of the background parameters while working on fitting other aspects of of the model, such as reflection intensities and peak shapes. My recommendation is that in the final stages of the fit, one should refine the background parameters again, so that they are best-fit against the data.