# RepTate tools¶

The following tools are available in all applications. In general, the aim of the tools is to manipulate (filter, smooth, apply operations, integrate, differentiate, etc) or get information (statistics, peaks, etc) from the data as it is being represented in the current application and view. The tools can be applied to both the experimental data and the theory, or just to the experimental data. Several tools can be applied, and they are applied in sequence (in the same order as they are shown in the tool tab widget), to all the datasets and theories that are visible in the current application. If the user wants to apply the tools in a different order, he/she can drag the corresponding tab and drop it in the right position.

## Bounds¶

Remove points in the current view ïf $$x \notin [x_{min}, x_{max}]$$ or $$y \notin [y_{min}, y_{max}]$$

## Evaluate Expression¶

Create new abcissa and ordinate data by evaluating an expression as a function of x and y (the abcissa and ordinate of the current view data). Standard algebraic expressions and mathematical functions (sin, cos, tan, arccos, arcsin, arctan, arctan2, deg2rad, rad2deg, sinh, cosh, tanh, arcsinh, arccosh, arctanh, around, round_, rint, floor, ceil, trunc, exp, log, log10, fabs, mod, e, pi, power, sqrt) are understood by the expression parser.

## Find Peaks¶

Find peaks (maxima or minima) in the data, as represented by the current view. The option to find the maxima or the minima is specified by the min/max check button (the minpeaks parameter in the command line version). The threshold controls the relative height that a peak must have (with respect to the data span) in order to be detected. The minimum_distance parameter controls how far from each other the peaks must be in order to be distinguished. The returned peaks correspond to the maximum/minimum data point in the current view. Alternatively, the user can select to fit a parabola to the peaks and find the analytical maximum or minimum of the parabola. The parameter minimum_distance also controls the number of points around the maximum data point used to fit the parabola. The peaks are returned in the Tool information area and shown as symbols in the chart.

The algorithm used to find the peaks can be very inaccurate and slow if the data is noisy and has many local peaks. It is recommended to smooth the data first before finding the peaks.

Calculate the derivative of y with respect to x, where y is the ordinate and x is the abcissa in the current view. The gradient function from numpy is used, where the derivative is computed using second order accurate central differences in the interior points and first order accurate one-sides (forward or backwards) differences at the boundaries.

## Integral¶

Calculate the integral of y with respect to x, where y is the ordinate and x is the abcissa in the current view. Repeated points in the data are removed before the integral is performed. The data between the point is interpolated with a cubic spline. The total value of the definite integral is shown in the Tool output region. If a different integration interval is needed, the Bounds tool can be used before the Integral tool.

## Smooth¶

Smooths the current view data by applying a Savitzky-Golay filter. The smoothing procedure is controlled by means of two parameters: the window length (a positive, odd integer), which represents the number of convolution coefficients of the filter, and the order of the polynomial used to fit the samples (must be smaller than the window length).

## Power Law¶

Check the power law of the data (or some part of it) by dividing the y coordinate by the x coordinate raised to n.

## Materials Database¶

A special Tool to store the material parameters. Many apps and theories rely on the parameters stored in this database. There are two copies of the database: i) a general one that is distributed with RepTate, is stored in the software installation folder and contains well established values of the parameters and ii) a user database that contains material parameters introduced by the user and is stored in the user HOME folder.

Todo

Give a short example of use of all the Tools