Next: Definition of the output Up: Algorithm Previous: Algorithm   Contents

## Setting the weights

The Fortran type observation in CLASS provides a weight array (obs%dataw) for each observation. It has the same dimension of the abscissa and data arrays. One must take care that this array is not part of the CLASS data format, i.e. it is not saved in the observation when it is written in the output file. As a consequence, before adding any new spectrum, AVERAGE and ACCUMULATE will fill this array according to the SET WEIGHT method:

• EQUAL: the weight array is filled with 1.0 values,
• TIME: the weight is set to , where is the integration time in seconds, the frequency resolution in Hertz, and the system temperature in Kelvin. If the integration time is null, an error is raised.
• SIGMA: the weight is set to , where is the rms noise in Kelvin. If it is null or not set 2 in the observation header, an error is raised.
This value is unique for a single observation, and all the channels have the same weight. Any previous values set in obs%dataw are ignored and overwritten. On the other hand, the weight array of the ongoing sum is preserved. This ensures its correct ponderation in front of the input spectrum.

This method implies that all the weight arrays of the spectra of the index are recomputed from scratch before addition. If a sum (returned by a previous call to AVERAGE or ACCUMULATE) is used again as input, the memory of all spectra it comes from (their number and their different weights along all the channels) will be lost. One should take care that AVERAG'ing the whole index leads into different results than AVERAG'ing it by part! This is similar to first calculate two weighted means but then calculate a new mean from these without taking into account their weights.

Next: Definition of the output Up: Algorithm Previous: Algorithm   Contents
Gildas manager 2014-07-01