Calculating luminosity and spectral class.