how is atomic spectra produced