The FitEditor2D is an interactive program used for viewing and editing 2D spectrum fits. One may call FitEditor2D with the variable ‘fit’, which is the output of the FitSpec program. Additionally one may optionally specify plotting parameters (‘plotpar’), as are described for the ‘quik_2Dplot’ program, and can optionally provide the ‘shapes0’ variable). Once called, FitEditor2D will open figures 20 and 21 (see attached files for examples).
Figure 20, displays the experimental spectrum, and the residual of the spectrum fit, as well as all controls of the FitEditor2D program. Figure 21 shows the calculated spectrum. All plots include a contour plot and a scatter plot of all points, and the ‘current’ point is indicated with an X. Note that for spectra with many peaks (~1000), the MATLAB scatter plot becomes inefficient and so this may be slow.
There are several controls in the FitEditor2D program, which we describe here. Also note that all three plots are interactive, and can be clicked on to select peaks, or to place new peaks.
Add Peaks: This button enters the peak addition mode. In the peak addition mode, each mouse click on any of the plots will add a new peak at that position, with the linewidth and intensity estimated by the program (can be user edited after addition). Click ‘Add Peaks’ again to exit peak addition mode.
Remove Peaks: This button will remove the currently selected peak.
Undo: This will undo the last user action (peak addition, removal, editing). Note that if several editing steps on one peak have been made subsequently, all will be undone. Also, undo in peak addition mode only works as long as one remains in this mode.
Recalculate: This will re-plot the spectra after editing. This does not happen automatically after editing because the MATLAB plotting is somewhat slow, so the user ideally can take several editing steps before recalculating.
Fit: This will fit the spectrum, using the PartialFit routine, where the FitEditor2D function will determine what range to refit. If the user wants to refit the full spectrum, the the ‘Full Fit’ check box should be selected. This may be necessary for heavily overlapped regions (use if fit gets worse when the partial fit is run). Settings for fitting use either default settings or settings controlled by the user via the ‘Fit Par’ entry field (see below).
Quit: This quits the FitEditor2D program. Upon exit, the program will output the current fit, either as a variable named ‘FE2D_fit’, or in a user specified name, which is entered in the ‘Output’ entry field. Also, this will clear the memory used by FitEditor2D.
I, delta1, delta2, lw1, lw2:
These fields give information about the currently selected peak (amplitude, position, and linewidth). The user may also enter information into the fields to edit the currently selected peak (spectrum will not update immediately, although marker will).
Plot Par: This field allows the user to update the plotting settings during use of the fit program (see quik_2Dplot for a description of plotting settings). One may generate and edit a ‘plotpar’ variable on the command line. One then should enter the variable name in this field to re-plot the spectra with new settings. It is also possible to generate the plotpar variable in the window, by constructing a structure with the ‘struct’ function.
Fit Par: This field allows the user to control the fitting settings of the FitSpec program. One may create a ‘par’ variable at the command line or using the ‘struct’ function in the window, and enter its name into this field.
Output: This field allows the user to create a variable that contains information on the current fit. Upon entering a name here, FitEditor2D will immediately output the current fit to a variable with the given name. Also, upon exit, the current fit will be written to the variable specified here. Therefore, if the user wants to store different fits, they should change the name here before program exit (otherwise it will overwrite the last fit).
int: Gives the peak integral. Only calculated after spectrum fitting, so that edited or newly added peaks will not have up-to-date integral values
index: Gives the number of the current peak index, so that the user may find/edit the peak in the ‘fit’ variable.
Full Fit: If this checkbox is selected, when using the ‘Fit’ button, the full spectrum will be refit, rather than performing only fits around recently edited peaks. This leads to better fitting but slower performance
Lock Axes: If this checkbox is selected, zooming in on one plot will cause the other two plots to also zoom in to have the same axes.