The Expression Engine in Dawn

The Expression Engine in Dawn

The expression engine can be used in the 'Function Fitting' tool and the 'Mathematical Expression 1D' Operation in the Processing Perspective.

Syntax

The expression engine uses the typical computer syntax for the four basic arithmetic operations (+-*/). Special functions are accessed by namespaces (described below). The syntax for separating namespace components is the colon (:), rather than the usual dot (.). For example, the correct syntax to access the function exp() in the namespace dnp, is shown below.

dnp:exp()

If a dot is entered by mistake, the expression editor will show an error. This can be cleared by right clicking on the list of expressions to refresh the list and then deleting the erroneous expression.

Namespaces

The expression engine incorporates a set of names spaces. These are:

Namespace

Purpose

Namespace

Purpose

dat

Data manipulation functions, treating the array as a matrix or retrieving statistics

dnp

Mathematical functions operating on scalars or arrays of data

func

Function fitting functions

im

Image processing functions

lz

Lazy evaluation functions

 

Clicking on a namespace of interest in this table will jump you to the appropriate section on this page.

 


dat

The 'dat' namespace exposes the functions defined in /org.dawnsci.jexl/src/org/dawnsci/jexl/internal/JexlGeneralFunctions.java. These are:

  • arange(dataset)

  • max(dataset, int)

  • mean(dataset, int)

  • median(dataset, int)

  • min(dataset, int)

  • peakToPeak(dataset, int)

  • product(dataset,int)

  • reshape(dataset, int[])

  • rootMeanSquare(dataset, int)

  • slice(dataset, int[], int[], int[])

  • slice(Dataset, start, stop, step)

  • slice(Dataset, String)

  • squeeze(dataset)

  • stdDev(dataset, int)

  • sum(dataset, int)

  • tile(dataset, int[])

  • transpose(dataset, int[])

 


dnp

The 'dnp' namespace exposes the functions defined in /org.dawnsci.jexl/src/org/dawnsci/jexl/internal/JexlMaths.java. These are:

  • arccos(data)

  • arccosh(data)

  • arcsin(data)

  • arcsinh(data)

  • arctan(data)

  • arctanh(data)

  • cbrt(data)

  • ceil(data)

  • cos(data)

  • cosh(data)

  • exp(data)

  • expm1(data)

  • floor(data)

  • log(data)

  • log10(data)

  • log1p(data)

  • log2(data)

  • maxium(data, data)

  • minimum(data, data)

  • pow(data, data)

  • power(data)

  • signum(data)

  • sin(data)

  • sinh(data)

  • sqrt(data)

  • square(data)

  • tan(data)

  • tanh(data)

  • toDegrees(data)

  • toRadians(data)