Backyard astrophysics:
Atmospheric extinction
For a number of years the idea of "backyard astrophysics" has been in the back of my mind. An example of this is to stand in your backyard one clear night and ponder why it is dark at all. (It is dark because the universe is quite empty and not infinitely old.) But we can make slightly more complex observations and use these to demonstrate other astronomical knowledge.
One kind of observation I make quite frequently is to take an image of the Sun (to count sunspots and measure their positions). These images are taken in raw format and a dark frame is subtracted. This means that the image values are proportional to the surface brightness. This would not be the case if I obtained JPEG images from the camera, which would involve a nonlinear contrast stretch. I take a note of how bright the centre of the solar disc is each day. I also calculate the Sun's altitude above the horizon at the time the image is taken. All images are taken with the same camera, lens, exposure time, ISO setting etc., so that the brightness values can be directly compared daytoday. Some of the observations are taken not from sea level, but from Cerro Paranal (Chile) at an altitude of 2600 m; these have to be considered separately. (Unfortunately, "altitude" is used both for altitude in metres above sea level and for altitude in degrees above the horizon.)
As you will have noticed yourself, the Sun is quite a bit fainter low on the horizon than when it is high in the sky. With almost a year's data my observations cover a certain range of solar altitudes, so that I can draw a diagram of measured brightness of the Sun against its altitude. This is shown by the crosses in Fig. 1. The brightness is clearly less when the Sun is low, and this is very much the case below about 25° or 20° altitude. Sadly, in winter, the Sun hardly rises to 10° altitude in Scotland. The Paranal observations lie noticeably above the sealevel observations.
To make more sense of the observation we need to approach the issue from the opposite  the theoretical  end. First, the Sun does not change in brightness, what we see is due to the Earth's atmosphere. When we look straight up there is relatively little of it in our way, but when we look along the horizon there is rather more atmosphere along the path that the light takes from the Sun to our camera. The problem is that the air particles absorb and scatter the light so that only part of it makes it along the straight line to the observer. The combination of absorption (molecules taking out photons to change their own state to one of higher energy) and scatter (molecules bouncing photons into a new direction) is called extinction. It is not only the gas, but also dust and aerosols that cause extinction.
Fig. 2: The airmass A is the relative path length though the atmosphere. At the zenith it is one by definition. At lower altitude h it is larger by a factor 1/sin(h). 
Assuming a locally flat Earth with a flat layer of atmosphere on top of it (Fig. 2), the airmass  the obstacle the atmosphere presents to the light on its way from the Sun or star to the observer  is simply
A = 1/sin(h)
But the airmass is not the whole story. As the light passes through the length measured by the airmass, the number of photons decreases not at a constant rate, but exponentially. We are familiar with the analogy from radioactivity: If a radioactive isotope has a half life of 30 years then it takes 30 years for the substance to be halved, after 60 years it has diminished to a quarter, and so on. The mathematical tool for this sort of problem is the exponential function exp(), and for extinction in the atmosphere we can write
B = B_{0} exp(k A)
B: brightness after passage through the atmosphere
B_{0}: brightness outside the atmosphere
The airmass itself is not enough to describe what happens to the light. The number k  similar to radioactive half life  indicates how much the light is weakened by an airmass of one. That's nice maths, but how does it help us? We need even more maths, I'm afraid, namely logarithms. That does not actually add to the complication, because the natural logarithm ln() is simply the inverse function of the exponential. In the equation above we can take the logarithm on each side and arrive at an equivalent  but more helpful  description:
ln(B) = ln(B_{0})  k A
This may not look more helpful, but it is. This is the description of a straight line! The line falls with a slope of k. What we have to do to make the line visible is not to plot B against altitude h (Fig. 1), but to plot ln(B) against airmass A (Fig. 3, note that altitude increases to the left in this plot).

Now you see how the data points make a straight line. The scatter in the observations is due to the weather variation from day to day. It is valid to look particularly at the high points, because those points will arise from similarly good weather. The two straight lines are "fitted by eye". We need separate lines for sea level and high altitude, but both lines must intersect at airmass zero. This is because the brightness value at airmass zero is the brightness of the Sun or star outside the atmosphere.
 
Tab. 1:
Summary of results. Airmass at four different altitudes, brightness corrected for extinction. Separate for each altitude above sea level the parameter k and the fraction of light left at various altitudes above the horizon. 
Tab. 1 illustrates the meaning of the lines we've drawn in Fig. 3. The corresponding curves are in Fig. 1, where they are of more practical use. Even a star at the zenith has already lost 15 % of its light, more light is lost if the star is at lower altitude above the horizon. Above 30° this is still acceptable, but for objects lower than that we should have a think whether we can observe it at another time when it is higher. This is even more the case when observing at high magnification (planets, the Moon, etc.) because the image quality will also degrade with increasing airmass. Alas, usually the answer is that we have to observe even at low altitude. We want to count sunspots in winter as well as in summer, a close Mars opposition is always at southerly declination, Mercury is never far from the Sun, the weather may not be good another time, and so on.
We can convert the extinction factor into a loss of stellar magnitude with the formula
Δm = 2.5 lg[exp(k A)]
lg() is the decadic logarithm and not the natural logarithm ln() we used above; the difference is a factor ln(10) = 2.3026. If we take an observation from Edinburgh at 90° altitude, the atmosphere dims a star by almost 0.2 mag. Compare this to the extinction caused by dust and gas in interstellar space: In the plane of the Milky Way but avoiding any dark clouds the extinction is about 0.3 mag/kpc. So in one sense at least, our few tens of kilometres of atmosphere are as thick as about 600 pc (2000 light years or 19,000,000,000,000,000 km) of interstellar space. Since space travel began we have come to think of our atmosphere as a very thin and fragile shield against what Sun and stars throw at us, and this is true. It is in mass equivalent to only 10 metres of depth into the oceans. But compared to interstellar space it is  fortunately  very massive indeed.