WEIN'S DISPLACEMENT LAW

For this tutorial, we will learn more about Wein's Displacement Law and how it can be used to calculate the dominant wavelength exiting a blackbody radiator. We will use Python, Numpy and Matplotlib to plot the blackbody radiation curves for various celestial objects.

Art and Web Design

Contact me for information about rates and availability.

Wein's Displacement Law

Wien's displacement law can be used to describe the relationship between the true temperature of a blackbody (T) in degrees Kelvin and its peak spectral exitance, or dominant wavelength (λmax). The dominant wavelength of an object is important to thermal remote sensing and can be used to classify stars based on their temperature.

λmax = k / T
k = 2892 μm
T = temperature of object (in Kelvin)

where k is a constant equaling 2898 μm K. We can determine the dominant wavelength of any object by substituting its temperature into the above equation.

There is a shift from longer to shorter wavelengths as the temperature of the blackbody increases. A blackbody is a hypothetical object, first described by Max Planck in 1900, that absorbs all incident electromagnetic radiation while still maintaining thermal equilibrium. This suggests that light is not reflected from or passes through the object, but radiation is emitted from the object, this is called blackbody radiation.

We can use this knowledge to determine the dominant wavelength of a particular star, based on its temperature, and accurately determine it's color based on it's peak spectral exitance. This is because stars approximate blackbody radiators, whose visible colors depend on the temperature of the radiator. When the temperature of a blackbody radiator increases, the radiant exitant energy increases and the peak of the radiation curve therefore moves to shorter wavelengths.

Our sun, for example, is a main sequence (G2V type) yellow dwarf star about 6000 K at it's surface. The dominant wavelength for a 6000 K star is 0.48 μm (480 nm). We can calculate the Sun's dominant wavelength using Python.

>>> k = 2892 # micrometers
>>> T = 6000 # degrees Kelvin
>>>lambda_max = k / T
0.483

You can convert the wavelength from micrometers to nanometers by multiplying λmax by 103.

>>>lambda_max * 10**3 # convert from micrometers to nanometers
483.0

Likewise, we can calculate the dominant wavelength of the Earth. Using 300 K for its temperature, the Earth's dominant wavelength is 9.66 μm (9660 nm). In Python this will look like.

>>> T = 300 # degrees Kelvin
>>> lambda_max = k / T
>>> lambda_max * 10**3 # convert from micrometers to nanometers
9660.0

Next we will plot the blackbody radiation curves for various stars, ranging in temperature from 4000 K to 7000 K using Python, Numpy and Matplotlib.

Stars are blackbody radiators whose visible color depends of the temperature of the radiator. From the dominant wavelength, we can approximate a star's temperature using Wein's displacement law.

Before we begin calculating the blackbody radiation curves, let us gather some information. The below table shows each band of the electromagnetic spectrum, with their related wavelengths and frequencies. This information will be useful when we calculate the dominant wavelength of various stars, as it tells us the approximate color of each star based on their temperature.

Band Wavelength Frequency
Gamma Rays < 10 pm > 30 EHz
X Rays 0.01 - 10 nm 30 EHz - 30 PHz
UV 10 - 400 nm 30 PHz - 790 THz
Violet 380 - 450 nm 668 - 789 THz
Blue 450 - 495 nm 606 - 668 THz
Green 495 - 570 nm 526 - 606 THz
Yellow 570 - 590 nm 508 - 526 THz
Orange 590 - 620 nm 484 - 508 THz
Red 620 - 750 nm 400 - 484 THz
Near IR 0.7 μm - 1.4 μm 214 - 400 THz
Short IR 1.4 - 3 μm 30 PHz - 790 THz
Mid IR 3 - 8 μm 30 PHz - 790 THz
Long IR 8 - 15 μm 30 PHz - 790 THz
Far IR 15 - 1000 μm 30 PHz - 790 THz
Microwaves 1 mm - 1 m 300 GHz - 300 MHz
Radoiwaves 1 m - 100000 km 300 MHz - 3 Hz

Next, make sure that you have properlly installed the Numpy and Matplotlib libraries. You can do this for both using the pip install command.

$pip install numpy$ pip install matplotlib

Now we can build our application. You can download the following code from my Github repository.

########################################################
#                                                      #
#                 Spectral Classifier                  #
#            Written by Johnathan Nicolosi             #
#                                                      #
########################################################

import matplotlib.pyplot as plt
import numpy as np

h = 6.626e-34
c = 3.0e+8
k = 1.38e-23

