Skip to content
Snippets Groups Projects
Commit 1dc7b58b authored by Elliot Oram's avatar Elliot Oram
Browse files

Updated doc test for QLRun

Refs #13826
parent e5c6e309
No related branches found
No related tags found
No related merge requests found
......@@ -10,6 +10,8 @@
Description
-----------
**This algorith can only be run on windows due to f2py support and the underlying fortran code**
The model that is being fitted is that of a \delta-function (elastic component) of amplitude A(0) and Lorentzians of amplitude A(j) and HWHM W(j) where j=1,2,3. The whole function is then convolved with the resolution function. The -function and Lorentzians are intrinsically normalised to unity so that the amplitudes represent their integrated areas.
For a Lorentzian, the Fourier transform does the conversion: 1/(x^{2}+\delta^{2}) \Leftrightarrow exp[-2\pi(\delta k)]. If x is identified with energy E and 2\pi k with t/\hbar where t is time then: 1/[E^{2}+(\hbar / \tau)^{2}] \Leftrightarrow exp[-t
......@@ -33,31 +35,10 @@ Usage
resWs = Load('irs26173_graphite002_red.nxs')
# Run QLRun algorithm
QLRun(Program="QL", SampleWorkspace=sampleWs, ResolutionWorkspace=resWs, MinRange=-0.547607, MaxRange=0.543216, SampleBins=1, ResolutionBins=1, Elastic=False, Background="Sloping", FixedWidth=False, UseResNorm=False, WidthFile="", Loop=True, Save=False, Plot="None")
outputName = 'samp_QLd_Workspace_0'
# capture first fitted workspace
result_ws = mtd[outputName]
# Print the result
print "The Y values of the first fitted workspace are:"
print "data : %.5f" %(result_ws.readY(0)[0])
print "fit.1 : %.5f" %(result_ws.readY(1)[0])
print "diff.1: %.5f" %(result_ws.readY(2)[0])
print "fit.2 : %.5f" %(result_ws.readY(3)[0])
print "diff.2: %.5f" %(result_ws.readY(4)[0])
Output:
.. testoutput:: QLRunExample
:options: +NORMALIZE_WHITESPACE
The Y values of the first fitted workspace are:
data : 0.02540
fit.1 : 0.01906
diff.1: -0.00635
fit.2 : 0.01732
diff.2: -0.00808
fit_ws, result_ws, prob_ws = QLRun(Program='QL', SampleWorkspace=sampleWs, ResolutionWorkspace=resWs,
MinRange=-0.547607, MaxRange=0.543216, SampleBins=1, ResolutionBins=1,
Elastic=False, Background='Sloping', FixedWidth=False, UseResNorm=False,
WidthFile='', Loop=True, Save=False, Plot='None')
.. categories::
......
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