Gaussian1D
From MantidProject
Contents |
Deprecation notice
Instead of using this algorithm to fit a Gaussian please use the Fit algorithm where the Function parameter of this algorithm is used to specified the fitting function, including selecting a Gaussian.
Summary
Takes a histogram in a 2D workspace and fit it to a Gaussian function (also called a normal distribution), i.e. to the function:
where
- BG0 - intercept of linear background
- BG1 - slope of linear background
- Height - height of peak
- PeakCentre - centre of peak
- Sigma - Gaussian width parameter
Note that the FWHM (Full Width Half Maximum) of a Gaussian equals
.
Note that version 2 (the default version) of the Gaussian algorithm is described here. Version 1 is the same except that it only has one background (BG0) parameter, which is a constant, flat background.
The figure below illustrate this symmetric peakshape function fitted to a TOF peak:
Properties
| Order | Name | Direction | Type | Default | Description |
|---|---|---|---|---|---|
| 1 | InputWorkspace | Input | Workspace | Mandatory | The name of the input Workspace |
| 2 | SpectrumIndex | Input | integer | 0 | The spectrum to fit, using the workspace numbering of the spectra (default 0) |
| 3 | StartX | Input | double | minus 6*sigma away from the peakCentre | X value to start fitting from |
| 4 | EndX | Input | double | plus 6*sigma away from the peakCentre | Last X value to include in fitting range |
| 5 | BG0 | InOut | double | 0.0 | Intercept of linear background |
| 6 | BG1 | InOut | double | 0.0 | Slope of linear background |
| 7 | Height | InOut | double | 0.0 | Height of peak |
| 8 | PeakCentre | InOut | double | 0.0 | Centre of peak |
| 9 | Sigma | InOut | double | 1.0 | Width parameter |
| 10 | Fix | Input | string | "" | List of comma separated names of fit parameters to be fixed |
| 11 | MaxIterations | Input | Integer | 500 | Max iterations |
| 12 | Output Status | Output | String | "" | Whether the fit was successful |
| 13 | Output Chi^2/DoF | Output | double | 0.0 | Returns the goodness of the fit |
Source Code
Header Gaussian1D.h
Source Gaussian1D.cpp

