EvaluateFunction v1

../_images/EvaluateFunction-v1_dlg.png

EvaluateFunction dialog.

Summary

Evaluate a function on a workspace.

Properties

Name Direction Type Default Description
Function InOut Function Mandatory Parameters defining the fitting function and its initial values
InputWorkspace Input Workspace Mandatory Name of the input Workspace
IgnoreInvalidData Input boolean False Flag to ignore infinities, NaNs and data with zero errors.
DomainType Input string Simple The type of function domain to use: Simple, Sequential, or Parallel. Allowed values: [‘Simple’, ‘Sequential’, ‘Parallel’]
OutputWorkspace Output Workspace Mandatory An output workspace.

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.

Usage

Example - 1D function and a matrix workspace.

# Load a workspace
ws = Load('MUSR00015189')
# Evaluate a function
EvaluateFunction('name=ExpDecay,Height=56', 'ws_1', StartX=0, EndX=30, OutputWorkspace='out')

Example - 2D function and a MD workspace.

# Create an empty 2D workspace (100 x 100)
nx = 100
ny = 100
ws = CreateMDHistoWorkspace(Dimensionality=2, Extents=[-10,10,-10,10], Names="x,y", Units="U,V",
    NumberOfBins='%s,%s' % (nx,ny),
    SignalInput=[0] * nx * ny, ErrorInput=[0] * nx * ny)
# Evaluate a function
EvaluateFunction('name=UserFunctionMD,Formula=sin(x)*sin(y)','ws', OutputWorkspace='out')

Categories: Algorithms | Optimization