The mean needs to be an array in the format of nbands (of the input file) x nclasses (the spectra you pass to it). Also the spectra will need to be resampled to match that of the image. You can use the following task for that:
http://www.harrisgeospati...plespectrumtask.html You don't need to calculate the mean of a spectrum since each data point in a spectrum is the 'mean' for each wavelength, assuming you only have one spectrum for each input class. If you had a group of pixels (ROI or vector), then you would need to calculate the mean on those pixels, which would be the mean spectrum for that class.