Skip to content

Commit

Permalink
refs #9916. Missing usage for ConvertToReflectometryQ
Browse files Browse the repository at this point in the history
  • Loading branch information
OwenArnold committed Aug 27, 2014
1 parent 48ed45b commit d3cdcab
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
36 changes: 36 additions & 0 deletions Code/Mantid/docs/source/algorithms/ConvertToReflectometryQ-v1.rst
Expand Up @@ -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::
2 changes: 1 addition & 1 deletion Code/Mantid/docs/source/algorithms/Stitch1DMD-v1.rst
Expand Up @@ -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
Expand Down

0 comments on commit d3cdcab

Please sign in to comment.