Skip to content
Snippets Groups Projects
Commit cfc10eb0 authored by Arturs Bekasovs's avatar Arturs Bekasovs
Browse files

Refs #9568. IQTransform

parent b5908411
No related branches found
No related tags found
No related merge requests found
...@@ -45,10 +45,78 @@ always point data. ...@@ -45,10 +45,78 @@ always point data.
+-----------------------+-----------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ +-----------------------+-----------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+
| Log-Log | :math:`\ln(I)` | :math:`\ln(Q)` | | Log-Log | :math:`\ln(I)` | :math:`\ln(Q)` |
+-----------------------+-----------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ +-----------------------+-----------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+
| General \* | :math:`Q^{C_1} \times I^{C_2} \times \ln{\left( Q^{C_3} \times I^{C_4} \times C_5 \right)}` | :math:`Q^{C_6} \times I^{C_7} \times \ln{\left( Q^{C_8} \times I^{C_9} \times C_{10} \right)}` | | General [*]_ | :math:`Q^{C_1} \times I^{C_2} \times \ln{\left( Q^{C_3} \times I^{C_4} \times C_5 \right)}` | :math:`Q^{C_6} \times I^{C_7} \times \ln{\left( Q^{C_8} \times I^{C_9} \times C_{10} \right)}` |
+-----------------------+-----------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ +-----------------------+-----------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+
\* The constants :math:`C_1 - C_{10}` are, in subscript order, the ten .. [*] The constants :math:`C_1 - C_{10}` are, in subscript order, the ten constants passed to the GeneralFunctionConstants property.
constants passed to the GeneralFunctionConstants property.
Usage
-----
**Example - Zimm transformation:**
.. testcode:: ExZimm
x = [1,2,3]
y = [1,2,3]
input = CreateWorkspace(x,y)
input.getAxis(0).setUnit("MomentumTransfer")
input.setDistribution(True)
output = IQTransform(input, 'Zimm')
print 'Output Y:', ', '.join(['{:.3f}'.format(y) for y in output.readY(0)])
print 'Output X:', ', '.join(['{:.3f}'.format(x) for x in output.readX(0)])
Output:
.. testoutput:: ExZimm
Output Y: 1.000, 0.500, 0.333
Output X: 1.000, 4.000, 9.000
**Example - Zimm transformation and background:**
.. testcode:: ExZimmBg
x = [1,2,3]
y = [1,2,3]
input = CreateWorkspace(x,y)
input.getAxis(0).setUnit("MomentumTransfer")
input.setDistribution(True)
output = IQTransform(input, 'Zimm', BackgroundValue=0.5)
print 'Output Y:', ', '.join(['{:.3f}'.format(y) for y in output.readY(0)])
print 'Output X:', ', '.join(['{:.3f}'.format(x) for x in output.readX(0)])
Output:
.. testoutput:: ExZimmBg
Output Y: 2.000, 0.667, 0.400
Output X: 1.000, 4.000, 9.000
**Example - General transformation:**
.. testcode:: ExGeneral
import math
x = [1,2,3]
y = [1,2,3]
input = CreateWorkspace(x,y)
input.getAxis(0).setUnit("MomentumTransfer")
input.setDistribution(True)
constants = [2,2,0,0,math.e,3,0,0,0,math.e]
output = IQTransform(input, 'General', GeneralFunctionConstants=constants)
print 'Output Y:', ', '.join(['{:.3f}'.format(y) for y in output.readY(0)])
print 'Output X:', ', '.join(['{:.3f}'.format(x) for x in output.readX(0)])
Output:
.. testoutput:: ExGeneral
Output Y: 1.000, 16.000, 81.000
Output X: 1.000, 8.000, 27.000
.. categories:: .. 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