Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7256952
commit b0cf1b7
Showing
2 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
55 changes: 55 additions & 0 deletions
55
Code/Mantid/docs/source/algorithms/EvaluateMDFunction-v1.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
.. algorithm:: | ||
|
||
.. summary:: | ||
|
||
.. alias:: | ||
|
||
.. properties:: | ||
|
||
Description | ||
----------- | ||
|
||
The algorithm will use the axes of the input workspace to evaluate a functions on them | ||
and store the result in the output workspace. | ||
|
||
This is a plot of the evaluated function from the usage example below. | ||
|
||
.. figure:: /images/Function3D.png | ||
:alt: Function3D.png | ||
|
||
|
||
Usage | ||
----- | ||
|
||
.. testcode:: | ||
|
||
# Create an empty 3D histo workspace. | ||
n = 50 * 50 * 50 | ||
ws=CreateMDHistoWorkspace(Dimensionality=3, Extents='-1,1,-1,1, -1,1',\ | ||
SignalInput = [0.0] * n, ErrorInput = [1.0] * n,\ | ||
NumberOfBins='50,50,50',Names='Dim1,Dim2,Dim3',Units='MomentumTransfer,MomentumTransfer,MomentumTransfer') | ||
|
||
# Define a function | ||
function = 'name=UserFunctionMD,Formula=1.0/(1.0 + 100*(0.5 - x^2 - y^2 -z^2)^2)' | ||
|
||
# Evaluate the function on the created workspace | ||
out = EvaluateMDFunction(ws,function) | ||
|
||
# Check the result workspace | ||
print out.getNumDims() | ||
print out.getXDimension().getName() | ||
print out.getYDimension().getName() | ||
print out.getZDimension().getName() | ||
|
||
|
||
Output | ||
###### | ||
|
||
.. testoutput:: | ||
|
||
3 | ||
Dim1 | ||
Dim2 | ||
Dim3 | ||
|
||
.. categories:: |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.