Declaration: MeanSpecUnmasked(Mask, TimeStart, TimeEnd, Group: integer; var Spectrum: TDoubleArray): integer;

MeanSpecUnmasked calculates the mean spectrum of all pixels which are not masked by the mask specified by the parameter Mask (valid range: 1..32). The parameters TimeStart and TimeEnd determine the range of time slots which are used for the calculation, the parameter Group specifies the spectral group which is to be averaged. The calculated mean spectrum is returned in the variable parameter Spectrum.

The function returns the following error codes:

 0 ... everything is OK
-1 ... no such group
-2 ... time slot is out of range
-3 ... invalid mask number