Skip to content
Snippets Groups Projects
Unverified Commit cae87c9d authored by Martyn Gigg's avatar Martyn Gigg Committed by GitHub
Browse files

Merge pull request #22971 from mantidproject/22966_IndirectDataAnalysisDocs

Indirect - Data Analysis Interfaces - Documentation Update
parents 467291b0 602f874d
No related branches found
No related tags found
No related merge requests found
.. _ConvFitConcept:
Conv Fit
========
The measured data :math:`I(Q, \omega)` is proportional to the convolution of the
scattering law :math:`S(Q, \omega)` with the resolution function :math:`R(Q,
\omega)` of the spectrometer via :math:`I(Q, \omega) = S(Q, \omega) ⊗ R(Q,
\omega)`. The traditional method of analysis has been to fit the measured
:math:`I(Q, \omega)` with an appropriate set of functions related to the form of
:math:`S(Q, \omega)` predicted by theory.
* In quasielastic scattering the simplest form is when both the :math:`S(Q,
\omega)` and the :math:`R(Q, \omega)` have the form of a Lorentzian - a
situation which is almost correct for reactor based backscattering
spectrometers such as IN10 & IN16 at ILL. The convolution of two Lorentzians
is itself a Lorentzian so that the spectrum of the measured and resolution
data can both just be fitted with Lorentzians. The broadening of the sample
spectrum is then just the difference of the two widths.
* The next easiest case is when both :math:`S(Q, \omega)` and :math:`R(Q,
\omega)` have a simple functional form and the convolution is also a function
containing the parameters of the :math:`S(Q, \omega)` and R(Q, \omega) functions.
The convoluted function may then be fitted to the data to provide the
parameters. An example would be the case where the :math:`S(Q, \omega)` is a
Lorentzian and the :math:`R(Q, \omega)` is a Gaussian.
* For diffraction, the shape of the peak in time is a convolution of a Gaussian
with a decaying exponential and this function can be used to fit the Bragg
peaks.
* The final case is where :math:`R(Q, \omega)` does not have a simple function
form so that the measured data has to be convoluted numerically with the
:math:`S(Q, \omega)` function to provide an estimate of the sample scattering.
The result is least-squares fitted to the measured data to provide values for
the parameters in the :math:`S(Q, \omega)` function.
This latter form of peak fitting is provided by SWIFT. It employs a
least-squares algorithm which requires the derivatives of the fitting function
with respect to its parameters in order to be faster and more efficient than
those algorithms which calculate the derivatives numerically. To do this the
assumption is made that the derivative of a convolution is equal to the
convolution of the derivative-as the derivative and the convolution are
performed over different variables (function parameters and energy transfer
respectively) this should be correct. A flat background is subtracted from the
resolution data before the convolution is performed.
Four types of sample function are available for :math:`S(Q, \omega)`:
Quasielastic
This is the most common case and applies to both translational (diffusion) and
rotational modes, both of which have the form of a Lorentzian. The fitted
function is a set of Lorentzians centred at the origin in energy transfer.
Elastic
Comprising a central elastic peak together with a set of quasi-elastic
Lorentzians also centred at the origin. The elastic peak is taken to be the
un-broadened resolution function.
Shift
A central Lorentzian with pairs of energy shifted Lorentzians. This was
originally used for crystal field splitting data but more recently has been
applied to quantum tunnelling peaks. The fitting function assumes that the
peaks are symmetric about the origin in energy transfer both in position and
width. The widths of the central and side peaks may be different.
Polymer
A single quasi-elastic peak with 3 different forms of shape. The theory behind
this is described elsewhere [1,2]. Briefly, polymer theory predicts 3 forms
of the :math:`I(Q,t)` in the form of :math:`exp(-at2/b)` where :math:`b` can
be 2, 3 or 4. The Full Width Half-Maximum (FWHM) then has a Q-dependence
(power law) of the form :math:`Qb`. The :math:`I(Q,t)` has been numerically
Fourier transformed into :math:`I(Q, \omega)` and the :math:`I(Q, \omega)`
have been fitted with functions of the form of a modified Lorentzian. These
latter functions are used in the energy fitting procedures.
References:
1. J S Higgins, R E Ghosh, W S Howells & G Allen, `JCS Faraday II 73 40 (1977) <http://dx.doi.org/10.1039/F29777300040>`_
2. J S Higgins, G Allen, R E Ghosh, W S Howells & B Farnoux, `Chem Phys Lett 49 197 (1977) <http://dx.doi.org/10.1016/0009-2614(77)80569-1>`_
.. categories:: Concepts
...@@ -7,20 +7,22 @@ Indirect Data Analysis ...@@ -7,20 +7,22 @@ Indirect Data Analysis
Overview Overview
-------- --------
.. interface:: Data Analysis
:align: right
:width: 350
The Indirect Data Analysis interface is a collection of tools within MantidPlot The Indirect Data Analysis interface is a collection of tools within MantidPlot
for analysing reduced data from indirect geometry spectrometers, such as IRIS and for analysing reduced data from indirect geometry spectrometers, such as IRIS and
OSIRIS. OSIRIS.
.. interface:: Data Analysis
:width: 450
The majority of the functions used within this interface can be used with both The majority of the functions used within this interface can be used with both
reduced files (*_red.nxs*) and workspaces (*_red*) created using the Indirect Data reduced files (*_red.nxs*) and workspaces (*_red*) created using the Indirect Data
Reduction interface or using :math:`S(Q, \omega)` files (*_sqw.nxs*) and Reduction interface or using :math:`S(Q, \omega)` files (*_sqw.nxs*) and
workspaces (*_sqw*) created using either the Indirect Data Reduction interface or workspaces (*_sqw*) created using either the Indirect Data Reduction interface or
taken from a bespoke algorithm or auto reduction. taken from a bespoke algorithm or auto reduction.
Four of the available tabs are QENS fitting interfaces and share common features and layout. These common factors are documented in the :ref:`qens-fitting-features` section of this document.
These interfaces do not support GroupWorkspace as input. These interfaces do not support GroupWorkspace as input.
Action Buttons Action Buttons
...@@ -39,43 +41,13 @@ Manage Directories ...@@ -39,43 +41,13 @@ Manage Directories
Opens the Manage Directories dialog allowing you to change your search directories Opens the Manage Directories dialog allowing you to change your search directories
and default save directory and enable/disable data archive search. and default save directory and enable/disable data archive search.
Bayesian Plot Current Preview
-------- Takes the data currently plotted in the preview plot and puts it in a separate external plot
There is the option to perform Bayesian data analysis on the I(Q, t) Fit ConvFit
tabs on this interface by using the :ref:`FABADA` fitting minimizer, however in
order to to use this you will need to use better starting parameters than the
defaults provided by the interface.
You may also experience issues where the starting parameters may give a reliable
fit on one spectra but not others, in this case the best option is to reduce
the number of spectra that are fitted in one operation.
In both I(Q, t) Fit and ConvFit the following options are available when fitting
using FABADA:
Output Chain
Select to enable output of the FABADA chain when using FABADA as the fitting
minimizer.
Chain Length
Number of further steps carried out by fitting algorithm once parameters have
converged (see *ChainLength* is :ref:`FABADA` documentation)
Convergence Criteria
The minimum variation in the cost function before the parameters are
considered to have converged (see *ConvergenceCriteria* in :ref:`FABADA`
documentation)
Acceptance Rate
The desired percentage acceptance of new parameters (see *JumpAcceptanceRate*
in :ref:`FABADA` documentation)
Elwin Elwin
----- -----
.. interface:: Data Analysis
:widget: tabElwin
Provides an interface for the :ref:`ElasticWindow <algm-ElasticWindow>` Provides an interface for the :ref:`ElasticWindow <algm-ElasticWindow>`
algorithm, with the option of selecting the range to integrate over as well as algorithm, with the option of selecting the range to integrate over as well as
...@@ -86,6 +58,10 @@ Mantid data search paths that contains the sample environment information the ...@@ -86,6 +58,10 @@ Mantid data search paths that contains the sample environment information the
ELF workspace can also be normalised to the lowest temperature run in the range ELF workspace can also be normalised to the lowest temperature run in the range
of input files. of input files.
.. interface:: Data Analysis
:width: 450
:widget: tabElwin
Options Options
~~~~~~~ ~~~~~~~
...@@ -123,17 +99,15 @@ Plot Result ...@@ -123,17 +99,15 @@ Plot Result
Save Result Save Result
If enabled the result will be saved as a NeXus file in the default save If enabled the result will be saved as a NeXus file in the default save
directory. directory.
MSD Fit MSD Fit
------- -------
.. interface:: Data Analysis Given either a saved NeXus file or workspace generated using the Elwin tab, this
:widget: tabMSD tab fits :math:`log(intensity)` vs. :math:`Q` with a straight line for each
Given either a saved NeXus file or workspace generated using the ElWin tab, this
tab fits :math:`log(intensity)` vs. :math:`Q^{2}` with a straight line for each
run specified to give the Mean Square Displacement (MSD). It then plots the MSD run specified to give the Mean Square Displacement (MSD). It then plots the MSD
as function of run number. as function of run number. This is done by means of the
:ref:`QENSFitSequential <algm-QENSFitSequential>` algorithm.
MSDFit searches for the log files named <runnumber>_sample.txt in your chosen MSDFit searches for the log files named <runnumber>_sample.txt in your chosen
raw file directory (the name ‘sample’ is for OSIRIS). If they exist the raw file directory (the name ‘sample’ is for OSIRIS). If they exist the
...@@ -142,46 +116,39 @@ exist the MSD is plotted versus run number (last 3 digits). ...@@ -142,46 +116,39 @@ exist the MSD is plotted versus run number (last 3 digits).
The fitted parameters for all runs are in _msd_Table and the <u2> in _msd. To The fitted parameters for all runs are in _msd_Table and the <u2> in _msd. To
run the Sequential fit a workspace named <inst><first-run>_to_<last-run>_lnI is run the Sequential fit a workspace named <inst><first-run>_to_<last-run>_lnI is
created of :math:`ln(I)` v. :math:`Q^{2}` for all runs. A contour or 3D plot of created of :math:`ln(I)` v. :math:`Q` for all runs. A contour or 3D plot of
this may be of interest. this may be of interest.
A sequential fit is run by clicking the Run button at the bottom of the tab, a A sequential fit is run by clicking the Run button at the bottom of the tab, a
single fit can be done using the Fit Single Spectrum button underneath the single fit can be done using the Fit Single Spectrum button underneath the
preview plot. preview plot.
.. interface:: Data Analysis
:width: 450
:widget: tabMSD
Options Options
~~~~~~~ ~~~~~~~
Input File .. seealso:: Common options are detailled in the :ref:`qens-fitting-features` section.
A file that has been created using the Elwin tab with an :math:`x` axis of
:math:`Q^2`.
StartX & EndX
The :math:`x` range to perform fitting over.
Plot Spectrum
The spectrum shown in the preview plot and will be fitted by running Fit
Single Spectrum.
Spectra Range .. seealso:: Sequential fitting is available, options are detailed in the :ref:`sequential-fitting-section` section.
The spectra range over which to perform sequential fitting.
Plot Result Sample
If enabled will plot the result as a spectra plot. A file that has been created using the Elwin tab with an :math:`x` axis of
:math:`Q`. Alternatively, a workspace may be provided.
Save Result
If enabled the result will be saved as a NeXus file in the default save
directory.
I(Q, t) I(Q, t)
------- -------
.. interface:: Data Analysis
:widget: tabIqt
Given sample and resolution inputs, carries out a fit as per the theory detailed Given sample and resolution inputs, carries out a fit as per the theory detailed
in the :ref:`TransformToIqt <algm-TransformToIqt>` algorithm. in the :ref:`TransformToIqt <algm-TransformToIqt>` algorithm.
.. interface:: Data Analysis
:width: 450
:widget: tabIqt
Options Options
~~~~~~~ ~~~~~~~
...@@ -197,7 +164,7 @@ ELow, EHigh ...@@ -197,7 +164,7 @@ ELow, EHigh
The rebiinning range. The rebiinning range.
SampleBinning SampleBinning
The ratio at which to decrease the number of bins by through merging of The ratio at which to decrease the number of bins by merging of
intensities from neighbouring bins. intensities from neighbouring bins.
Plot Result Plot Result
...@@ -206,14 +173,18 @@ Plot Result ...@@ -206,14 +173,18 @@ Plot Result
Save Result Save Result
If enabled the result will be saved as a NeXus file in the default save If enabled the result will be saved as a NeXus file in the default save
directory. directory.
Tiled Plot
Produces a tiled plot of the output workspaces generated.
Binning Monte Carlo Error Calculation - Number Of Iterations
~~~~~~~ The number of iterations to perform in the Monte Carlo routine for error
calculation in I(Q,t)
As a bin width that is a factor of the binning range is required for this A note on Binning
analysis the bin width is calculated automatically based on the binning range ~~~~~~~~~~~~~~~~~
and the number of desired bins in the output which is in turn calculated by
reducing the number of sample bins by a given factor. The bin width is determined by the binning range and the sample binning factor. The number of bins is automatically calculated based on the **SampleBinning** specified. The width is the determined by the width of the range divided by the number of bins.
The calculated binning parameters are displayed alongside the binning options: The calculated binning parameters are displayed alongside the binning options:
...@@ -230,111 +201,302 @@ ResolutionBins ...@@ -230,111 +201,302 @@ ResolutionBins
I(Q, t) Fit I(Q, t) Fit
----------- -----------
.. interface:: Data Analysis
:widget: tabIqtFit
I(Q, t) Fit provides a simplified interface for controlling various fitting I(Q, t) Fit provides a simplified interface for controlling various fitting
functions (see the :ref:`Fit <algm-Fit>` algorithm for more info). The functions functions (see the :ref:`Fit <algm-Fit>` algorithm for more info). The functions
are also available via the fit wizard. are also available via the fit wizard.
.. interface:: Data Analysis
:width: 450
:widget: tabIqtFit
Options
~~~~~~~
.. seealso:: Common options are detailled in the :ref:`qens-fitting-features` section.
.. seealso:: Sequential fitting is available, options are detailed in the :ref:`sequential-fitting-section` section.
Sample
Either a file (*_iqt.nxs*) or workspace (*_iqt*) that has been created using
the Iqt tab.
Constrain Intensities
Check to ensure that the sum of the background and intensities is always equal
to 1.
Make Beta Global
Check to use a multi-domain fitting function with the value of beta
constrained - the :ref:`IqtFitSimultaneous <algm-IqtFitSimultaneous>` will be
used to perform this fit.
Extract Members
If checked, each individual member of the fit (e.g. exponential functions), will
be extracted.
Linear Background
Adds a linear background to the composite fit function.
Conv Fit
--------
ConvFit provides a simplified interface for controlling
various fitting functions (see the :ref:`Fit <algm-Fit>` algorithm for more
info). The functions are also available via the fit wizard.
Additionally, in the bottom-right of the interface there are options for doing a Additionally, in the bottom-right of the interface there are options for doing a
sequential fit. This is where the program loops through each spectrum in the sequential fit. This is where the program loops through each spectrum in the
input workspace, using the fitted values from the previous spectrum as input input workspace, using the fitted values from the previous spectrum as input
values for fitting the next. This is done by means of the values for fitting the next. This is done by means of the
:ref:`PlotPeakByLogValue <algm-PlotPeakByLogValue>` algorithm. :ref:`ConvolutionFitSequential <algm-ConvolutionFitSequential>` algorithm.
A sequential fit is run by clicking the Run button at the bottom of the tab, a A sequential fit is run by clicking the Run button at the bottom of the tab, a
single fit can be done using the Fit Single Spectrum button underneath the single fit can be done using the Fit Single Spectrum button underneath the
preview plot. preview plot.
.. interface:: Data Analysis
:width: 450
:widget: tabConvFit
Options Options
~~~~~~~ ~~~~~~~
Input .. seealso:: Common options are detailed in the :ref:`qens-fitting-features` section.
Either a file (*_iqt.nxs*) or workspace (*_iqt*) that has been created using
the Fury tab.
Fit Type .. seealso:: Sequential fitting is available, options are detailed in the :ref:`sequential-fitting-section` section.
The type of fitting to perform.
Constrain Intensities Sample
Check to ensure that the sum of the background and intensities is always equal Either a reduced file (*_red.nxs*) or workspace (*_red*) or an :math:`S(Q,
to 1. \omega)` file (*_sqw.nxs*) or workspace (*_sqw*).
Constrain Beta over all Q Resolution
Check to use a multi-domain fitting function with the value of beta Either a resolution file (_res.nxs) or workspace (_res) or an :math:`S(Q,
constrained. \omega)` file (*_sqw.nxs*) or workspace (*_sqw*).
Use Delta Function
Found under 'Custom Function Groups'. Enables use of a delta function.
Extract Members
If checked, each individual member of the fit (e.g. exponential functions), will
be extracted into a <result_name>_Members group workspace.
Use Temperature Correction
Adds the custom user function for temperature correction to the fit function.
Background Options
Flat Background: Adds a flat background to the composite fit function. Linear Background: Adds a linear background to the composite fit function.
Theory
~~~~~~
For more on the theory of Conv Fit see the :ref:`ConvFitConcept` concept page.
F(Q) Fit
--------
One of the models used to interpret diffusion is that of jump diffusion in which
it is assumed that an atom remains at a given site for a time :math:`\tau`; and
then moves rapidly, that is, in a time negligible compared to :math:`\tau`.
This interface can be used for a jump diffusion fit as well as fitting across
EISF. This is done by means of the
:ref:`QENSFitSequential <algm-QENSFitSequential>` algorithm.
.. interface:: Data Analysis
:width: 450
:widget: tabJumpFit
Options
~~~~~~~
.. seealso:: Common options are detailled in the :ref:`qens-fitting-features` section.
-Sample
- A sample workspace created with either ConvFit or Quasi.
-
-Fit Parameter
- Either 'Width' or 'EISF' can be selected here, determining whether a width or
- EISF parameter will be fit across.
-
-Width/EISF
- Next to the 'Fit Parameter' menu, will be either a 'Width' or 'EISF' menu, depending on
- which was selected. This menu can be used to select the specific width/EISF parameter to be fit.
.. _qens-fitting-features:
QENS Fitting Interfaces Features
--------------------------------
There are four QENS fitting interfaces:
* MSD Fit
* I(Q,t) Fit,
* Conv Fit
* F(Q)
These fitting interfaces share common features, with a few unique options in each.
Single & Multiple Input
~~~~~~~~~~~~~~~~~~~~~~~
Each interface provides the option to choose between selecting one or multiple data files to be fit.
The selected mode can be changed by clicking either the 'Single Input' tab or 'Multiple Input' tab at the the top
of the interface to switch between selecting one or multiple data files respectively.
Data may either be provided as a file, or selected from workspaces which have already been loaded.
When selecting 'Multiple Input', a table along with two buttons 'Add Workspace' and 'Remove' will be displayed.
Clicking 'Add Workspace' will allow you to add a new data-set to be fit (this will bring up a menu allowing you
to select a file/workspace and the spectra to load). Once data has been loaded, it will be displayed in the table.
Highlighting data in the table and selecting 'Remove' will allow you to remove data from the fit. Above the preview
plots will be a drop-down menu with which you can select the active data-set, which will be shown in the plots.
Custom Function Groups
~~~~~~~~~~~~~~~~~~~~~~
Under 'Custom Function Groups', you will find utility options for quick selection of common fit functions, specific
to each fitting interface.
The 'Fit Type' drop-down menu will be available here in each of the QENS fitting interfaces -- which is useful for
selecting common fit functions but not mandatory.
Fitting Range
~~~~~~~~~~~~~
Under 'Fitting Range', you may select the start and end :math:`x`-values ('StartX' and 'EndX') to be used in the fit.
Plot Guess Functions
When checked a curve will be created on the plot window based on the bitting ~~~~~~~~~
parameters.
Under 'Functions', you can view the selected model and associated parameters as well as make modifications.
Right-clicking on 'Functions' and selecting 'Add Function' will allow you to add any function from Mantid's library
of fitting functions. It is also possible to right-click on a composite function and select 'Add Function' to add a
function to the composite.
Parameters may be tied by right-clicking on a parameter and selecting either 'Tie > To Function' when creating a tie
to a parameter of the same name in a different function or by selecting 'Tie > Custom Tie' to tie to parameters of
different names and for providing mathematical expressions. Parameters can be constrained by right-clicking and
using the available options under 'Constrain'.
Upon performing a fit, the parameter values will be updated here to display the result of the fit for the selected
spectrum.
Settings
~~~~~~~~
Minimizer
The minimizer which will be used in the fit (defaults to Levenberg-Marquadt).
Ignore invalid data
Whether to ignore invalid (infinity/NaN) values when performing the fit.
Cost function
The cost function to be used in the fit (defaults to Least Squares).
Max Iterations Max Iterations
The maximum number of iterations that can be carried out by the fitting The maximum number of iterations used to perform the fit of each spectrum.
algorithm (automatically increased when FABADA is enabled).
StartX & EndX Preview Plots
The range of :math:`x` over which the fitting will be applied (blue lines on ~~~~~~~~~~~~~
preview plot).
Use FABADA Two preview plots are included in each of the fitting interfaces. The top preview plot displays the sample, guess
Select to enable use of the :ref:`FABADA` minimizer when performing the fit. and fit curves. The bottom preview plot displays the difference curve.
Linear Background A0 The preview plots will display the curves for the selected spectrum ('Plot Spectrum') of the selected data-set
The constant amplitude of the background (horizontal green line on the preview (when in multiple input mode, a drop-down menu will be available above the plots to select the active data-set).
plot).
Fitting Parameters The 'Plot Spectrum' option can be used to select the active/displayed spectrum.
Depending on the Fit Type the parameters shown for each of the fit functions
will differ, for more information refer to the documentation pages for the fit
function in question.
Plot Spectrum A button labelled 'Fit Single Spectrum' is found under the preview plots and can be used to perform a fit of the
The spectrum shown in the preview plot and will be fitted by running Fit selected specturm.
Single Spectrum.
Spectra Range 'Plot Current Preview' can be used to plot the sample, fit and difference curves of the selected spectrum in
The spectra range over which to perform sequential fitting. a separate plotting window.
Plot Output The 'Plot Guess' check-box can be used to enable/disable the guess curve in the top preview plot.
Allows plotting spectra plots of fitting parameters, the options available
will depend on the type of fit chosen.
Save Result
If enabled the result will be saved as a NeXus file in the default save
directory.
Conv Fit Output
-------- ~~~~~~
.. interface:: Data Analysis The results of the fit may be plot and saved under the 'Output' section of the fitting interfaces.
:widget: tabConvFit
Similarly to FuryFit, ConvFit provides a simplified interface for controlling Next to the 'Plot Output' label, you can select a parameter to plot and then click 'Plot' to plot it across the
various fitting functions (see the :ref:`Fit <algm-Fit>` algorithm for more fit spectra (if multiple data-sets have been used, a separate plot will be produced for each data-set).
info). The functions are also available via the fit wizard.
Additionally, in the bottom-right of the interface there are options for doing a Clicking the 'Save Result' button will save the result of the fit to your default save location.
Bayesian (FABADA minimizer)
---------------------------
There is the option to perform Bayesian data analysis on the I(Q, t) Fit ConvFit
tabs on this interface by using the :ref:`FABADA` fitting minimizer, however in
order to to use this you will need to use better starting parameters than the
defaults provided by the interface.
You may also experience issues where the starting parameters may give a reliable
fit on one spectra but not others, in this case the best option is to reduce
the number of spectra that are fitted in one operation.
In both I(Q, t) Fit and ConvFit the following options are available when fitting
using FABADA:
Output Chain
Select to enable output of the FABADA chain when using FABADA as the fitting
minimizer.
Chain Length
Number of further steps carried out by fitting algorithm once parameters have
converged (see *ChainLength* is :ref:`FABADA` documentation)
Convergence Criteria
The minimum variation in the cost function before the parameters are
considered to have converged (see *ConvergenceCriteria* in :ref:`FABADA`
documentation)
Acceptance Rate
The desired percentage acceptance of new parameters (see *JumpAcceptanceRate*
in :ref:`FABADA` documentation)
.. _sequential-fitting-section:
Sequential Fitting
------------------
Three of the fitting interfaces allow sequential fitting of several spectra:
* MSD Fit
* I(Q, T) Fit
* ConvFit
At the bottom of the interface there are options for doing a
sequential fit. This is where the program loops through each spectrum in the sequential fit. This is where the program loops through each spectrum in the
input workspace, using the fitted values from the previous spectrum as input input workspace, using the fitted values from the previous spectrum as input
values for fitting the next. This is done by means of the values for fitting the next. This is done by means of the
:ref:`PlotPeakByLogValue <algm-PlotPeakByLogValue>` algorithm. :ref:`IqtFitSequential <algm-IqtFitSequential>` algorithm.
A sequential fit is run by clicking the Run button at the bottom of the tab, a A sequential fit is run by clicking the Run button at the bottom of the tab, a
single fit can be done using the Fit Single Spectrum button underneath the single fit can be done using the Fit Single Spectrum button underneath the
preview plot. preview plot.
The 'ExtractMembers' property, found represented as a checkbox in the properties Spectrum Selection
table of the ConvFit interface, can be used to extract the members of a fit, each ~~~~~~~~~~~~~~~~~~
into their own workspace, which are subsequently grouped in a GroupWorkspace. Members
of a fit include the sample, calculated fit, difference, and any peak functions used Below the preview plots, the spectra to be fit can be selected. The 'Fit Spectra' drop-down menu allows for
in the convolution fit such as Lorenztian or Delta functions. selecting either 'Range' or 'String'. If 'Range' is selected, you are able to select a range of spectra to fit by
providing the upper and lower bounds. If 'String' is selected you can provide the spectra to fit in a text form.
When selecting spectra using text, you can use '-' to identify a range and ',' to separate each spectrum/range.
:math:`X`-Ranges may be excluded from the fit by selecting a spectrum next to the 'Mask Bins of Spectrum' label and
then providing a comma-separated list of pairs, where each pair designates a range to exclude from the fit.
Fitting Model ConvFit fitting model
~~~~~~~~~~~~~ ---------------------
The model used to perform fitting is described in the following tree, note that The model used to perform fitting in ConvFit is described in the following tree, note that
everything under the Model section is optional and determined by the *Fit Type* everything under the Model section is optional and determined by the *Fit Type*
and *Use Delta Function* options in the interface. and *Use Delta Function* options in the interface.
...@@ -396,190 +558,7 @@ The Temperature Correction is a :ref:`UserFunction <func-UserFunction>` with the ...@@ -396,190 +558,7 @@ The Temperature Correction is a :ref:`UserFunction <func-UserFunction>` with the
formula :math:`((x * 11.606) / T) / (1 - exp(-((x * 11.606) / T)))` where formula :math:`((x * 11.606) / T) / (1 - exp(-((x * 11.606) / T)))` where
:math:`T` is the temperature in Kelvin. :math:`T` is the temperature in Kelvin.
Options
~~~~~~~
Sample
Either a reduced file (*_red.nxs*) or workspace (*_red*) or an :math:`S(Q,
\omega)` file (*_sqw.nxs*) or workspace (*_sqw*).
Resolution
Either a resolution file (_res.nxs) or workspace (_res) or an :math:`S(Q,
\omega)` file (*_sqw.nxs*) or workspace (*_sqw*).
Fit Type
The type of fitting to perform.
Background
Select the background type, see options below.
Plot Guess
When checked a curve will be created on the plot window based on the bitting
parameters.
Max Iterations
The maximum number of iterations that can be carried out by the fitting
algorithm (automatically increased when FABADA is enabled).
StartX & EndX
The range of :math:`x` over which the fitting will be applied (blue lines on
preview plot).
Use FABADA
Select to enable use of the :ref:`FABADA` minimizer when performing the fit.
A0 & A1 (background)
The A0 and A1 parameters as they appear in the LinearBackground fir function,
depending on the Fit Type selected A1 may not be shown.
Delta Function
Enables use of a delta function.
Fitting Parameters
Depending on the Fit Type the parameters shown for each of the fit functions
will differ, for more information refer to the documentation pages for the fit
function in question.
Plot Spectrum
The spectrum shown in the preview plot and will be fitted by running Fit
Single Spectrum.
Spectra Range
The spectra range over which to perform sequential fitting.
Plot Output
Allows plotting spectra plots of fitting parameters, the options available
will depend on the type of fit chosen.
Save Result
If enabled the result will be saved as a NeXus file in the default save
directory.
Background Options
~~~~~~~~~~~~~~~~~~
Fixed Flat
The A0 parameter is applied to all points in the data.
Fit Flat
Similar to Fixed Flat, however the A0 parameter is treated as an initial guess
and will be included as a parameter to the LinearBackground fit function with
the coefficient of the linear term fixed to 0.
Fit Linear
The A0 and A1 parameters are used as parameters to the LinearBackground fit
function and the best possible fit will be used as the background.
Theory
~~~~~~
The measured data :math:`I(Q, \omega)` is proportional to the convolution of the
scattering law :math:`S(Q, \omega)` with the resolution function :math:`R(Q,
\omega)` of the spectrometer via :math:`I(Q, \omega) = S(Q, \omega) ⊗ R(Q,
\omega)`. The traditional method of analysis has been to fit the measured
:math:`I(Q, \omega)` with an appropriate set of functions related to the form of
:math:`S(Q, \omega)` predicted by theory.
* In quasielastic scattering the simplest form is when both the :math:`S(Q,
\omega)` and the :math:`R(Q, \omega)` have the form of a Lorentzian - a
situation which is almost correct for reactor based backscattering
spectrometers such as IN10 & IN16 at ILL. The convolution of two Lorentzians
is itself a Lorentzian so that the spectrum of the measured and resolution
data can both just be fitted with Lorentzians. The broadening of the sample
spectrum is then just the difference of the two widths.
* The next easiest case is when both :math:`S(Q, \omega)` and :math:`R(Q,
\omega)` have a simple functional form and the convolution is also a function
containing the parameters of the :math:`S(Q, \omega)` and R(Q, \omega) functions.
The convoluted function may then be fitted to the data to provide the
parameters. An example would be the case where the :math:`S(Q, \omega)` is a
Lorentzian and the :math:`R(Q, \omega)` is a Gaussian.
* For diffraction, the shape of the peak in time is a convolution of a Gaussian
with a decaying exponential and this function can be used to fit the Bragg
peaks.
* The final case is where :math:`R(Q, \omega)` does not have a simple function
form so that the measured data has to be convoluted numerically with the
:math:`S(Q, \omega)` function to provide an estimate of the sample scattering.
The result is least-squares fitted to the measured data to provide values for
the parameters in the :math:`S(Q, \omega)` function.
This latter form of peak fitting is provided by SWIFT. It employs a
least-squares algorithm which requires the derivatives of the fitting function
with respect to its parameters in order to be faster and more efficient than
those algorithms which calculate the derivatives numerically. To do this the
assumption is made that the derivative of a convolution is equal to the
convolution of the derivative-as the derivative and the convolution are
performed over different variables (function parameters and energy transfer
respectively) this should be correct. A flat background is subtracted from the
resolution data before the convolution is performed.
Four types of sample function are available for :math:`S(Q, \omega)`:
Quasielastic
This is the most common case and applies to both translational (diffusion) and
rotational modes, both of which have the form of a Lorentzian. The fitted
function is a set of Lorentzians centred at the origin in energy transfer.
Elastic
Comprising a central elastic peak together with a set of quasi-elastic
Lorentzians also centred at the origin. The elastic peak is taken to be the
un-broadened resolution function.
Shift
A central Lorentzian with pairs of energy shifted Lorentzians. This was
originally used for crystal field splitting data but more recently has been
applied to quantum tunnelling peaks. The fitting function assumes that the
peaks are symmetric about the origin in energy transfer both in position and
width. The widths of the central and side peaks may be different.
Polymer
A single quasi-elastic peak with 3 different forms of shape. The theory behind
this is described elsewhere [1,2]. Briefly, polymer theory predicts 3 forms
of the :math:`I(Q,t)` in the form of :math:`exp(-at2/b)` where :math:`b` can
be 2, 3 or 4. The Full Width Half-Maximum (FWHM) then has a Q-dependence
(power law) of the form :math:`Qb`. The :math:`I(Q,t)` has been numerically
Fourier transformed into :math:`I(Q, \omega)` and the :math:`I(Q, \omega)`
have been fitted with functions of the form of a modified Lorentzian. These
latter functions are used in the energy fitting procedures.
References:
1. J S Higgins, R E Ghosh, W S Howells & G Allen, `JCS Faraday II 73 40 (1977) <http://dx.doi.org/10.1039/F29777300040>`_
2. J S Higgins, G Allen, R E Ghosh, W S Howells & B Farnoux, `Chem Phys Lett 49 197 (1977) <http://dx.doi.org/10.1016/0009-2614(77)80569-1>`_
JumpFit
-------
.. interface:: Data Analysis
:widget: tabJumpFit
One of the models used to interpret diffusion is that of jump diffusion in which
it is assumed that an atom remains at a given site for a time :math:`\tau`; and
then moves rapidly, that is, in a time negligible compared to :math:`\tau`;
hence ‘jump’.
Options
~~~~~~~
Sample
A sample workspace created with either ConvFit or Quasi.
Fit Funcion
Selects the model to be used for fitting.
Width
Spectrum in the sample workspace to fit.
QMin & QMax
The Q range to perform fitting within.
Fitting Parameters
Provides the option to change the defautl fitting parameters passed to the
chosen function.
Plot Result
Plots the result workspaces.
Save Result
Saves the result in the default save directory.
.. categories:: Interfaces Indirect .. categories:: Interfaces Indirect
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment