|
Developer Documentation |
|||||||||
| prev file | next file | ||||||||||
| SUMMARY: fields | routine DETAILS: routine | ||||||||||
./toolbox accumave.pro
| accumave |
Get the average from an ongoing accumulation. The dc argument will contain the result. The contents of the accum buffer are cleared as a consequence of calling ave, unless the noclear keyword is set.
Note: It is a good idea to use accumclear to clear the accum buffer before using it the first time so that you can be certain it is starting from a cleared (empty) state.
a = {accum_struct}
accumclear, a ; not necessary here, but good practice
get,index=1
dcaccum, a, !g.s[0]
get,index=2
dcaccum, a, !g.s[0]
accumave, a, myavg
show, myavg
data_free, myavg ; be sure and clean up when done
Note: the accum_struct structure used here has internal pointers. Use sclear to clear them, either implicitly (by use of accumave) or explicitly.
| Parameters | |
|
accumbuf |
The accumulation buffer to use. |
|
dc |
The resulting average. |