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 7.1.
|
Note that xi in Table 7.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 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.
Alternatively, space for a new data set can be initialize using the
command 'alloc' and the data values are then calculated using the
FORTRAN style interpreter of KUPLOT (see section 7.3.
However, the creation of large data sets this way from an arithmetic
expression might be relatively slow.