How can you tell what the colors represent when viewing a star with a telescope? If that makes sense! I mean how do you know if the blue is from the star shifting towards you [via the Doppler effect] or whether it is because of the elements that are present, or the heat that is coming from it?
I know that you are supposed to be able to classify these things through the spectrum, but I don't understand how you can distinguish between them.
Good question. It is actually a somewhat complicated procedure, so let's start from the beginning. When you take a spectrum of a star (which physically consists of passing the light from it through a prism, or more realistically, a diffraction grating - something that will break the light up into its component colors), the information you get allows you to make a plot with wavelength (i.e. color) on the horizontal axis and intensity of the light on the vertical axis.
This plot will look roughly like something called a "blackbody curve." A blackbody curve is the fundamental shape that arises for anything that is thermally emitting: stars, a hot piece of iron, etc. The details of the curve are quite complicated and require quantum mechanics to understand, but here is a picture of a blackbody curve (for three different temperatures) from the Amazing Space website that you can look at to have some idea of what we're talking about:
The important feature of a blackbody curve (which you can see from the above graph) is that there is a correlation between the temperature of the object that is emitting the light and the wavelength at which the curve reaches its maximum value. (If this sounds confusing, think about heating up a piece of metal, which you've probably seen before - first it gets red hot, but as it is heated up more it will turn orange, yellow, etc. In other words, the wavelength of maximum emission, which is what your eyes register as the metal's color, is changing as it gets hotter.) The relationship between the temperature and the wavelength of maximum emission is known, so you can figure out a star's temperature by looking at the peak of the blackbody curve you get when you take its spectrum.
Now, when you take the spectrum of a star, you find that superimposed on the blackbody curve are several small peaks and dips, which are known as emission and absorption lines. These are usually due to molecules in the star's atmosphere emitting or absorbing light at a particular wavelength - i.e., either adding to or subtracting from the normal blackbody emission at that wavelength. Identifying which lines are due to which molecules is a bit of a tricky business in chemistry - it is done through a combination of theoretical modeling and experiments performed with molecules here on earth, etc. But there are a lot of molecules out there and a lot of wavelengths at which they can emit or absorb, depending on the temperature and the environment they are in, so sorting out what is due to what is a complicated procedure which involves careful comparisons back and forth between the theory and the data! Nonetheless, it is possible to use these absorption and emission lines to learn something about the chemical composition of a star.
Finally, on top of all of this, there is the Doppler effect, as you mentioned, which occurs when the star we observe is moving towards or away from us. The Doppler effect causes light of a particular wavelength to shift to a different wavelength - roughly speaking, it causes the entire curve we've been talking about, blackbody emission plus emission and absorption lines, to shift along the horizontal axis.
Of course, when you measure the curve at the telescope, you can't say right away where it's been "shifted from." All you known is what the curve looks like as measured from the earth, not what it would have looked like without the Doppler effect (i.e. if you had somehow been able to sit on the surface of the star and measure the curve there). The way we can measure the extent of the shift, however, is through the absorption and emission lines. This is a somewhat complicated procedure as well, but to give an oversimplified example, suppose you've done some theoretical calculations and you know that one particular absorption line is expected to be very strong in this star, much stronger and deeper than any of the other lines. You know what molecule this line is due to, so you know, either from theory or experiments on earth, what wavelength it should occur at - let's say 452 nanometers. So you go and look at the spectrum you've just taken, and you see exactly what you'd expect - a blackbody curve with absorption and emission lines superimposed on it, and one of these lines is much stronger than all of the others. However, it turns out that the line is at 465 nanometers, not 452 like you expected. Well, right there is the information you need to calculate the Doppler shift - you know that it shifted the curve 13 nanometers in the positive direction. Incidentally, this will allow you to calculate the speed of the star with respect to the earth, but also, knowing the Doppler shift allows you to shift the entire curve back to where it is "supposed to be" and then do everything I talked about above to figure out more things about the star - for example, measuring the peak wavelength to get the temperature, etc.
Well, as you can see, stellar spectra are pretty complicated things, but I hope this helped!
This page updated on June 27, 2015