Planck and thermal radiation

Overview

This module provides functions for Planck law exitance calculations, as well as temperature derivative calculations. The functions provide spectral exitance in [W/(m^2.*)] or [q/(s.m^2.*)], given the temperature and a vector of one of wavelength, wavenumbers or frequency (six combinations each for exitance and temperature derivative). The total exitance can also be calculated by using the Stefan-Boltzmann equation, in [W/m^2] or [q/(s.m^2)]. ‘Exitance’ is the CIE/ISO term for the older term ‘emittance’.

The Planck and temperature-derivative Planck functions take the spectral variable (wavelength, wavenumber or frequency) and/or temperature as either a scalar, a single element list, a multi-element list or a numpy array.

Spectral values must be strictly scalar or shape (N,) or (N,1). Shape (1,N) will not work.

Temperature values must be strictly scalar, list[M], shape (M,), (M,1), or (1,M). Shape (Q,M) will not work.

If the spectral variable and temperature are both single numbers (scalars or lists with one element), the return value is a scalar. If either the temperature or the spectral variable are single-valued, the return value is a rank-1 vector. If both the temperature and spectral variable are multi-valued, the return value is a rank-2 array, with the spectral variable along axis=0.

This module uses the CODATA physical constants. For more details see http://physics.nist.gov/cuu/pdf/RevModPhysCODATA2010.pdf

See the __main__ function for testing and examples of use.

This package was partly developed to provide additional material in support of students and readers of the book Electro-Optical System Analysis and Design: A Radiometry Perspective, Cornelius J. Willers, ISBN 9780819495693, SPIE Monograph Volume PM236, SPIE Press, 2013. http://spie.org/x648.html?product_id=2021423&origin_id=x646

Module classes

class pyradi.ryplanck.PlanckConstants

Precalculate the Planck function constants using the values in scipy.constants. Presumbly these constants are up to date and will be kept up to date.

This module uses the CODATA physical constants. For more details see http://physics.nist.gov/cuu/pdf/RevModPhysCODATA2010.pdf

printConstants()

Print Planck function constants.

Args:
None
Returns:
Print to stdout
Raises:
No exception is raised.

Module functions

pyradi.ryplanck.planck(spectral, temperature, type='el')

Planck law spectral exitance.

Calculates the Planck law spectral exitance from a surface at the stated temperature. Temperature can be a scalar, a list or an array. Exitance can be given in radiant or photon rate units, depending on user input in type.

Args:
spectral (scalar, np.array (N,) or (N,1)): spectral vector.
temperature (scalar, list[M], np.array (M,), (M,1) or (1,M)): Temperature in [K]
type (string):
‘e’ signifies Radiant values in [W/m^2.*].
‘q’ signifies photon rate values [quanta/(s.m^2.*)].
‘l’ signifies wavelength spectral vector [micrometer].
‘n’ signifies wavenumber spectral vector [cm-1].
‘f’ signifies frequency spectral vecor [Hz].
Returns:
(scalar, np.array[N,M]): spectral radiant exitance (not radiance) in units selected.
For type = ‘el’ units will be [W/(m^2.um)].
For type = ‘qf’ units will be [q/(s.m^2.Hz)].
Other return types are similarly defined as above.
Returns None on error.
Raises:
No exception is raised, returns None on error.
pyradi.ryplanck.dplanck(spectral, temperature, type='el')

Temperature derivative of Planck law exitance.

Calculates the temperature derivative for Planck law spectral exitance from a surface at the stated temperature. dM/dT can be given in radiant or photon rate units, depending on user input in type. Temperature can be a scalar, a list or an array.

Args:
spectral (scalar, np.array (N,) or (N,1)): spectral vector in [micrometer], [cm-1] or [Hz].
temperature (scalar, list[M], np.array (M,), (M,1) or (1,M)): Temperature in [K]
type (string):
‘e’ signifies Radiant values in [W/(m^2.K)].
‘q’ signifies photon rate values [quanta/(s.m^2.K)].
‘l’ signifies wavelength spectral vector [micrometer].
‘n’ signifies wavenumber spectral vector [cm-1].
‘f’ signifies frequency spectral vecor [Hz].
Returns:
(scalar, np.array[N,M]): spectral radiant exitance (not radiance) in units selected.
For type = ‘el’ units will be [W/(m2.um.K)]
For type = ‘qf’ units will be [q/(s.m2.Hz.K)]
Other return types are similarly defined as above.
Returns None on error.
Raises:
No exception is raised, returns None on error.
pyradi.ryplanck.stefanboltzman(temperature, type='e')

Stefan-Boltzman wideband integrated exitance.

Calculates the total Planck law exitance, integrated over all wavelengths, from a surface at the stated temperature. Exitance can be given in radiant or photon rate units, depending on user input in type.

Args:
(scalar, list[M], np.array (M,), (M,1) or (1,M)): Temperature in [K]
type (string): ‘e’ for radiant or ‘q’ for photon rate exitance.
Returns:
(float): integrated radiant exitance in [W/m^2] or [q/(s.m^2)].
Returns a -1 if the type is not ‘e’ or ‘q’
Raises:
No exception is raised.
pyradi.ryplanck.planckel(spectral, temperature)

Planck function in wavelength for radiant exitance.

Args:
spectral (scalar, np.array (N,) or (N,1)): wavelength vector in [um]
temperature (scalar, list[M], np.array (M,), (M,1) or (1,M)): Temperature in [K]
Returns:
(scalar, np.array[N,M]): spectral radiant exitance in W/(m^2.um)
Raises:
No exception is raised, returns None on error.
pyradi.ryplanck.plancken(spectral, temperature)

