Physics 101: Planck law

Post Reply
Thibault N
Posts: 19
Joined: Mon Aug 05, 2019 2:42 pm

Physics 101: Planck law

Post by Thibault N »

Dear all,

I am trying to understand a bit more the planck law, and more specifically, the meaning of the spectral radiance from the wikipedia article https://en.wikipedia.org/wiki/Planck%27s_law

I realize that the unit of spectral radiance might be a bit complicated to understand for someone not familiar with physics like me, more specifically, I "feel" like somehow spectral radiance can be understood as amount of energy that is emitted by the object per steradian, given a surface unit of the object over a unit of time.

Even there I am not sure, please correct me if so.

However, what bothers me the most, is that, from a signal processing point of view, it feels like, given a theoretical sensor/spectrometer with a flat quantum efficiency curve over the whole spectrum of interest, the spectrometer would show a curve that is quite different from Planck law for a given black body, if we simply assume that, as energy per photon decreases with wavelength, while the quantum efficiency makes the sensor to generate the same number of ADU per received photon, we should expect a spectrometer curve in ADU that gives much more intensity than the planck curve in flux for the larger wavelength.

I guess there are normalization function to convert from ADU/Photon counts to energy and in the reverse order, but actually I don't know what is the standard in spectroscopy workflow.

Thank you very much in advance for your help
Benjamin Mauclaire
Posts: 258
Joined: Thu Sep 29, 2011 10:14 am

Re: Physics 101: Planck law

Post by Benjamin Mauclaire »

Hello,

You forget an information given by Planck law: spectral radiance reaches a maximum at a specific temperature.
This means that there a more photons produced with a given wavelength bandwidth than others.
Therefore even if photon's energy is lower at higher wavelength, source's spectral radiance depends on source's temperature.

Finally, what is observed in a unprocessed star's spectrum is the product of the following transmission signals (fonction de transfert):
- star's spectrum
- spectrograph's instrumental response
- camera's instrumental response
- telescope's instrumental response
The last three contributions is the so called "intrumental response".
In this signal processing point of view, sensor's quantum efficiency isn't a transmission signal but is probably closed to.

If you do a processing with an archive of star (often given in software tutos), yes you will find an instrumental response more intense in red part of the spectrum. You should practice such tutos to "tuch" experimental reality, for example:
http://spcaudace.free.fr/docs/index.php ... lcop1.html

Benjamin
Spcaudace spectroscopy software: saving you hundred hours of frustration.
Thibault N
Posts: 19
Joined: Mon Aug 05, 2019 2:42 pm

Re: Physics 101: Planck law

Post by Thibault N »

Thank you very much for your help Benjamin. I will take a look at this example.

I also realize that when it is written that the reference star spectrum is calibrated in flux it means that we calibrate instrument response for potentially any linear/affine effect so that adu can be converted to a value proportional to a flux.

Things are getting more clear to me, I really need to go through a whole example to get a better take on what is going on.

Thank you for your help
Thibault N
Posts: 19
Joined: Mon Aug 05, 2019 2:42 pm

Re: Physics 101: Planck law

Post by Thibault N »

Ok I am slowly moving forward, thank you Benjamin also for poiting out Wien's displacement law and spectral radiance expressed per bandwidth

Indeed I was reallu sirprised to realize, thank to the wikipedia article: https://en.m.wikipedia.org/wiki/Wien%27 ... cement_law# that maximum spectral radiance is different when expressed in frequency and when expressed in wavelength.

And the difference is quite significant !
As on our spectroscopes, the spectrum is spread across the sensor along the wavelength axis (at least it is calibrated with the polynomial to do so) we can safely use the wavelength expression of planck law/wien's displacement to fit to a model.

I find this particularly interesting though to notice that if one would like to choose the best sensor to detect a blabk body at a specific temperature, one should compute the product of sensor spectral response with black body spectral radiance in the same domain (either frequency or wavelength).

Looking at the maxima only is far from being sufficient.

Anyway sorry for this long post that states only obvious things.

Regards!
Thibault N
Posts: 19
Joined: Mon Aug 05, 2019 2:42 pm

Re: Physics 101: Planck law

Post by Thibault N »

Ok, I think I would share, in case other people might be wondering what is the link between various expression of Planck law (wavelength based or frequency based) that eventually result in a completely different profile.

This is especially useful for people working with astropy I guess, because BlackBody module by default use the frequency based expression. I hereby reproduce an exemple of different profiles that are generated depending on the unit you choose.
BBforSpectro.png
BBforSpectro.png (66.63 KiB) Viewed 24808 times
Robin Leadbeater
Posts: 1929
Joined: Mon Sep 26, 2011 4:41 pm
Contact:

Re: Physics 101: Planck law

Post by Robin Leadbeater »

You occasionally see optical spectra plotted in Janskys. I was very confused the first time I saw one, it just did not look right :lol:

Robin
LHIRES III #29 ATIK314 ALPY 600/200 ATIK428 Star Analyser 100/200 C11 EQ6
http://www.threehillsobservatory.co.uk
Benjamin Mauclaire
Posts: 258
Joined: Thu Sep 29, 2011 10:14 am

