Produced by IDL 6.1
User Documentation

./toolbox
dcaccum.pro

Last modification date:
Thu Jun 2 23:56:08 2005

dcaccum

procedure dcaccum, accumbuf, dc, [weight=float]

Add a data container into an ongoing accumulation in a given accum_struct structure.

If this is the first item to be "accum"ed, it will also be used as a template, stored in accumbuf.template, to be used by dcave.

If the polarization of any items being accumed does not match that of template, the polarization of the template is changed to 'I'.

This combines the UniPOPS functionality of ACCUM and SUM. The SUM name is already in use in IDL.

This is primarily for use inside procedures and functions where it is useful to average several data containers without disturbing the public data containers in the guide structure. Most users will find using accum preferable to using dcaccum.

Examples
average some data
   a = {accum_struct}
   accumclear,a  ; not necessary here, but a good habit to follow
   ; get several records at once
   s = !g.lineoutio->get_spectra(index=0)
   dcaccum,a,s
   data_free,s ; be sure to clean up, else leaks memory
   s = !g.lineoutio->get_spectra(index=1)
   dv = dcvshift, a, s ; align in velocity
   dcshift, a, dv ; actually do the shift to align
   dcaccum,a,s
   data_free, s
   accumave,a,s
   show, s
   data_free, s  
 
See ave for additional examples.
Uses
accumulate data_valid data_free
Version
$Id: dcaccum.pro,v 1.5 2005/06/02 17:10:43 bgarwood Exp $

Parameters
accumbuf
in/out, required
variable
The structure containing the accumulation that you want to add to.
dc
in
spectrum
The data container to accum.

Keywords
weight
in, optional
float
The weight to use for this data. If this is not set, a weight of exposure/Tsys^2 will be used.


Produced by IDLdoc 1.6 on Thu Jun 2 23:56:55 2005