The SignalMath TDI Package for MDSplus Brian Nelson, University of Washington Plasma Sciences Dept., writes: These "signal math" routines work on both VMS and Linux. The driver is "signalmath.fun" which is called by the sigadd(), sigdiv(), etc. routines. signalmath's first two arguments are the signal names, and the third argument is the first three letters of the function to apply to the (possibly resampled) signals, e.g. sigmath( \sig1, \sig2, "ADD" ). If the timebases of the two signals are different, the two signals are cropped to the overlapping beginning and ending times, and the finer timebase signal is resampled onto the coarser sampling interval. (If the timebases do not overlap, zero is returned and an error message is written to stdout.) There are also the following wrapper routines that only need the two signals as arguments: sigadd(\sig1,\sig2) \sig1 + \sig2 sigatan2(\sig1,\sig2) atan2( \sig1, \sig2 ) sigdiv(\sig1,\sig2) \sig1 / \sig2 sigmul(\sig1,\sig2) \sig1 * \sig2 sigsub(\sig1,\sig2) \sig1 - \sig2 Calls can be nested: sigadd( \sig1, sigadd( \sig2, \sig 3 ) ) You should also be able to pull out a subset timebase of the returned signal, e.g.: sigadd( 0.5*\ip1, 0.5*\ip2 )[-0.25 : 1.5] should return the average of \ip1 and \ip2 from -0.25 to 1.5 seconds. I also included the following routines, that can be handy for sigdiv() with small values, etc. (several are wrapper calls with similar names): sig_ceil.fun sig_ceiling.fun sig_crop.fun sig_floor.fun sigavg_string.fun averages a signal over several shots, sig arg *must* be a string sigceil.fun sigceiling.fun sigcrop.fun sigfloor.fun And also for running (cumulative) integrals: RunInt.fun RunningIntegral.fun SamplingInterval.fun The first two routines (one is a wrapper) call SamplingInterval() (there are problems using these routines on one dimension of a two-dimensional signal. - Bill Davis) ***NOTE*** that these routines do NOT correct for different units, like Amps and Kiloamps. At PPPL, these routines are in /p/nstxusr1/mdsplus_pppl/tdi, which should be in your MDS_PATH. The .zip file can be downloaded from P:\public\anonymous ftp private\MDSplus.