\(\renewcommand\AA{\unicode{x212B}}\)

PoldiFitPeaks1D v1

../_images/PoldiFitPeaks1D-v1_dlg.png

PoldiFitPeaks1D dialog.

Summary

PoldiPeakFit1D fits peak profiles to POLDI auto-correlation data.

Properties

Name Direction Type Default Description
InputWorkspace Input Workspace2D Mandatory An input workspace containing a POLDI auto-correlation spectrum.
FwhmMultiples Input number 2 Each peak will be fitted using x times FWHM data in each direction.
PeakFunction Input string Gaussian Peak function that will be fitted to all peaks. Allowed values: [‘BackToBackExponential’, ‘Bk2BkExpConvPV’, ‘DeltaFunction’, ‘ElasticDiffRotDiscreteCircle’, ‘ElasticDiffSphere’, ‘ElasticIsoRotDiff’, ‘ExamplePeakFunction’, ‘Gaussian’, ‘IkedaCarpenterPV’, ‘Lorentzian’, ‘PseudoVoigt’, ‘Voigt’]
PoldiPeakTable Input TableWorkspace Mandatory A table workspace containing POLDI peak data.
OutputWorkspace Output TableWorkspace   Output workspace with refined peak data.
FitPlotsWorkspace Output Workspace FitPlots Plots of all peak fits.

Description

PoldiFitPeaks1D takes a TableWorkspace with peaks (for example from PoldiPeakSearch v1) and a spectrum from PoldiAutoCorrelation v5 and tries to fit a Gaussian peak profile to the spectrum for each peak. As described on the page of PoldiAutoCorrelation v5, each peak is surrounded by a dip. This dip is modeled by adding a quadratic background of the form

\(f(x) = a_0\cdot(x - x_0)^2 + a_1\)

where \(x_0\) is the peak position and \(a_i\) are the coefficients of the polynome.

The implementation is very close to the original POLDI analysis software (using the same profile function). One point where this routine differs is error calculation. In the original program the parameter errors were adjusted by averaging \(\chi^2\)-values, but this does not work properly if there is an outlier caused by a bad fit for one of the peaks, so this step is not performed, the errors are derived directly from the fit.

The algorithm produces a number of output workspaces. One with refined peak parameters (OutputWorkspace), which is equivalent to the input TableWorkspace, except that the parameters are fitted and have errors. ResultTableWorkspace mimics the result files produced by the original data analysis software. FitCharacteristicsWorkspace contains the raw fitting results and the errors of the parameters, as well as \(\chi^2\)-values for each profile fit. FitPlotsWorkspace is a GroupWorkspace that contains plots for each peak profile fit with measured data, fitted data and a difference curve.

Usage

Note

To run these usage examples please first download the usage data, and add these to your path. In Mantid this is done using Manage User Directories.

The following small usage example performs a peak fit on the sample data already used in PoldiAutoCorrelation v5 and PoldiPeakSearch v1. After the fit, the plots can be viewed and used to visually judge the quality of the fits.

# Load data file and instrument, perform correlation analysis
raw_6904 = LoadSINQFile(Filename = "poldi2013n006904.hdf", Instrument = "POLDI")
LoadInstrument(raw_6904, InstrumentName = "POLDI", RewriteSpectraMap=True)
correlated_6904 = PoldiAutoCorrelation(raw_6904)

# Run peak search algorithm, store peaks in TableWorkspace
peaks_6904 = PoldiPeakSearch(correlated_6904)

PoldiFitPeaks1D(InputWorkspace = correlated_6904, FwhmMultiples = 4.0,
                PeakFunction = "Gaussian", PoldiPeakTable = peaks_6904,
                OutputWorkspace = "peaks_refined_6904",
                FitPlotsWorkspace = "fit_plots_6904",
                Version=1)

print("There are {} plots available for inspection.".format(mtd['fit_plots_6904'].getNumberOfEntries()))

Output:

There are 14 plots available for inspection.

Categories: AlgorithmIndex | SINQ\Poldi

Source

C++ header: PoldiFitPeaks1D.h (last modified: 2021-03-31)

C++ source: PoldiFitPeaks1D.cpp (last modified: 2021-03-31)