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

EvaluateFunction v1

Summary

Evaluate a function on a workspace.

See Also

Fit

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’]

EvaluationType

Input

string

CentrePoint

The way the function is evaluated on histogram data sets. If value is “CentrePoint” then function is evaluated at centre of each bin. If it is “Histogram” then function is integrated within the bin and the integrals returned. Allowed values: [‘CentrePoint’, ‘Histogram’]

StepSizeMethod

Input

string

Default

The way the step size is calculated for numerical derivatives. See the section about step sizes in the Fit algorithm documentation to understand the difference between “Default” and “Sqrt epsilon”. Allowed values: [‘Default’, ‘Sqrt epsilon’]

PeakRadius

Input

number

0

A value of the peak radius the peak functions should use. A peak radius defines an interval on the x axis around the centre of the peak where its values are calculated. Values outside the interval are not calculated and assumed zeros.Numerically the radius is a whole number of peak widths (FWHM) that fit into the interval on each side from the centre. The default value of 0 means the whole x axis.

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: AlgorithmIndex | Optimization

Source

C++ header: EvaluateFunction.h

C++ source: EvaluateFunction.cpp