Planck function in wavenumber for radiant exitance.

Args:
spectral (scalar, np.array (N,) or (N,1)): wavenumber vector in [cm^-1]
temperature (scalar, list[M], np.array (M,), (M,1) or (1,M)): Temperature in [K]
Returns:
(scalar, np.array[N,M]): spectral radiant exitance in W/(m^2.cm^-1)
Raises:
No exception is raised, returns None on error.
pyradi.ryplanck.planckef(spectral, temperature)

Planck function in frequency for radiant exitance.

Args:
spectral (scalar, np.array (N,) or (N,1)): frequency vector in [Hz]
temperature (scalar, list[M], np.array (M,), (M,1) or (1,M)): Temperature in [K]
Returns:
(scalar, np.array[N,M]): spectral radiant exitance in W/(m^2.Hz)
Raises:
No exception is raised, returns None on error.
pyradi.ryplanck.planckql(spectral, temperature)

Planck function in wavelength domain for photon rate exitance.

Args:
spectral (scalar, np.array (N,) or (N,1)): wavelength vector in [um]
temperature (scalar, list[M], np.array (M,), (M,1) or (1,M)): Temperature in [K]
Returns:
(scalar, np.array[N,M]): spectral radiant exitance in q/(s.m^2.um)
Raises:
No exception is raised, returns None on error.
pyradi.ryplanck.planckqn(spectral, temperature)

Planck function in wavenumber domain for photon rate exitance.

Args:
spectral (scalar, np.array (N,) or (N,1)): wavenumber vector in [cm^-1]
temperature (scalar, list[M], np.array (M,), (M,1) or (1,M)): Temperature in [K]
Returns:
(scalar, np.array[N,M]): spectral radiant exitance in q/(s.m^2.cm^-1)
Raises:
No exception is raised, returns None on error.
pyradi.ryplanck.planckqf(spectral, temperature)

Planck function in frequency domain for photon rate exitance.

Args:
spectral (scalar, np.array (N,) or (N,1)): frequency vector in [Hz]
temperature (scalar, list[M], np.array (M,), (M,1) or (1,M)): Temperature in [K]
Returns:
(scalar, np.array[N,M]): spectral radiant exitance in q/(s.m^2.Hz)
Raises:
No exception is raised, returns None on error.
pyradi.ryplanck.dplnckel(spectral, temperature)

Temperature derivative of Planck function in wavelength domain for radiant exitance.

Args:
spectral (scalar, np.array (N,) or (N,1)): wavelength vector in [um]
temperature (scalar, list[M], np.array (M,), (M,1) or (1,M)): Temperature in [K]
Returns:
(scalar, np.array[N,M]): spectral radiant exitance in W/(K.m^2.um)
Raises:
No exception is raised, returns None on error.
pyradi.ryplanck.dplncken(spectral, temperature)

Temperature derivative of Planck function in wavenumber domain for radiance exitance.

Args:
spectral (scalar, np.array (N,) or (N,1)): wavenumber vector in [cm^-1]
temperature (scalar, list[M], np.array (M,), (M,1) or (1,M)): Temperature in [K]
Returns:
(scalar, np.array[N,M]): spectral radiant exitance in W/(K.m^2.cm^-1)
Raises:
No exception is raised, returns None on error.
pyradi.ryplanck.dplnckef(spectral, temperature)

Temperature derivative of Planck function in frequency domain for radiant exitance.

Args:
spectral (scalar, np.array (N,) or (N,1)): frequency vector in [Hz]
temperature (scalar, list[M], np.array (M,), (M,1) or (1,M)): Temperature in [K]
Returns:
(scalar, np.array[N,M]): spectral radiant exitance/K in W/(K.m^2.Hz)
Raises:
No exception is raised, returns None on error.
pyradi.ryplanck.dplnckql(spectral, temperature)

Temperature derivative of Planck function in wavenumber domain for radiance exitance.

Args:
spectral (scalar, np.array (N,) or (N,1)): wavelength vector in [um]
temperature (scalar, list[M], np.array (M,), (M,1) or (1,M)): Temperature in [K]
Returns:
(scalar, np.array[N,M]): spectral radiant exitance in q/(K.s.m^2.um)
Raises:
No exception is raised, returns None on error.
pyradi.ryplanck.dplnckqn(spectral, temperature)

Temperature derivative of Planck function in wavenumber domain for photon rate.

Args:
spectral (scalar, np.array (N,) or (N,1)): wavenumber vector in [cm^-1]
temperature (scalar, list[M], np.array (M,), (M,1) or (1,M)): Temperature in [K]
Returns:
(scalar, np.array[N,M]): spectral radiant exitance in q/(s.m^2.cm^-1)
Raises:
No exception is raised, returns None on error.
pyradi.ryplanck.dplnckqf(spectral, temperature)

Temperature derivative of Planck function in frequency domain for photon rate.

Args:
spectral (scalar, np.array (N,) or (N,1)): frequency vector in [Hz]
temperature (scalar, list[M], np.array (M,), (M,1) or (1,M)): Temperature in [K]
Returns:
(scalar, np.array[N,M]): spectral radiant exitance in q/(K.s.m^2.Hz)
Raises:
No exception is raised, returns None on error.
pyradi.ryplanck.fixDimensions(planckFun)

Decorator function to prepare the spectral and temperature array dimensions and order before and after the actual Planck function. The Planck functions process elementwise and therefore require flattened arrays. This decorator flattens, executes the planck function and reshape afterwards the correct shape, according to input.