Table of Contents
Name | Direction | Type | Default | Description |
---|---|---|---|---|
Function | InOut | Function | Mandatory | Fitting function containing peaks. Must have a covariance matrix attached. |
OutputWorkspace | Output | TableWorkspace | Mandatory | The name of the TableWorkspace with the output values and errors. |
This algorithm takes a function after it has been optimized by the Fit algorithm and calculates peak parameter and associated errors for all peaks in this function. The peak parameters are its centre, height, FWHM and intensity. The output workspace is a table with three columns: parameter name, parameter value and parameter error.
(At the moment the algorithm works properly if run from C++ only.):
import numpy as np
# Create a data set
x = np.linspace(-10,10,100)
y = 10 * 2.0 / (2.0**2 + (x+4)**2 ) + 10 * 3.0 / (3.0**2 + (x-3)**2 ) + 3.0
e = np.ones_like(x)
ws = CreateWorkspace(x,y,e)
# Define a fitting function.
fun = "name=Lorentzian,Amplitude=10,PeakCentre=-4,FWHM=2;"+\
"name=Lorentzian,Amplitude=10,PeakCentre=3,FWHM=3;"+\
"name=FlatBackground,A0=3"
# Fit the function.
Fit(fun,ws)
# Calculate peak parameter error estimates for the two Lorentzians.
params = EstimatePeakErrors(fun)
Categories: Algorithms | Optimization
C++ source: EstimatePeakErrors.cpp (last modified: 2016-06-09)
C++ header: EstimatePeakErrors.h (last modified: 2016-02-12)