From d3cdcab7d03048811a0c58480241054ad6f718bb Mon Sep 17 00:00:00 2001 From: Owen Arnold Date: Wed, 27 Aug 2014 13:42:38 +0100 Subject: [PATCH] refs #9916. Missing usage for ConvertToReflectometryQ --- .../algorithms/ConvertToReflectometryQ-v1.rst | 36 +++++++++++++++++++ .../docs/source/algorithms/Stitch1DMD-v1.rst | 2 +- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/Code/Mantid/docs/source/algorithms/ConvertToReflectometryQ-v1.rst b/Code/Mantid/docs/source/algorithms/ConvertToReflectometryQ-v1.rst index 1d1019710f14..58856cb8d07e 100644 --- a/Code/Mantid/docs/source/algorithms/ConvertToReflectometryQ-v1.rst +++ b/Code/Mantid/docs/source/algorithms/ConvertToReflectometryQ-v1.rst @@ -52,4 +52,40 @@ You will usually want to rebin using :ref:`algm-BinMD` or :ref:`algm-SliceMD` after transformation because the output workspaces are not regularly binned. +Usage +------ + +**Example - Working with multidetectors** + +.. testcode:: ConvertToReflectometryQExample + + import numpy as np + + ws = Load('POLREF4699.nxs') + + theta = ws[0].run().getLogData('stheta').value[-1] + + ws = SpecularReflectionPositionCorrect(ws, TwoThetaIn=theta, AnalysisMode='MultiDetectorAnalysis', SampleComponentName='some-surface-holder', SpectrumNumbersOfDetectors= '74') + + mod_q, lam, theta_out = ReflectometryReductionOneAuto(InputWorkspace=ws, AnalysisMode='MultiDetectorAnalysis', ThetaIn=theta, ProcessingInstructions='0:245', CorrectDetectorPositions=False) + + lam = ConvertSpectrumAxis(lam, Target='signed_theta') + + qlab = ConvertToReflectometryQ(InputWorkspace=lam, OutputDimensions='Q (lab frame)', Extents=[-0.0005,0.0005,0,0.12], OutputAsMDWorkspace=False) + + # Check the results + flatten_qlab = SumSpectra(qlab) + y_data = flatten_qlab[0].readY(0) + x_data = flatten_qlab[0].readX(0) + index_of_max_y = np.argmax(y_data) + + print "Integrated over q_z, the intensity is greatest at q_x =", x_data[index_of_max_y] + +Output: + +.. testoutput:: ConvertToReflectometryQExample + + Integrated over q_z, the intensity is greatest at q_x = 0.0 + + .. categories:: diff --git a/Code/Mantid/docs/source/algorithms/Stitch1DMD-v1.rst b/Code/Mantid/docs/source/algorithms/Stitch1DMD-v1.rst index 86cac5f9f87f..5c8a86f8b200 100644 --- a/Code/Mantid/docs/source/algorithms/Stitch1DMD-v1.rst +++ b/Code/Mantid/docs/source/algorithms/Stitch1DMD-v1.rst @@ -9,7 +9,7 @@ Description ----------- -Depricated in favour of :ref:`algm-Stitch1D` as of version 3.2 of Mantid. +Deprecated in favor of :ref:`algm-Stitch1D` as of version 3.2 of Mantid. Performs 1D stitching of Reflectometry 2D MDHistoWorkspaces. Based on the Quick script developed at ISIS. This only works on 1D Histogrammed