A common task is the numerical manipulation of a data set, e.g. to add some constant to a data set or inverse all y-values. The command 'ccal' offers a variety of manipulation functions for a specific data set. The command 'kcal' on the other had allows simple arithmetic operations between two data sets. The commands and valid operations are listed in table 6.1.
|
Note that xi in table 6.1 stands for x-, y-, z- and
- or
-values depending on the given parameters.
The following simple command will multiply all y-values of data set one
with the factor 1.75:
ccal mul,wy,1,1.75
The parameter 'mul' indicates that a multiplication is to be performed
using the y-values which are selected by the next parameter ('wy').
Finally data set one and the desired factor of 1.75 are specified.
For x- and z-values use 'wx' and 'wz', the standard deviations
and
are selected using the parameters 'dx'
and 'dy'.
Another data manipulation command is 'glat'. The name is a reminder that the first KUPLOT version was in German. This command performs data smoothing for both 1D and 2D data sets (smoothing in German is 'glätten'). The smoothing is performed by a gliding 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 6.1. The view graph on the right show the raw data showing quite noisy contour lines. The picture ion the right show the same view graph after the data set was smoothed with a value of n=5 using the command 'glat 1,5' assuming the values are stored as data set one. You might have noticed that these data shown in earlier examples were already slightly smoothed.
Another feature ]
of KUPLOT is the capability to create a
data set from an arithmetic expression rather than reading it from a
file. This is done using the command 'func'. The following two
commands demonstrate usage of 'func' to create a 1D data set (
and a 2D data set (
.
func sin(r[0]),0.0,6.3,0.1 func sin(r[0])*cos(r[1]),0,6,0.1,0,6,0.1
Note that the variable 'r[0]' is used for the x-argument and r[1] is
used as y-argument. Thus values previously stored in these two
variables are destroyed by the 'func' command. The following commands
are the range and the grid size in the two directions. In our first
example, the desired x-range is
with a grid
size of
.
This results the creation of a data set with
64 points. The second 'func' command shown above creates a 2D data set
ranging from 0.0 to 6.1 in x- and y-direction with a grid size of
given a size of 61x61 data points.
Because the function values are calculated using the internal
interpreter of KUPLOT the creation of large data sets from an
arithmetic expression might be relatively slow.