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:
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.