Question: Apparently spectral solar radiation is approximated by a black body at 5800 K. The spectral black body distribution (Planck distribution) is shown below (from Incropera, Fundamentals of Heat and Mass Transfer), with different temperatures including solar radiation at 5800 K.

[![enter image description here](https://i.stack.imgur.com/TP3kf.png)](https://i.stack.imgur.com/TP3kf.png)

1. The heat flux on an Earth surface perpendicular to sun rays (i.e., the solar constant), is roughly 1.36 kilowatts per square meter. Is this simply the integral of the above distribution?
2. Why is the sun approximated as a black body at 5800 K? Does this mean that the surface of the sun which is emitting radiation has a temperature of 5800 K? That seems kind of low.
3. Is solar radiation approximated as a black body at 5800 K only on Earth, or is it the same everywhere? Why don't atmospheric effects and scattering change measurements of the solar spectrum on Earth?

**EDIT:** 
The solar constant is approximated by considering the Stefan-Boltzmann law (i.e., the integration of the spectral solar emission), the size of the sun, and the distance from the sun to Earth. A good derivation is shown here: <https://www.youtube.com/watch?v=DQk04xqvVbU>

Answer: 
1. Yes - the integral of the spectrum you refer to gives the total power per unit area emitted from the surface of the sun. If you multiply that by a factor of $\left(\frac{\text{Solar Radius}}{1\text{ AU}}\right)^2$ to account for the $1/r^2$ dependence of intensity on distance, then you'll get the solar constant you quote.
2. Yes. The sun is not at a single uniform temperature - the radiation which reaches Earth is mostly emitted from the photosphere (~6000 K) but the temperature varies dramatically between the different layers of the sun.  

[![enter image description here](https://i.stack.imgur.com/ecLZa.png)](https://i.stack.imgur.com/ecLZa.png)

[Source](http://hinode.nao.ac.jp/en/intro/science/discovery.html)

3. Everywhere. The sun is very nearly an ideal black body. This is a property of the sun, not of a particular vantage point from which you're observing it. Furthermore, atmospheric effects *dramatically* change measurements of the solar spectrum on Earth.  

The upper atmosphere blocks nearly all of the radiation at higher frequencies than UV, and quite a lot of the IR spectrum is absorbed and scattered by greenhouse gases. Visible light passes through without much trouble (which is a substantial part of why we evolved to be sensitive to those frequencies) but the facts that the sky is blue and that sunsets are beautiful demonstrate that the atmosphere scatters visible light as well.

[![enter image description here](https://i.stack.imgur.com/8cugX.png)](https://i.stack.imgur.com/8cugX.png)

[Source](https://en.wikipedia.org/wiki/File:Solar_spectrum_en.svg)
As a complement to the other answers, I'd like to point out that if you measure the solar spectrum at a very high resolution, you see very large variations in spectral radiance over very short wavelength scales. Here is a figure that I made for my PhD thesis to illustrate this:

[![High resolution solar spectrum](https://i.stack.imgur.com/afXXl.png)](https://i.stack.imgur.com/afXXl.png)

A high resolution solar spectrum ([source here](http://kurucz.harvard.edu/sun.html)) is plotted in grey and the same spectrum with degraded resolution is plotted in black. The lower panels show close-ups of smaller wavelength regions. This is the solar spectrum as seen from space, i.e. there are no effects from Earth's atmosphere present.

These variations are due to a multitude of absorption lines (normally referred to as [Fraunhofer lines](https://en.wikipedia.org/wiki/Fraunhofer_lines)) caused by absorption from gases in the colder outer parts of the [photosphere](https://en.wikipedia.org/wiki/Photosphere) (and to some extent in the [chromosphere](https://en.wikipedia.org/wiki/Chromosphere)).

Hence, the ~5800 K black body spectrum is not a good description of the solar spectrum at very fine wavelength scales. But it's a reasonable approximation on larger scales.