Quick Guide to Merging Data with Kuplot

Here is a guide to combining spec scans using kuplot using the more common commands. You might also want to look at the Quick Guide to Spec Commands.
General
reset This command resets KUPLOT. The next data set will be loaded as set number 1. Values for aspect ratio, distance of tick marks etc. are also reset to automatic determination.
plot This command is used to plot the graph on the screen.
skal [xmin, xmax] [,ymin, ymax] This command sets the plotting window to to xmax and ymin to ymax. If the data exceed the given window, they will be clipped. If no parameters are given, the plotting window will be set to the maximum / minimum values of the read data sets. If only the parameter pair xmin and xmax are given, the plotted y-range remains at the current setting.
mark [inx] [,iny] This command sets the interval and starting point for the tick marks at the x- and y-axis. If all parameters are omitted, KUPLOT will do an automatic setting. The two parameters inx and iny give the interval of the major tick marks on the x- and y-axis. If only inx is given, iny remains unchanged.
Loading a Scan
load st,filename Returns a list of scans in filename.
load st,filename,scan# Returns a list of columns of scan# from filename.
load st,filename,scan#,info Returns information about scan# from filename stored in the scan parameters.
load st,filename,scan#,cx,cy [,cN] [,cdx] [,cdy] Loads scan# from filename where cx and cy specify the columns to be associated with x and y. cN is the column to normalize the data by. cdx and cdy are the columns in which the uncertainty is stored. The parameters must be specified in this order. To skip a column specification enter 0.
Math Operations
ccal oper,field,ik [,value] This command allows data manipulation. The general syntax is the operation oper (such as 'add', 'sub', 'mult', and 'div') that should be performed as first parameter followed by the field identifier field (such as 'wx', 'wy', 'dx', and 'dy'), followed by the number of the data set ik. Some operations require an additional parameter value.
kcal {add|sub|mul|div},ik1,ik2 This command allows to multiply ('mul'), add ('add'), divide ('div') or subtract ('sub') the y-values of the data sets ik1 and ik2. The resulting data set is stored as the next free data set.
Merging Scans
merge i1,i1, … [,add] This command allows one to merge different data sets given by the parameters i1, i2 and so on. If as last parameter "add" is given, the values are simply added, otherwise they are normalized by the number of contributing data points. The new data set is assigned the next free data set number.

The extend of the new data set is defined by the maximum x-values of the data sets to be merged. The grid size is taken as the difference of the first two points of the first specified data set.

Saving Merged Data
ksav ik This command enters the 'ksav' level of KUPLOT which allows to save the given data set ik in different formats to a file.
form xy [,xmin,xmax] This command determines the file format to be used when the file is saved. The range can be specified with xmin and xmax.
outfile filename This command specifies the name of the outputfile.
run This command save the file with the current settings and leaves the 'ksav' level.
Note: Online help exists in kuplot. This is obtained simply by typing help [command].

Disclaimer:Created by P.F.Peterson for use with Billinge Group diffractomer. We claim no responsibility to any problems that arise from using this information. As always, if you are uncertain, speak with someone who is more familiar with what you are doing.