\(\renewcommand\AA{\unicode{x212B}}\)

EvaluateMDFunction v1

../_images/ImageNotFound.png

Enable screenshots using DOCS_SCREENSHOTS in CMake

Warning

EvaluateMDFunction is deprecated. Use EvaluateFunction instead.

Summary

Evaluates an MD function on a MD histo workspace.

See Also

CreateMDWorkspace, FakeMDEventData

Properties

Name

Direction

Type

Default

Description

InputWorkspace

Input

IMDHistoWorkspace

Mandatory

An input workspace that provides dimensions for the output.

Function

InOut

Function

Mandatory

Parameters defining the fitting function and its initial values

OutputWorkspace

Output

IMDHistoWorkspace

Mandatory

An output workspace.

Description

Note: this algorithm is deprecated, use EvaluateFunction instead.

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.

Function3D.png

Usage

# 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().name)
print(out.getYDimension().name)
print(out.getZDimension().name)

Output

3
Dim1
Dim2
Dim3

Categories: AlgorithmIndex | MDAlgorithms\Creation | Deprecated

Source

C++ header: EvaluateMDFunction.h

C++ source: EvaluateMDFunction.cpp