Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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:

Mathematical functions operating on scalars or arrays of data
NamespacePurposednp
datData manipulation functions, treating the array as a matrix or retrieving statistics
dnpMathematical functions operating on scalars or arrays of data
funcFunction fitting functions
im

Image processing functions

lzLazy evaluation functions

...

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


...

Anchor
dat
dat

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[])


...

Anchor
dnp
dnp

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)


...

Anchor

...

func

...

func

...

func

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

  • arangeGaussian(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[], double, double, double)
  • Lorentzian(dataset, double, double, double)
  • PearsonVII(dataset, double, double, double, double)
  • PseudoVoigt(dataset, double, double, double, double, double)


...

Anchor
im
im

im

The 'im' namespace exposes the functions defined in /org.eclipse.dawnsci.analysis.dataset/src/org/eclipse/dawnsci/analysis/dataset/impl/Image.java. These are:

...