NAME

fold - to fold by addition data from stdin

SYNOPSIS

fold fold= [nstep=] [xcol=] [ycol=] [repeat=]

DESCRIPTION

This routine reads time sampled data and then sums up data point from the appropriate timestamp modulo the folding time stated on the command line. The folding time must be specified.

Data are expected in two columns separated by white space arriving in the standard input. The default timestamp is in column 1 and the data in column two. The folding time is chopped up into nstep bins and for each datapoint the timestamp is read and taken modulo of the folding time. The data are then added to the appropriate bin. The weighting factor for each bin is then incremented.

At the end of input, the sum of the bin is divided by the weight factor. If the weight is zero, an error message is printed out to stderr and the program exits with a non-zero exit code. Finally, the modulo value of the bin, the weighted sum and the weight of each bin each bin are printed to stdout.

OPTIONS

nstep= sets the number of binning points (default:10).

repeat= sets how many times to print out the data (default: 1).

xcol= sets the column in which the time stamp will appear (default: 1)

ycol= sets the column in which the data arrive will appear (default: 2)