|
|
|
Pour utiliser sur le web | Pour imprimer en haute résolution |
|---|---|
Télécharger PNG | Télécharger TIF |
Télécharger JPG | Télécharger EPS |
The Computing for Science (CS) group supports ILL scientists, students and visitors in a number of activities including data analysis, instrument simulation and sample simulation.

PkFitmac - exemple 1ContentsIntroductionThis example is typical how PkFit can be used to extract, from an energy scan, the energy (positions) and the lifetimes (intrinsic widths) of excitations (peaks), by taking into account the one-dimensional (1D) resolution-function of the instrument. The data set used here (file enscan.tas), is an energy scan which is part of a study of a magnetic compound. Three excitations are expected and the aim of the experiment was to determine the dispersion of these excitations, and thus several energy scans were performed at different Q positions. The header of the file enscan.tas contains all the sample and instrument parameters needed to calculate the resolution function by means of the Cooper-Nathans method. 1. Basic features1.1. Opening a data fileSelect "Open" from the menu "File" (keyboard shortcut command-O). Use the popup menu "Current file format" to select the file format"ILL TAS File". Navigate to the directory "Tutorial examples" select the file "enscan.tas" and click the button "Open". Note that a double-click on the file name is a shortcut to the last two actions. When the data file has been successfully read, PkFit opens a graphic window and displays the spectrum. The window is divided into three parts: the plot region (top left), the message region (bottom) and the parameter region (top right) of which the latter two are presently empty. Select item "Set resol. param." from the menu "ResCal" (keyboard shortcut command-Y) to check the settings of the sample, scan and instrument parameters. Click the OK button to exit from the dialogue. 1.2. Changing plot scalesSince, in this example, the incoherent signal (centered at 0 meV) is much stronger than the inelastic signal, the Y scale must be changed to make the inelastic peaks visible. Select the item "Plot scales" from the menu "Plot". As the edit-text "YMax " is automatically selected, simply type a new YMax value, e.g. 100. Then click the button OK. The graphic window is updated. 1.3. Initializing fit parametersThe model PkFit uses to fit TAS spectra is a linear background plus a series of peak functions. In addition this model may include the Bose factor, a kf or ki correction, an absorption correction and a convolution of the signal with a one-dimensional or four-dimensional resolution function. In the following we will start with the simplest model and then introduce some corrections and the 1D resolution function.
Because PkFit automatically sets: the starting background position to a flat background at the position of the lowest point (blue line by default), the peak widths by performing a preliminary fit on the widths alone, initializing the model is dead simple: set the number of peaks, locate the top of each peak, set the peak type.
Number of peaks
Although three excitations are expected, this energy scan seems to show only two excitations right to the strong incoherent peak at zero energy. Never mind, let us build a model with only three peaks and then let us fit it.
Select "Initialize" from the menu "Fit" (keyboard shortcut command-I). A dialogue box allows you to set the number of peaks (in the range 0 to 6) of the fit model. Select 3 from the Popup menu or type 3 in the edit text and then click the button OK. Setting the three peaks
PkFit is now ready to set the starting peak position(s) and height(s) interactively. When the arrow cursor (
As an exercise, we will initialize the peak parameters using both methods, i.e. using a mouse click and a keystroke.
Since the top of the incoherent peak (centered at zero energy) is not visible, click anywhere on the vertical line EN=0. The true height value will be set later on. PkFit displays a cross mark at the selected position and draws a horizontal line which indicates the starting peak width at half maximum. Then move the cursor successively to the top of the two inelastic peaks and type a "L" (case insensitive). The full widths at half maximum (FWHM) are (arbitrarily) initialized to one third of the plot width divided by the number of peaks. As soon as the three peaks have been defined, a preliminary fit on the widths alone is performed to better estimate the starting peak widths. Then a dialogue is automatically displayed, which allows you to change the peak types and the non-fitting peak-parameters. Note that this dialogue box can be opened at any time by means of the item "Set peak types" of the menu "Fit" (keyboard shortcut command-U). Peak Type
Of the three peaks of the "enscan.tas" data set, the left one is an incoherent peak while the others are magnon peaks. The physics tells us that the incoherent scattering is Q independent and can be modeled by a delta function in energy. The magnon excitations can be modeled by a Lorentzian shape in energy (or a damped harmonic oscillator) but the peaks will have different widths since the dispersion of the excitations induces a Q dependence of the excitation energy, i.e. a Q dependence of the peak center.
Now let us translate these model assumptions into PkFit options. In the "Non fitting peak parameters" dialogue, use the Popup menus of the column "Type" to set the incoherent peak shape to "Incoherent" and the magnon peak shapes to "Lorentzian".
Convoluting peak shapes with the instrument resolution
The observed peak shapes are generally substantially deformed due to the effect of the instrument resolution. This can be computed as a convolution of the expected profile with the resolution-function of the instrument. In the case of three-axis spectrometers, the latter is a four-dimensional Gaussian, with axes the energy and either the direct or reciprocal space axes.
The incoherent signal being Q independent, the four-dimensional convolution becomes one-dimensional (in energy) once the 4D resolution function has been integrated in Q. Furthermore, since the incoherent scattering can be modeled by a delta function in energy, it can be finally modeled by a 1D Gaussian with a width equal to the Q-integrated resolution width (GW).
For the magnon excitations, the convolution is theoretically a 4D one. However for excitations with flat or slightly dispersive dispersion, the Q-independent approximation can be made. In other words, we can model a magnon peak shape by a Lorentzian function convoluted with a 1D Gaussian resolution-function, the width of which is equal to the Q-integrated resolution width (GW).
These assumptions mean that three different resolution-widths (GW) must be computed since the peaks are at different energies. Thus, ask the program to compute the Gaussian resolution widths (GW) by checking the three "CalcGW" check box.
As soon as the first check box is clicked the dialogue "Instrument configuration" is shown which let you select the method to be used to compute the instrument resolution-function. This dialogue is displayed automatically only the first time a resolution calculation is requested but it can be accessed at any time via item "Activate resol. calc." of the menu "ResCal".
For the present test run, click the radio button "Cooper-Nathans method" and then click the button OK. We are back to the previous dialogue and the computed value of the GW parameter of the first peak is shown in the corresponding GW edit field.
Finally note that we will not check the check boxes "Equicenter" since the equivalent peaks at negative energies can be neglected due to the Bose factor.
The image below gives the aspect of the dialogue window once all the settings have been made. We can check that the values in the three edit texts "GW" do correspond to the Q-independent case. Click the button "Set dimensionality". A dialogue is shown which displays the GW status and allows you to set the type of the Q-dependence of the peak function. Since the three Popup menus are set to "Q independent" as expected, simply click the button OK.
We are back again to the "Non fitting peak parameters" dialogue. Click the button OK to exit the dialogue. The background line and the different peak(s) are drawn in the graphic window. Note that a message is written in the message region (bottom part) and that the fit-parameter list is shown in the parameter region (right part). For each peak, the first line (same color as the peak curve) gives the peak number plus the type and the dimension of the convolution into parenthesis.
Adjusting the incoherent peak height
The current initialization of the incoherent-peak parameters is not yet correct. As stated in section "Initializing fit parameters", since the top of the peak is out of the window frame, the interactive initialization process made it possible to set the peak location but not the peak height. Thus we will now adjust the height parameter manually.
Select item "Set fit parameters" from menu "Fit". A dialogue is shown. Set the height field of the incoherent peak to 3200, and click the button OK.
1.4. Fitting the modelSelect item "Fit" from the menu "Fit". The iterative minimization process is performed and the plot region now displays the fitted spectrum. The parameter region displays the final parameter values together with there e.s.d's in parentheses. The comment region shows the linear expression defining the background, the value of the refinement agreement-factor "CHIQSR" and the correction factors for three points (the axis extrema and center).
Note that when the word "fixed" is given instead of the e.s.d's of a fit-parameter this mean that the latter either was fixed by the user or that it depends on other fit parameters. Here this is the case for the width of the incoherent peak since it is equal to the resolution width calculated at the peak center. 2. More options2.1. Adding a new peakBecause the fit gives a width of the lower energy Lorentzian peak (here W2=.68 meV) much larger than the resolution width (GW=0.254 meV) and larger than the width of the second Lorentzian peak (W3=.49 meV) , we can suspect that the expected third excitation does exist. Thus, let us try adding a new peak centered around 1.3 meV with a height of 20 counts. Select the item "Add a new peak" from the menu "Fit" and initialize the new peak with the mouse as explained before. The dialogue "Set non-fitting parameters" is automatically displayed. Set the peak 4 type as the Lorentzian and check the boxe "CalcGW" as we did before for the first two excitations. Click the button OK. The window contents is updated accordingly. The model now includes the peak 4, but whose parameters are not yet fitted. Note that the e.s.d's on all fit parameters are no longer displayed since the model has been changed. Since the two peaks around 1 meV strongly overlap, adding a fit constraint on there widths is highly advisable to prevent fit divergency. 2.2. Adding constraints on fit parametersSelect the item "Set fit parameters" from the menu "Fit". A dialogue is displayed. Type "W2" in the width field of peak 4. Thus the fit will be performed keepingthe widths of peaks 2 and 4 (W2=W4) equal. Click the button OK and perform a new fit (item "Fit" from the menu "Fit"). The window contents display the new fitted curves and parameter values. Note that in the parameter part of the window, the mention "=W2" is written in place of the width value of peak 4. We have now fitted our energy scan using two models, one with two excitations, the second with three. The statistics are not sufficient to determine which one can be chosen. Indeed the refined parameter CHISQR changed only from 3.11 to 3.27. Therefore only extra information can help us making a decision. In this case the second model was chosen because of its coherence on the set of energy scans at different Q values. 2.3. Applying an absorption correctionBecause the "enscan.tas" data set comes from a highly absorbing sample, an absorption correction must be added to the model. Furthermore this correction will be applied on the sample contribution to the background which is called "sample background" in PkFit. Select the item "Absorption" from the menu "Options". A dialogue is displayed which allows for the initialization of the absorption parameters. The latter are the sample shape, the cross sections (in barns), the sample dimensions (in cm) and the relevant axes (in rlu). To help you check the given absorption parameters PkFit gives a graphical and numerical summary of the absorption-correction calculations. It draws the reciprocal lattice in the scattering plan. The latter are defined by the two axes (AX,AY,AZ) and (BX,BY,BZ) which can be set in the dialogue "Resolution parameters" (item "Set resol.param." from the menu "ResCal"). Perform again a fit (item "Fit" from the menu "Fit"). The graphic window displays the final results as shown bellow. 2.4. Saving a log fileEach time you have successfully processed a spectrum it is a good practice to save both the data and the results to a log file. The latter may be understood as an output file which can be used for subsequent post processing with other programs. For example, Kaleidagraph can be used to produce documents with publishing quality from these log files. Select the item "Save As..." from the menu "File" (shortcut command-S). A dialogue box allows you to select the window or the file to be saved. Select the "Log file" check box and click the button "Save". The log file is a plain text file to which PkFit saves: the log-file name and its creation date, the data-file contents in the ILL format (including the header), the model description and the values of the fit parameters, the type and the values of the applied corrections, the value of the refinement factor, the correction parameters, and the fit curves. 3. Reading the log file contents with Kaleidagraph |