split function

Split a Spectra* object using factors