From c8fe98b5681a7cd524bd73caafad41148e756b37 Mon Sep 17 00:00:00 2001 From: Michael Wedel Date: Thu, 8 Jan 2015 11:29:28 +0100 Subject: [PATCH] Refs #10774. Added properties for lambda range, updated documentation --- .../inc/MantidSINQ/PoldiUtilities/IPoldiFunction1D.h | 12 ++++++++++-- Code/Mantid/Framework/SINQ/src/PoldiFitPeaks2D.cpp | 5 ++++- .../docs/source/algorithms/PoldiFitPeaks2D-v1.rst | 4 ++++ 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/Code/Mantid/Framework/SINQ/inc/MantidSINQ/PoldiUtilities/IPoldiFunction1D.h b/Code/Mantid/Framework/SINQ/inc/MantidSINQ/PoldiUtilities/IPoldiFunction1D.h index 138503d0e3e7..20b477fcc074 100644 --- a/Code/Mantid/Framework/SINQ/inc/MantidSINQ/PoldiUtilities/IPoldiFunction1D.h +++ b/Code/Mantid/Framework/SINQ/inc/MantidSINQ/PoldiUtilities/IPoldiFunction1D.h @@ -13,10 +13,18 @@ namespace Poldi { This is an auxilliary interface that has to be implemented by functions that are supposed to be used for POLDI fits. + This way the calculation of a theoretical diffractogram can be + performed by the corresponding functions, which may behave differently + depending on their nature. For examples see the following classes: + + PoldiSpectrumConstantBackground + PoldiSpectrumDomainFunction + Poldi2DFunction + @author Michael Wedel, Paul Scherrer Institut - SINQ - @date 14/03/2014 + @date 07/01/2015 - Copyright © 2014 PSI-MSS + Copyright © 2015 PSI-MSS This file is part of Mantid. diff --git a/Code/Mantid/Framework/SINQ/src/PoldiFitPeaks2D.cpp b/Code/Mantid/Framework/SINQ/src/PoldiFitPeaks2D.cpp index 132734766a02..03f0f205eef0 100644 --- a/Code/Mantid/Framework/SINQ/src/PoldiFitPeaks2D.cpp +++ b/Code/Mantid/Framework/SINQ/src/PoldiFitPeaks2D.cpp @@ -359,8 +359,11 @@ MatrixWorkspace_sptr PoldiFitPeaks2D::get1DSpectrum( std::vector indices = detector->availableElements(); // Create the grid for the diffractogram and corresponding domain/values + double lambdaMin = getProperty("LambdaMin"); + double lambdaMax = getProperty("LambdaMax"); + PoldiDGrid grid(detector, m_poldiInstrument->chopper(), m_deltaT, - std::make_pair(1.1, 5.0)); + std::make_pair(lambdaMin, lambdaMax)); FunctionDomain1DVector domain(grid.grid()); FunctionValues values(domain); diff --git a/Code/Mantid/docs/source/algorithms/PoldiFitPeaks2D-v1.rst b/Code/Mantid/docs/source/algorithms/PoldiFitPeaks2D-v1.rst index f42b53e36333..c9f86b42e680 100644 --- a/Code/Mantid/docs/source/algorithms/PoldiFitPeaks2D-v1.rst +++ b/Code/Mantid/docs/source/algorithms/PoldiFitPeaks2D-v1.rst @@ -17,6 +17,8 @@ At the moment all profiles are calculated independently, using Gaussian function PoldiFitPeaks2D can also be used to calculate a theoretical 2D pattern from a set of peaks by limiting the iterations to 0. +In addition to performing the 2D-fit, a theoretical 1D-diffractogram of the fit-function is calculated as well, which can be used in conjunction with :ref:`algm-PoldiAnalyseResiduals` to assess the quality of a fit. + Usage ----- @@ -47,6 +49,7 @@ PoldiFitPeaks2D operates on a MatrixWorkspace with a valid POLDI instrument defi PoldiFitPeaks2D(InputWorkspace=truncated_6904, PoldiPeakWorkspace="peaks_refined_6904", RefinedPoldiPeakWorkspace="peaks_fit_2d_6904", + Calculated1DSpectrum="simulated_1d_6904", OutputWorkspace="simulated_6904") After this step, there is a new workspace containing the simulated spectrum. It should look similar to the one in the following figure: @@ -84,6 +87,7 @@ In general, there is a background in POLDI data that depends on :math:`2\theta`. PoldiPeakWorkspace="peaks_refined_6904", OutputWorkspace="simulated_6904", RefinedPoldiPeakWorkspace="peaks_fit_2d_6904", + Calculated1DSpectrum="simulated_1d_6904", LinearBackgroundParameter=0.01) Now the spectrum looks different, like in the example below.