Analysis of rocks using a multichannel emission spectrometer