Keywords: class-average

Next: Setting the weights Up: IRAM Memo 2009-4 Averaging Previous: Test suites Contents

# Algorithm

The `AVERAGE` algorithm is based on a single run through the whole index. The spectra are averaged two by two, each output sum becoming an input spectrum when adding the next observation of the index.

This incremental method requires to associate a weight to the output/input sum, in concordance with the number and weights of the spectra already summed. Furthermore, this weight must be an array (one weight per channel), because the command allows to combine different spectra with different range of frequencies (e.g. `COMPOSITE` mode), i.e. not the same number of spectra may have contributed to each channel in the output sum.

The `ACCUMULATE` algorithm uses the same code but adds only two input spectra ( and ).

The algorithm described here apply only on spectra. The average of continuum drifts rely on specific routines which are not considered here.

Subsections

- Setting the weights
- Definition of the output spectrum
- Aligned spectra
- Non-aligned spectra
  - Resampling
  - Channel weight of a resampled spectrum
  - Output spectrum
- Data not available / bad channels
- Controls
- Output parameters
  - `GENERAL` section
  - `SPECTROSCOPIC` section
  - `BASE` section
  - `HISTORY` section
- Concatenation