Produced by IDL 7.1.1
User Documentation

./toolbox
accumave.pro

Last modification date:
Wed Sep 28 13:27:10 2016

accumave

procedure accumave, accumbuf, dc, [/noclear], [/quiet], [wtarray=variable], [count=variable]

Get the average from an ongoing accumulation.

The dc argument will contain the result. The wtarray keyword will contain the value of the weight array used at the time of the average. This can be used in a subsequent dcaccum or accum call.

The contents of the accum buffer are cleared as a consequence of calling accumave, 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.

Note: The frequency_resolution in dc will be the maximum resolution in all of the data containers used in the accumulation.

Examples
 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
 ; or the same step at the end, but get the average
 ; note that the previous dcaccum etc. must be repeated here
 ; since accumave cleared the average
 accumave, a, myavg, wtarray=myweight
 show, myavg
 data_copy, myavg, mywt
 setdcdata, mywt, wtarray  ; put the weight array in a copy of the data
 show, mywt ; show the weight array
 ; clean up when done
 data_free, myavg
 data_free, mywt
 

Note: the accum_struct structure used here has internal pointers. Use sclear to clear them, either implicitly (by use of accumave) or explicitly.

Uses
accumclear data_copy
Version
$Id$

Parameters
accumbuf
in/out, required
variable
The accumulation buffer to use.
dc
out, required
variable
The resulting average.

Keywords
noclear
in, optional
boolean (def. F)
When set, the contents of the global accum buffer are not cleared. This is useful when you want to see what the current average is but also plan on continuing to add data to that average. If this is not set, you would need to restart the accumulation to average more data.
quiet
in, optional
boolean (def. F)
Normally, accumave announces how many spectra were averaged. Setting this turns that announcement off. This is especially useful when multiple accum buffers are used within a procedure.
wtarray
out, optional
variable
Optionally return the weight array (same length as the data in the dc parameter) used in constucting the average.
count
out, optional
variable
The number of spectra that have been averaged. Returns -1 on an error. If count=0 then the other output arguments (dc and wtarray) are unchanged by this procedure.


Produced by IDLdoc 1.6 on Wed Sep 28 13:27:37 2016