apply_spectra function

Apply a function on the spectra of a Spectra* object