add spectra calculation