Re: Physics 101: Planck law

Post by Benjamin Mauclaire »

Nice graphic.
But temperature's unit has to be corrected to K (neither °K nor °C).
Could you share your Python script?
Cheers,
Benji
Spcaudace spectroscopy software: saving you hundred hours of frustration.
Thibault N
Posts: 19
Joined: Mon Aug 05, 2019 2:42 pm

Re: Physics 101: Planck law

Post by Thibault N »

Sure, here is a direct copy/paste:
I need to correct for the celsius unit of the 3 references I took as an example. Otherwise, might actually be worth mentionning that the "frequency" part can be converted esily to Jansky unit (https://en.wikipedia.org/wiki/Jansky).

A more fine grained x-axis would also be worth, in order to have something more meaningful. I'll fix that soon.

Code: Select all

# Documentation for this module can be found here:
#https://docs.astropy.org/en/stable/api/astropy.modeling.physical_models.BlackBody.html?highlight=BlackBody

# Numerical stuff
import numpy as np

# Viz
import matplotlib.pyplot as plt

# Physics
from astropy.modeling.models import BlackBody
from astropy.visualization import quantity_support
from astropy.modeling import models
from astropy import units as u #https://docs.astropy.org/en/stable/units/

def get_astropy_bb(temp_deg):
    return models.BlackBody(temperature=(temp_deg*u.deg_C).to(
        u.K,equivalencies=u.temperature()))

# Define the whole range of wavelength
wav = np.arange(150, 2500) * u.nm
wav_unit = wav.unit
temp_range = [3000,4000,5000]
cm = plt.get_cmap('gist_rainbow')

colors = [cm(1. * i / len(temp_range)) for i in range(len(temp_range))]
alpha = 0.2
light_colors = [tuple(list(cm(1. * i / len(temp_range)))[:-1]+[alpha]) for i in range(len(temp_range))]

hz_flux_unit=u.Joule/(u.cm**2 * u.Hertz * u.second * u.steradian)
nm_flux_unit=u.W/(u.cm**2 * u.nanometer * u.steradian)

with quantity_support():
    fig, ax1 = plt.subplots(figsize=(16, 9))
    fig.suptitle("Black body spectral profile: frequency unit vs wavelength unit")
    ax1.set_xlabel("Wavelength $\lambda$ in nm")

    # Plot wavelength
    ax1.set_ylabel(f"Flux in {nm_flux_unit}")

    # Plot frequency
    ax2 = ax1.twinx()
    ax2.set_ylabel(f"Flux in {hz_flux_unit}")
    
    for temp_c, color, light_color in zip(temp_range, colors, light_colors):
        bb_astropy = get_astropy_bb(temp_c)
        flux_astropy = bb_astropy(wav)
        label = f"{(temp_c*u.deg_C).to(u.K,equivalencies=u.temperature())}"
        
        # Plot wavelength
        ax1.plot(wav, flux_astropy.to(nm_flux_unit, equivalencies=u.spectral_density(wav)), color=color,
                 label=label)
        # Mark maximum
        max_wav = bb_astropy.lambda_max.to(wav_unit, equivalencies=u.spectral())
        max_intensity = bb_astropy(max_wav).to(nm_flux_unit,equivalencies=u.spectral_density(max_wav))
        markerline, stemlines, baseline = ax1.stem([max_wav], [max_intensity], use_line_collection=True)
        plt.setp(stemlines, 'color', color)
        plt.setp(markerline, 'color', color)
        ax1.annotate(f"$\lambda$={max_wav:.2f}", xy=(max_wav,max_intensity), xycoords='data',
            xytext=(-10,10), textcoords='offset points')


        # Plot frequency
        ax2.plot(wav, flux_astropy.to(hz_flux_unit), color=light_color, label=label)
        # Mark maximum_
        max_wav = bb_astropy.nu_max.to(wav_unit, equivalencies=u.spectral())
        max_intensity = bb_astropy(max_wav).to(hz_flux_unit, equivalencies=u.spectral_density(max_wav))
        markerline, stemlines, baseline = ax2.stem([max_wav], [max_intensity], use_line_collection=True)
        plt.setp(stemlines, 'color', light_color)
        plt.setp(markerline, 'color', light_color)
        ax2.annotate(f"$\lambda$={max_wav:.2f}", xy=(max_wav,max_intensity), xycoords='data',
            xytext=(-10,10), textcoords='offset points')

    # More fine grained x-axis ticks
    start, end = ax1.get_xlim()
    ax1.xaxis.set_ticks(np.linspace(start, end, 25))

    # Nice legend
    ax1.legend( loc="upper left")
    ax2.legend(loc="upper right")

plt.show()
Attachments
nice_plot.png
nice_plot.png (76.12 KiB) Viewed 24541 times
Benjamin Mauclaire
Posts: 258
Joined: Thu Sep 29, 2011 10:14 am

Re: Physics 101: Planck law

Post by Benjamin Mauclaire »

Thanks Thibault.
Benji
Spcaudace spectroscopy software: saving you hundred hours of frustration.
Post Reply