next up previous contents
Next: 7.3 Data manipulation using Up: 7. Manipulating and analysing Previous: 7.1 Simple data calculations

Subsections

   
7.2 Data manipulation

   
7.2.1 Data smoothing


  
Figure 7.1: Demonstration of data smoothing
\includegraphics[scale=0.8]{mat.1.eps}

KUPLOT has two different smoothing functions that can be used for 1D as well as 2D data. The first type of smoothing is a simple sliding average. The corresponding command is 'glat'. The name is a reminder that the first KUPLOT version was in German (smoothing in German is 'glätten'). The smoothing is performed by a sliding average of n neighbouring points. The value of n is given as parameter of the command 'glat'. An example for the smoothing operation is given in Figure 7.1. The top view graph shows the raw data showing quite noisy contour lines. The picture below shows the same data after the data set was smoothed with a value of n=7 using the command 'glat 1,7' assuming the values are stored as data set one. It is apparent from Figure 7.1 that this type of averaging broadens the peaks and does not preserve the peak heights. An alternative way $\star$]$\star$to smooth data implemented in KUPLOT is the Savitzky-Golay algorithm which is in principle a weighted sliding average. The weight is given by a polynom of user definable order (the default is 2). The command for the later type of smoothing is 'smooth' with parameters identical to 'glat'. However, the minimum number of n is five. The bottom view graph in Figure 7.1 was smoothed with n=7 using the command 'smooth'. It can be clearly seen that the widths and heights of the peaks are much better preserved. For a detailed discussion about the smoothing algortihm and its limits see e.g. Numerical Recipes by Press, Flannery, Teukolsky & Vetterling, Cambridge University Press, 1989.

As a default, 2D data sets are per smoothed in x and y direction. The user can restrict the smoothing to only one direction by adding the optional parameter "x" or "y" to the 'glat' or 'smooth' command. Again the reader might refer to the online help for more detailed information on the smoothing commands.

   
7.2.2 More data manipulation

In this section we will briefly mention other commands that allow the manipulation of data. A data set can be simply sorted increasing in x values via the command 'sort'. Another function is 'rebin' which transform the data to a user defined grid spacing in x. Note that this command is limited to 1D data sets. To rebin 2D data save them as xyz file and re-load them with 'load zz,..' and the desired grid spacing.

Sometimes two data sets differ by a scaling factor of an offset. The command 'match' allows to find the scaling and/or offset that gives the best agreement between two data sets. The scaling and bacground is directly applied. Note that this function only works for data sets, that have identical points in x. The command 'merge' allows one to combine data sets. Points with common x-values are averaged.


next up previous contents
Next: 7.3 Data manipulation using Up: 7. Manipulating and analysing Previous: 7.1 Simple data calculations
Thomas Proffen {Billinge}
1999-06-26