# Macro Language: Calculation Commands

`fg <axis> <min> <max> <steps> <expr>`

`<axis>`

: The target axis (1 = X axis, 2 = Y axis)
`<min>`

, `<max>`

: The range for the new generated function.
`<steps>`

: Number of steps for the the function.
`<expr>`

: Expression which defines the function.
`bcalc <buffer1> <operator> <buffer2> `

`<operator>`

: + - * /
`calc <data> <expr> <BUFFER>`

`<data>`

: The target axis (1 = X values, 2 = Y values, 3 = X error, 4 = Y error)
`<expr>`

: Expression which defines the calculation.
`swapxy <BUFFER>`

`normx <ref1> <ref2> <new1> <new2> <BUFFER>`

`ref1`

value becomes the `new1`

value and the `ref2`

value becomes the `new2`

value.
`normy <ref1> <ref2> <new1> <new2> <BUFFER>`

`ref1`

value becomes the `new1`

value and the `ref2`

value becomes the `new2`

value.
`movex <from> <to> <BUFFER>`

`movey <from> <to> <BUFFER>`

`cutoutsidex <min> <max> <BUFFER>`

`min`

and `max`

`cutinsidex <min> <max> <BUFFER>`

`min`

and `max`

`cutoutsidey <min> <max> <BUFFER>`

`min`

and `max`

`cutinsidey <min> <max> <BUFFER>`

`min`

and `max`

`calcint <min> <max> <BUFFER>`

`integral`

.
`linreg <min> <max> <BUFFER>`

`min`

and `max`

. The result of the last regression will be stored in the variables `rega`

, `regb`

and `regr`

.
`logreg <min> <max> <BUFFER>`

`min`

and `max`

. The result of the last regression will be stored in the variables `rega`

, `regb`

and `regr`

.
`expreg <min> <max> <BUFFER>`

`min`

and `max`

. The result of the last regression will be stored in the variables `rega`

, `regb`

and `regr`

.
`linbg <a> <b> <BUFFER>`

`splinefit <use exclude> <exclude min> <exclude max> <corr mode> <corr factor> <corr func> <sigma mode> <sigma value> <order> <minmax> <derivative> <points> <BUFFER>`

`<use exclude>`

: Boolean value. If true use the exclude range.
`<exclude min>, <exclude max>`

: Defines the exclude range.
`<corr mode>`

: The correlation mode (0=ignore, 1=detect, 2=manual)
`<corr factor>`

: Used for the manual correlation mode option.
`<corr func>`

: Assumed correlation function (0=exponential, 1=gaussian, 2=linear, 3=sinc)
`<sigma mode>`

: Info on errors In Y (0=none, 1=from error data, 2=fixed value, 3=significant digits)
`<sigma value>`

: Used for the 'fixed value' and 'significant digits' options.
`<order>`

: The spline order.
`<minmax>`

: Boolean value. If true buffers for minima and maxima will be generated.
`<derivative>`

: Boolean value. If true a buffer for the derivative will be generated.
`<points>`

: Number of points for the spline result and derivative buffers.
`<BUFFER>`

: The buffers witch should be spline fitted.
`smooth <factor> <BUFFER>`

`factor`

as the effective smooth width and performs a least square smooth to reduce the noise on the buffer.
`fftsmooth <factor> <BUFFER>`

`factor`

as the effective smooth width and performs a FFT based smooth to reduce the noise on the buffer (see sources).
`datareduction <n> <BUFFER>`

`n`

points, builds the average, and replaces the n points with the new one.
`spline <points> <strength> <BUFFER>`

`<points>`

: Defines the number of points which should be calculated for each interval.
`<strength>`

: Defines the strength of the interpolation. 2 is in most cases a god choice.
`fft <windowing> <BUFFER>`

`<windowing>`

: 1=none, 2=Hanning, 3=Welch, 4=Parzen
`diff <interval> <BUFFER>`

`integrate <BUFFER>`

`setxval <BUFFER> <index> <value>`

`setyval <BUFFER> <index> <value>`

`setxeval <BUFFER> <index> <value>`

`setyeval <BUFFER> <index> <value>`

`xpssatsub <anode> <BUFFER>`

`<anode>`

: 0=Mg, 1=Al
`shirleybg <xstart> <ystart> <xend> <yend> <BUFFER>`