def planck(wav, T):
a = 2.0*h*c**2
b = h*c/(wav*k*T)
intensity = a/((wav**5) * (np.exp(b) - 1.0))
return intensity

# generate x-axis in increments from 1nm to 3 micrometer in 1 nm increments
# starting at 1 nm to avoid wav = 0, which would result in division by zero.
wavelengths = np.arange(1e-9, 3e-6, 1e-9)

# intensity at 4000K, 5000K, 6000K, 7000K
intensity4000 = planck(wavelengths, 4000.)
intensity5000 = planck(wavelengths, 5000.)
intensity6000 = planck(wavelengths, 6000.)
intensity7000 = planck(wavelengths, 7000.)

fig = plt.figure()

# Horizontal "axis" across the centre of the wave
# ax.axhline(c='w')
# Ditch the y-axis ticks and labels; label the x-axis
ax.set_ylabel('Power density ($10^{13} watts/m^3$)')
ax.set_xlabel(r'$\lambda\;(\mathrm{nm})$')

# Label and delimit the different regions of the electromagnetic spectrum
ax.text(1, 1.5, 'X Ray', color='k', verticalalignment='top', fontdict={'fontsize': 12})
ax.text(220, 1.5, 'UV', color='k', verticalalignment='top', fontdict={'fontsize': 12})
ax.text(480, 1.5, 'Visible', color='k', verticalalignment='top', fontdict={'fontsize': 12})
ax.text(1200, 1.5, ' Near Infrared', color='k', verticalalignment='top', fontdict={'fontsize': 12})
ax.text(2700, 1.5, ' IR', color='k', verticalalignment='top', fontdict={'fontsize': 12})

# Finally, add some colourful rectangles representing a rainbow in the
# visible region of the spectrum.
# Dictionary mapping of wavelength regions (nm) to approximate RGB values
rainbow_rgb = { (380, 440): '#8b00ff', (440, 460): '#4b0082',
(460, 495): '#0000ff', (495, 570): '#00ff00',
(570, 590): '#ffff00', (590, 620): '#ff7f00',
(620, 750): '#ff0000', (750, 2200): '#E60000'}
for wv_range, rgb in rainbow_rgb.items():
ax.axvspan(*wv_range, color=rgb, ec='none', alpha=1)

plt.hold(True) # doesn't erase plots on subsequent calls of plt.plot()
plt.plot(wavelengths*1e9, intensity4000, 'r-', label='4000 K')
plt.plot(wavelengths*1e9, intensity5000, 'g-', label='5000 K') # 5000K green line
plt.plot(wavelengths*1e9, intensity6000, 'b-', label='6000 K') # 6000K blue line
plt.plot(wavelengths*1e9, intensity7000, 'k-', label='7000 K') # 7000K black line

ax.legend()

# show the plot
plt.show()


Executing this script creates in the following diagram, which shows the dominant wavelength of various stars ranging in temperature from 4000 K to 7000 K.

These blackbody radiation curves, also known as Planck Curves, describe the continuous spectra for stellar interiors. The outward appearance of stars depends more on the underlying continuous spectrum coming from the inner parts of a star than the absorption at its surface. The following table lists corresponding values of color, spectral type, temperature and peak wavelength (λmax). Note that we are talking about the surface temperature of a star.

Classification Temperature λmax Color
O0 40,000 K 72.5 nm Blue
B0 20,000 K 145 nm Light Blue
A0 10,000 K 290 nm White
F0 7,500 K 387 nm Yellow-White
G0 5,500 K 527 nm Yellow
K0 4,000 K 725 nm Orange
M0 3,000 K 966 nm Red

Remote Sensing Applications

The relationship between the temperature of a blackbody and it's peak spectral exitance is known as Wein's displacement law, and is useful for determining the temperature of radiant objects such as stars. This can also be used to determine the temperature of any radiant object whose temperature exceeds that of its surroundings. The dominant wavelength provides valuable information regarding parts of the thermal infrared spectrum in which we want to sense the object.

From a remote sensing perspective, we would consider the temperature ranges of the phenomenon which we hope to detect. For example, if we are observing 800 K forest fires with a dominant wavelength of approximately 3.62 μm, then we would choose a remote sensing system that uses a 3 - 5 μm thermal infrared detector. Likewise, if we wanted to observe the soil, water or other surface object, which is approximately 300 K with a dominant wavelength of 9.67 μm, then we would pick a thermal infrared detector that operates in the 8 - 14 μm region.

Johnathan Nicolosi - 22 Oct 2018