Is it possible to calculate the relative abundances of elements in the sun based on its line spectrum using a common lab spectroscope? There are many problems that I feel would hinder the process: atmospheric noise, light pollution etc.
Let's assume that I bypass these problems and get an accurate emission line spectrum on the diffraction grating. How would I be able to convert these lines into quantitative data?
I hope the question makes sense. :)
 A: Using the basic equipment at your disposal, this will not be possible.
A naive approach would be to take the measured line amplitudes, divide by the line-integrated absorption coefficients at the wavelength of each line for some nominal set of parameters characteristic of the solar atmosphere, then divide out the emission coefficients and compare the results. However, the results you get from this process will be highly unreliable.
Calculating relative abundances based on emission or absorption spectra is in general rather complicated. Here are two of the main factors you have to take into account:


*

*Different lines are emitted from different parts of the solar atmosphere. The temperature and pressure vary throughout the photosphere, where most of the visible emission occurs. Unless you know where in the atmosphere each emitting ion is concentrated, the parameters used to obtain your absorption coefficients will be based on guesswork.

*A related concern is the optical depth; there will be absorption and re-emission of light from lower parts of the atmosphere. This will skew your results so that you measure higher intensities (or less absorption) for lines emitted from regions with a lower optical thickness. The opacity of the solar atmosphere also varies with wavelength, further complicating the issue.


To account for these factors, astronomers have developed model photospheres. By running these simulations with an assumed set of elemental abundances, synthetic spectra are generated which can then be compared with the measured spectra for consistency.
A: What emission lines? Unless you are looking at the chromosphere or corona the Sun does not have emission lines.
Of course you can estimate photospheric abundances from a photospheric absorption line spectrum. That is how the solar abundances are estimated for most elements.
However, you need a good spectrum to perform a detailed analysis. It should have high spectral resolution (at least 10,000 and preferably 50,000) and high signal to noise ratio (not usually a problem).
To estimate abundances you need access to a spectrum synthesis code such as SME or MOOG. You can use these to fit the spectrum using the abundances as free parameters. Or you could measure line equivalent widths for lines with a variety of excitation potentials, and preferably different ionisation stages, and then do a traditional curve of growth and ionisation balance analysis. If not much of the above makes sense then you need to start by reading a book on stellar atmospheres, such as the classic by David Gray. The observation and analysis of stellar photospheres.
