|
User Documentation |
|||||||||
| prev file | next file | ||||||||||
| SUMMARY: fields | routine DETAILS: routine | ||||||||||
./toolbox dcxshift.pro
| dcxshift |
This function returns a value that, when given as the argument to shift, will shift the given data container such that it is aligned in the current displayed x-axis with the data in the ongoing accumulation buffer. If there is no ongoing accumulation then this function returns 0. The units of the returned value are channels. The primary data container must be shifted that many channels in order to align in the current x-axis with the data in the accumulation buffer.
a={accum_struct}
getps,30
dcaccum, a, !g.s[0] ; start an accum, no alignment needed yet
getps,31
xs = dcxshift(a,!g.s[0]) ; what is the shift to align 31 with 30?
; get a copy of data at !g.s[0]
data_copy,!g.s[0], d
dcshift, d, xs ; actually shift the data
dcaccum, a, d ; and add it in
getps, 32
data_copy,!g.s[0], d
dcshift, d, dcxshift(a, d) ; all in one line, shift 32 to align with 30
dcaccum, a, d
accumave, a, d ; result is in d now
| Parameters | |
|
accumbuf |
The ongoing accumulation buffer. |
|
dc |
The data container that needs to be shifted to align with the data container template in accumbuf. |