Functions for blackbody thermal emission (and its derivatives) calculation
PlanckFunctions.PlanckFunctions — Module
PlanckFunctionsA comprehensive suite of tools for evaluating properties of the Planck thermal emission spectrum, including spectral intensity (radiance), integrated band power, and their ratios.
The module provides exact analytical derivatives with respect to both wavelength (λ) and temperature (T), optimized for high-performance physics and pyrometry calculations.
Core Design Principles
- Derivative Naming Convention: For any base function
foo, its first and second temperature derivatives are available via∇ₜfooand∇²ₜfoo. - Combined Evaluation: Functions prefixed with
Dₜ(e.g.,Dₜfoo) evaluate the base value, the first derivative, and the second derivative simultaneously, returning them as a singleTupleto prevent redundant calculations. - Functional Operators: The symbols
∇ₜ,Dₜand∇²ₜcan be used directly as operators on functions, mapping a base function to its corresponding derivative function (e.g.,PlanckFunctions.∇ₜ(PlanckFunctions.ibb) -> ∇ₜibb). The symbol∫ₗapplied on function maps it to its wavelength integrator
Physical Units
- Wavelength (λ): Microns (μm)
- Temperature (T): Kelvins (K)
API Reference
Spectral Radiance & Core Functions
ibb: Spectral intensity (spectral radiance) in [W/m²⋅sr⋅μm].∇ₜibb: First derivative of spectral intensity with respect to temperature [W/m²⋅sr⋅μm·K].∇²ₜibb: Second derivative of spectral intensity with respect to temperature [W/m²⋅sr⋅μm·K²].
All this functions has also and integrated versions , which can be obtained both by direct name or by applying the ∫ₗ ∫ₗ operator
Dₜibb: Base functions, its first and second derivative.ibb!,∇ₜibb!,∇²ₜibb!,Dₜibb!- in-place versions∇ₗibb: First derivative of spectral intensity with respect to wavelength [W/m²⋅sr⋅μm²].∇²ₗibb: Second derivative of spectral intensity with respect to wavelength [W/m²⋅sr⋅μm³].
Integrated Band Power
band_power,∇ₜband_power,∇²ₜband_power: Total integrated intensity within a specified wavelength region along with its temperature derivatives [W/m²⋅sr].
Analytical Ratios (Continuous Pyrometry)
spectral_ratio,∇ₜspectral_ratio,∇²ₜspectral_ratio: Ratio of spectral intensities at two distinct discrete wavelengths (useful for ratio pyrometers).spectral_band_ratio,∇ₜspectral_band_ratio,∇²ₜspectral_band_ratio: Ratio of integrated spectral intensities for two distinct wavelength bands.
Averaging & Continuum Mechanics
planck_averaged: Planck-averaged spectral quantity (e.g., total emittance).planck_averaged_attenuation: Planck-averaging applied specifically to spectral attenuation coefficients.rosseland_averaged_attenuation: Rosseland-averaging applied to spectral attenuation coefficients.weighted_average: General-purpose function to compute a custom weighted average over a spectrum.
Discrete/Tabular Integration (Experimental Data Pyrometry)
planck_weighted,∇ₜplanck_weighted,∇²ₜplanck_weighted,Dₜplanck_weighted: Integrates a discrete, wavelength-dependent experimental quantity (such as emissivity or detector response) weighted by the Planck function and its derivatives.planck_weighted_ratio,∇ₜplanck_weighted_ratio,∇²ₜplanck_weighted_ratio,Dₜplanck_weighted_ratio: Computes the ratio of two independent Planck-weighted discrete quantities and its analytical temperature derivatives.
Operators
PlanckFunctions.C₁ — Constant
C₁ constant for Planck function multiplier in [W⋅μm⁴/(m²⋅sr)]
source https://physics.nist.gov/PlanckFunctions.C₂ — Constant
C₂ constant for Planck spectral intensity exponent in [μm⋅K]
source https://physics.nist.gov/PlanckFunctions.C₃ — Constant
C₃ constant of Wien's displacement law [μm⋅K]
source https://physics.nist.gov/PlanckFunctions.C₃_∇₁ — Constant
Constant of the first derivaitve Wien's displacement
PlanckFunctions.C₃_∇₂ — Constant
Constant of the second derivaitve Wien's displacement
PlanckFunctions.C₄ — Constant
C₄ constant in equation for maximum blackbody intensity [W/(m²⋅μm⋅sr*K⁵)]
source https://physics.nist.gov/PlanckFunctions.c_big — Constant
Speed of light in vacuum
`c` [https://physics.nist.gov/] , m s^-1PlanckFunctions.h_big — Constant
Planck const
`h` [https://physics.nist.gov/] , J Hz^-1PlanckFunctions.kB_big — Constant
Boltzmann const
`kb` [https://physics.nist.gov/] , J K^-1PlanckFunctions.σ — Constant
Stefan-Boltzmann constant [W/(m²*K⁴)]source https://physics.nist.gov/
ChainRulesCore.frule — Method
frule((Δself, ΔT), ::typeof(band_power), T; λₗ=0.0, λᵣ=Inf, tol=1e-8)Forward-mode AD rule for band_power.
ChainRulesCore.frule — Method
frule((Δself, ΔT), ::typeof(band_power), T; λₗ=0.0, λᵣ=Inf, tol=1e-8)Forward-mode AD rule for band_power.
ChainRulesCore.frule — Method
frule((Δself, Δλ, ΔT), ::typeof(ibb), λ::Number, T::Number)Custom forward-mode automatic differentiation rule for the Planck function ibb(λ, T)
ChainRulesCore.rrule — Method
rrule(::typeof(ibb), λ::Number, T::Number)Custom reverse-mode automatic differentiation rule (pullback) for ibb(λ, T).
ChainRulesCore.rrule — Method
ChainRulesCore.rrule(
::typeof(band_power),
T::TT; λₗ::Number , λᵣ::Number
) where { TT<:Number}Custom reverse-mode automatic differentiation rule (pullback) for band_power(T; λₗ = λₗ , λᵣ = λᵣ).
PlanckFunctions.Dₗibb — Method
Dₗibb(λ,T)Returns a three-element tuple of (1.bb intensity,2.its first and 3.second derivative with respect to the wavelentgh)
Arguments:
λ - wavelength, μm T - temperature, K
PlanckFunctions.Dₜ — Function
Dₜ(f)
Differentiation operator returns the tuple of :(value of base function, its first derivative , its second derivative)
ibb , band_power , power , spectral_ratio , spectral_band_ratio , planck_weighted,planck_weighted_ratio
Must be implemented on user defined [`AbstractSpectralQuatity`](@ref) interface to performfast continuous function weighting derivatives evaluation
Examples
F = Dₜ(ibb) # -> Dₜibb
F(1273.15) == (ibb(1273.15) , ∇ₜibb(1273.15) , ∇²ₜibb(1273.15))
Dₜ(planck_weighted) # -> Dₜplanck_weightedPlanckFunctions.Dₜband_power — Method
Dₜband_power(T , skip_second_derivative::Val{true} ; λₗ=0.0 , λᵣ=Inf , tol=1e-8)returns the value and its derivative
PlanckFunctions.Dₜband_power — Method
Dₜband_power(T ; λₗ=0.0 , λᵣ=Inf , tol=1e-8)returns all derivatives
PlanckFunctions.Dₜibb! — Method
Dₜibb!(input_tuple, λ::AbstractVector,T)In-place filling the tuple of (bb intensity, its first ,and second ) derivatives with respect to temperature
Arguments:
input_tuple, {Nx0 vector or nothing , Nx0 vector or nothing, Nx0 vector or nothing} λ - wavelength, μm, [Nx0] T - temperature, K Out: input_tuple filled with ibb , dIbb/dT , d²Ibb/dT²
This version is slightly faster than calling each derivative separately
PlanckFunctions.Dₜibb — Method
Dₜibb( λ::Number, T::Number , skip_second_derivative::Val{true})Skips the second derivative evaluation Dₜibb( λ, T , Val(true))
PlanckFunctions.Dₜibb — Method
Dₜibb( λ::Number, T::Number)returns a tuple of (value, first derivative, second derivative)
PlanckFunctions.Dₜibb — Method
Dₜibb(λ::AbstractVector,T::AbstractVector)Calculates tuple of (Ibb,dIbb/dT,d²Ibb/dT²) calculated according to:
d²Ibb/dT² = C₁*(eᵃ¹/(eᵃ¹-1)²)*(C₂/(λ⁶*T³))*[(C₂/(λ*T))*(2*eᵃ¹/(eᵃ¹-1)-1)-2], d²Ibb/dT² = C₁*(eᵃ¹/(eᵃ¹-1)²)*(a₁/(λ⁵*T²))*[a₁*(2*eᵃ¹/(eᵃ¹-1) -1)-2], a₁=C₂/(λ*T), a₂ = 1/(eᵃ¹-1) , a₃ = eᵃ¹/(eᵃ¹-1) , d²Ibb/dT² = C₁*a₂*a₃*(a₁/(λ⁵*T²))*[a₁*(2*a₃ - 1))-2] as far as Ibb = (λ⁻⁵)* C₁*a₂ and dIbb/dT = C₁*a₃*a₂*a₁*(1/(λ⁵*T)) = a₃*a₁*Ibb/T hense d²Ibb/dT² = C₁*a₂*a₃*a₁*(1/(λ⁵*T²))*[a₁*(2*a₃ - 1))-2] = [a₃*a₁*Ibb/T^2]*[a₁*(2*a₃ - 1))-2] = [(dIbb/dT)/T]*[a₁*(2*a₃ - 1))-2]
Arguments:
λ - wavelength region, μm T - temperature, Kelvins
Returns:
(Ibb , dIbb/dT , d²Ibb/dT²)
PlanckFunctions.Dₜplanck_weighted — Method
Dₜplanck_weighted(e::AbstractVector{Q}, λ::AbstractVector{L}, T::D) where {Q <: Number, L <: Number, D <: Number}Evaluates the integral of e(λ) over three weighting functions of Planck's function , its first- and second- derivaitve: ibb, ∇ₜibb и ∇²ₜibb
Returns three-element tuple : ( ∫α(λ)ibb(λ,T)dλ , ∫α(λ)∇ₜibb(λ,T)dλ , ∫α(λ)∇²ₜibb(λ,T)dλ)
PlanckFunctions.Dₜplanck_weighted_ratio — Method
Dₜplanck_weighted_ratio(
α::AbstractSpectralQuantity,
band1::NTuple{2},
band2::NTuple{2},
T::D) where { D <: Number}
Returns the tuple of the value, first and second derivatives of two weighted values ratio :Returns
`( ∫α(λ)ibb(λ,T)dλ1 / ∫α(λ)ibb(λ,T)dλ2,
d/dT [ (∫α(λ)ibb(λ,T)dλ1 / ∫α(λ)ibb(λ,T)dλ2) ] ,
d²/dT² [ (∫α(λ)ibb(λ,T)dλ1 / ∫α(λ)ibb(λ,T)dλ2) ] )`
Arguments
α: AnAbstractSpectralQuantity(e.g., analytical or autodiff emissivity).band1: Tuple(λ_min, λ_max)for the first spectral band (numerator), μm.band2: Tuple(λ_min, λ_max)for the second spectral band (denominator), μm.T: Temperature, K.
PlanckFunctions.Dₜplanck_weighted_ratio — Method
Dₜplanck_weighted_ratio(
α1::AbstractVector{Q},
λ1::AbstractVector{L},
α2::AbstractVector{Q},
λ2::AbstractVector{L},
T::D ) where { D <: Number , Q <: Number , L <: Number}Returns the tuple of the value, first and second derivatives of two weighted values ratio :
Arguments
α1 - first wavelength dependent quantity, λ1 - first wavelengths range, μm α2- second wavelength dependent quantity, λ2- second wavelengths range, μm T - temperature , K
Returns
`( ∫α1(λ)ibb(λ,T)dλ1 / ∫α2(λ)ibb(λ,T)dλ2,
d/dT [ (∫α1(λ)ibb(λ,T)dλ1 / ∫α2(λ)ibb(λ,T)dλ2) ] ,
d²/dT² [ (∫α1(λ)ibb(λ,T)dλ1 / ∫α2(λ)ibb(λ,T)dλ2) ] )`
PlanckFunctions.Dₜplanck_weighted_values — Method
Dₜplanck_weighted_values(e::AbstractVector{Q}, λ::AbstractVector{L}, T::D) where {Q <: Number, L <: Number, D <: Number}Evaluates the integral of e(λ) over three weighting functions of Planck's function , its first- and second- derivaitve: ibb, ∇ₜibb и ∇²ₜibb
Returns six-elements tuple (integrals and normalizers) : ( ∫α(λ)ibb(λ,T)dλ , ∫α(λ)∇ₜibb(λ,T)dλ , ∫α(λ)∇²ₜibb(λ,T)dλ , ∫ibb(λ,T)dλ , ∫∇ₜibb(λ,T)dλ , ∫∇²ₜibb(λ,T)dλ)
PlanckFunctions.Dₜpower — Method
Dₜpower(T)Tuple of total intensity , fisrt and second derivative with respect to temeperature
PlanckFunctions.Dₜspectral_band_ratio — Method
Dₜspectral_band_ratio(λ1::NTuple{2, TL}, λ2::NTuple{2,TL}, T::Number , skip_second_derivative::Val{true}; tol = 1e-6) where TL <: NumberIgnores the second derivative evaluation
PlanckFunctions.Dₜspectral_band_ratio — Method
Dₜspectral_band_ratio(λ1::NTuple{2, TL}, λ2::NTuple{2,TL}, T::Number; tol = 1e-6) where TL <: NumberAll spectral band ratio derivatives are in one tuple
Arguments
λ1- tuple of left and right wavelength of the first band, in μm. λ2- tuple of left and right wavelength of the second band, in μm. T- Absolute temperature, in K.
PlanckFunctions.Dₜspectral_ratio — Method
Dₜspectral_ratio(λ1::Number, λ2::Number, T::Number)All spectral ratio derivatives in one tuple
Arguments
λ1- First wavelength (usually the shorter one), in μm. λ2- Second wavelength (usually the longer one), in μm. T- Absolute temperature, in K.
PlanckFunctions.attenuated_band_power — Method
attenuated_band_power(T, τ::AbstractVector, λ::AbstractVector; tol=1e-6)Evaluates the integrated band power of BB with temperature T reaching the detector, accounting for the spectral transmittance profile τ(λ).
Arguments:
T - temeperature , K τ - transmittance λ - wavelength , μm
PlanckFunctions.a₁₂₃! — Method
a₁₂₃!(amat::AbstractMatrix,λ::AbstractVector,T::Number)In-place filling of the intermediate matrix a₁=C₂/(λ*T) - amat first column a₂ = 1/(eᵃ¹-1) - amat second column a₃ = eᵃ¹/(eᵃ¹-1) - amat third column
Arguments:
amat - matrix of intermediate coefficients size [Nx3], λ - wavelength , μm, [Nx0], T - temperature, K,
PlanckFunctions.a₁₂₃ — Method
a₁₂₃(λ::Float64,T::Float64)Arguments:
amat - matrix of intermediate coefficients size [Nx3] λ - wavelength , μm, [Nx0] T - temperature, K
Returns tuple:
(a1 = C₂/(λ*T), a2 = 1/expm1(a1), a3 = 1 + a2)
PlanckFunctions.band_power — Method
band_power(T;λₗ=0.0 , λᵣ=Inf , tol=1e-8)Total bb with temperature T integral intensity (∫ibb(λ , T)dλ) within (in-band radiance), [W/(m²⋅sr)] the spectral range λₗ...λᵣ (by default the range is 0...inf) tol - tolerance of intehration
Arguments:
T - temperature,Kelvins (optional) λₗ - left wavelength boundary, μm λᵣ - right wavelength boundary, μm tol - intergation tolerance
PlanckFunctions.bb_max — Method
bb_max(T::Number)Blackbody instensity at maximum value
PlanckFunctions.bb_max — Method
bb_max(bb_function , T)Returns the value of function at a maximum bb_function can be ibb , ∇ₜibb , ∇²ₜibb
PlanckFunctions.bright_temperature — Method
bright_temperature(i, λ; ϵ=1.0)Evaluates bright temperature for single wavelength pyrometer i - measured intensity , λ - wavelength, μm ϵ - emissivity
PlanckFunctions.ibb! — Method
ibb!(i::AbstractVector , λ::AbstractVector , amat::AbstractMatrix)In-place blackbody intensity with intermediate coefficients provided externally, [W/m2-sr-mkm] Ibb = C₁*(λ⁻⁵)*a₂ , where a₁=C₂/(λ*T) - amat first column a₂ = 1/(eᵃ¹-1) - amat second column
Arguments:
i - BB intensity, [Nx0] λ - wavelength in μm, [Nx0] amat - matrix of intermediate coefficients, [Nx3]
PlanckFunctions.ibb! — Method
ibb!(i::AbstractVector , λ::AbstractVector , T::Number)In-place blackbody intensity, [W/m²⋅sr⋅μm] Ibb = (λ⁻⁵)* C₁/(eᵃ¹-1) , where a₁=C₂/(λT)
Arguments:
i - bb intensity vector, [Nx0] λ - wavelength in μm, [Nx0] T - temperature in Kelvins
PlanckFunctions.ibb — Method
ibb(λ::AbstractVector,amat::AbstractMatrix)Blackbody spectral intensity (spectral radiance) with intermediate matrix provided externally, [W/m²⋅sr⋅μm] Ibb = C₁*(λ⁻⁵)*a₂ , a₁=C₂/(λ*T) - amat first column, a₂ = 1/(eᵃ¹-1) - amat second column
Arguments:
amat - matrix of intermediate coefficients, [Nx3] λ - wavelength in μm, [Nx0]
PlanckFunctions.ibb — Method
ibb(λ::AbstractVector,T::AbstractVector)Blackbody spectral intensity (spectral radiance), [W/m²⋅sr⋅μm] Ibb = (λ⁻⁵)* C₁/(eᵃ¹-1) , where a₁=C₂/(λ*T)
Arguments:
λ - wavelength in μm, [Nx0] T - temperature in Kelvins [Mx0]
PlanckFunctions.ibb — Method
ibb(λ,T)Blackbody spectral intensity (spectral radiance), [W/m²⋅sr⋅μm] Ibb = (λ⁻⁵)* C₁/(eᵃ¹-1) , a₁=C₂/(λ*T)
Arguments:
λ - wavelength in μm T - temperature in Kelvins
PlanckFunctions.planck_averaged — Method
planck_averaged(x::AbstractVector, λ::AbstractVector,T::Number)Evaluates the Planck-averaged value of x(λ) for temperature T:
xᵣ = ∫x(λ)ibb(λ,T)dλ/∫ibb(λ,T)dλ
E.g. can be used to evaluate the integral from spectral emissivity
PlanckFunctions.planck_averaged_attenuation — Method
planck_averaged_attenuation(α::AbstractVector, λ::AbstractVector,T::Number)Planck-averaged spectral attenuation coefficient (the summation of spectral scattering and absorption coefficients) α(λ) for temperature T:
αᵣ = (∫(1/α(λ))⋅ibb(λ,T)dλ/∫ibb(λ,T)dλ)⁻¹
PlanckFunctions.planck_weighted — Method
planck_weighted(α::AbstractVector{Q},
λ::AbstractVector{L},
T::D) where { D <: Number , Q <: Number , L <: Number}Evaluates ∫α(λ)⋅ibb(λ,T)dλ using numeric integration
PlanckFunctions.planck_weighted_ratio — Method
planck_weighted_ratio(
α::AbstractSpectralQuantity,
band1::NTuple{2},
band2::NTuple{2},
T::D) where { D <: Number}Evaluates the ratio of planck_weighted quantity α integrated over two bands band1 and band2 at temperature T:
R(T) = ∫α(λ)ibb(λ,T)dλ1 / ∫α(λ)ibb(λ,T)dλ2
Arguments
α: AnAbstractSpectralQuantity(e.g., analytical or autodiff emissivity).band1: Tuple(λ_min, λ_max)for the first spectral band (numerator), μm.band2: Tuple(λ_min, λ_max)for the second spectral band (denominator), μm.T: Temperature, K.
PlanckFunctions.planck_weighted_ratio — Method
planck_weighted_ratio(
α1::AbstractVector{Q},
λ1::AbstractVector{L},
α2::AbstractVector{Q},
λ2::AbstractVector{L},
T::D) where { D <: Number , Q <: Number , L <: Number}Returns the ratio of two weighted values (∫α1(λ)ibb(λ,T)dλ1 / ∫α2(λ)ibb(λ,T)dλ2)
PlanckFunctions.power — Method
power(T)Integral (over the wavelength) intensity of BB (radiance) at temperature T
Units: W/(m²⋅sr)
Arguments:
T - temperature, K
PlanckFunctions.rosseland_averaged_attenuation — Method
rosseland_averaged_attenuation(α::AbstractVector, λ::AbstractVector,T::Number)Evaluates the Rosseland-averaged spectral attenuation coefficient (the summation of spectral scattering and absorption coefficients) α(λ) for temperature T:
αᵣ = (∫(1/α(λ))⋅∇ₜibb(λ,T)dλ/∫∇ₜibb(λ,T)dλ)⁻¹
PlanckFunctions.second_order_polynomial_fit — Method
second_order_polynomial_fit(x1,x2,x3,g1,g2,g3)Hardcoded second order polynomial lsqr fitting
PlanckFunctions.spectral_band_ratio — Method
spectral_band_ratio(λ1::NTuple{2, TL}, λ2::NTuple{2,TL}, T::Number; tol = 1e-6) where TL <: NumberThe same as spectral_ratio, but now the band can be wide (not a single wavelength). This function may be useful for two-color pyrometers in case when their working regions width cannot be ignored
Arguments
λ1- tuple of left and right wavelength of the first band, in μm. λ2- tuple of left and right wavelength of the second band, in μm. T- Absolute temperature, in K.
PlanckFunctions.spectral_ratio — Method
spectral_ratio(λ1::Number, λ2::Number, T::Number)Calculate the theoretical intensity ratio R = ( Ibb1/Ibb2) between two wavelengths λ1 and λ2 at temperature T
Arguments
λ1- First wavelength (usually the shorter one), in μm. λ2- Second wavelength (usually the longer one), in μm. T- Absolute temperature, in K.
PlanckFunctions.temperature — Method
temperature(i)The bb temperature for intensity i corresponding to wavelength λ
PlanckFunctions.tₘ — Method
tₘ(λ)The temperature of BB having maximum at wavelength λ in Kelvins
PlanckFunctions.units — Method
units(f::Function)returns units string of output quantity return
PlanckFunctions.weighted — Method
weighted(α::AbstractVector{Q},
λ::AbstractVector{L},
T::D,
g::Dfunctions) where { D <: Number , Q <: Number , L <: Number}∫α⋅g(λ,T)dλ where g ∈ {ibb , ∇ₜibb , ∇²ₜibb}
PlanckFunctions.weighted_average — Function
weighted_average(α::AbstractVector,
λ::AbstractVector,
T::Number,
g::Dfunctions,
f::F = identity) where FGeneric function to evaluate the averaged value of some f(x) function of variable x dependent on wavelength λ for temperature T. Uses linear approximation for the discrete variable and square polynomial for the g function
xᵣ = ∫f(x)g(λ,T)dλ/∫g(λ,T)dλ the default value of f is identity, e.g. if f = inv: xᵣ = ∫g(λ,T)/x(λ)dλ/∫g(λ,T)dλ
PlanckFunctions.weighted_value — Method
weighted_value( α::AbstractVector,
λ::AbstractVector,
T ,
g::Union{typeof(ibb),typeof(∇ₜibb),typeof(∇²ₜibb)},
f::F = identity) where F <: FunctionReturns the tuple of (∫f(α)g(λ,T)dλ , ∫g(λ,T)dλ)
PlanckFunctions.weighted_values_ratio — Method
weighted_values_ratio(
α1::AbstractVector{Q},
λ1::AbstractVector{L},
α2::AbstractVector{Q},
λ2::AbstractVector{L},
T::D,
g::Dfunctions,
f::F = identity) where {F , D <: Number , Q <: Number , L <: Number}Returns the ratio of two weighted values (∫f(α1)g(λ,T)dλ1 / ∫f(α2)g(λ,T)dλ2)
PlanckFunctions.λₘ — Method
λₘ(T::Number)The wavelength (in μm) of bb intensity maximum vs temperature T argmax(Planck(T)) - Wien's displacement law
Arguments:
T - temperature in Kelvins
PlanckFunctions.λₘ — Method
λₘ(::Union{typeof(ibb) , typeof(∇ₜibb) , typeof(∇²ₜibb)} , T::Number)The wavelength (in μm) of bb intensity , its first or second derivaitve maximum vs temperature T
Arguments:
T - temperature in Kelvins
PlanckFunctions.∇²ₗibb — Method
∇²ₗibb(λ,T)BB intensity second derivative with respect to the wavelength
Arguments:
λ - wavelength, μm T - temperature, K
PlanckFunctions.∇²ₜ — Function
∇²ₜ(f)
Differentiation operator returns the second derivatives of functionibb , band_power , power , spectral_ratio , spectral_band_ratio , planck_weighted,planck_weighted_ratio
Must be implemented on user defined [`AbstractSpectralQuatity`](@ref) interface to performfast continuous function weighting derivatives evaluation
Examples
∇²ₜ(ibb) # -> ∇²ₜibb
∇²ₜ(band_power) # -> ∇²ₜband_powerPlanckFunctions.∇²ₜband_power — Method
∇²ₜband_power(T , band_power_value; λₗ=0.0 , λᵣ=Inf , tol=1e-8)Band power second derivative with respect to temeprature with band_power value evaluated externally
Arguments:
T - temperature,Kelvins
(optional) λₗ - left wavelength boundary, μm λᵣ - right wavelength boundary, μm tol - intergation tolerance
PlanckFunctions.∇²ₜband_power — Method
∇²ₜband_power(T ; λₗ=0.0 , λᵣ=Inf , tol=1e-8)Band power second derivative with respect to temeprature
Arguments:
T - temperature,Kelvins
(optional) λₗ - left wavelength boundary, μm λᵣ - right wavelength boundary, μm tol - intergation tolerance
PlanckFunctions.∇²ₜibb! — Method
∇²ₜibb!(h::AbstractMatrix{Float64} , λ::AbstractVector{Float64}, T::AbstractVector{Float64})In-place bb intensity second order derivative with respect to temperature
d²Ibb/dT² = C₁*(eᵃ¹/(eᵃ¹-1)²)*(C₂/(λ⁶*T³))*[(C₂/(λ*T))*(2*eᵃ¹/(eᵃ¹-1)-1)-2],
d²Ibb/dT² = C₁*(eᵃ¹/(eᵃ¹-1)²)*(a₁/(λ⁵*T²))*[a₁*(2*eᵃ¹/(eᵃ¹-1) -1)-2], a₁=C₂/(λ*T), a₂ = 1/(eᵃ¹-1) , a₃ = eᵃ¹/(eᵃ¹-1) ,
d²Ibb/dT² = C₁*a₂*a₃*(a₁/(λ⁵*T²))*[a₁*(2*a₃ - 1))-2]
Arguments :
h - to be filled, [Nx0] λ - wavelength in μm, [Nx0] T- tmperature in Kelvins
PlanckFunctions.∇²ₜibb! — Method
∇²ₜibb!(h::AbstractVector{Float64}, λ::AbstractVector{Float64} , T::Float64 ,amat::AbstractMatrix{Float64})::NothingIn-place bb intensity second order derivative with respect to temperature with intermediate matrix provided externally
d²Ibb/dT² = C₁*(eᵃ¹/(eᵃ¹-1)²)*(C₂/(λ⁶*T³))*[(C₂/(λ*T))*(2*eᵃ¹/(eᵃ¹-1)-1)-2],
d²Ibb/dT² = C₁*(eᵃ¹/(eᵃ¹-1)²)*(a₁/(λ⁵*T²))*[a₁*(2*eᵃ¹/(eᵃ¹-1) -1)-2], a₁=C₂/(λ*T), a₂ = 1/(eᵃ¹-1) , a₃ = eᵃ¹/(eᵃ¹-1) ,
d²Ibb/dT² = C₁*a₂*a₃*(a₁/(λ⁵*T²))*[a₁*(2*a₃ - 1))-2]
Arguments :
h - to be filled, [Nx0] λ- wavelength in μm, [Nx0] T - temperature in Kelvins amat - matrix of intermediate coefficients, [Nx3]
PlanckFunctions.∇²ₜibb! — Method
∇²ₜibb!(h::AbstractVector , λ::AbstractVector , T::Number)In-place bb intensity second order derivative with respect to temperature
Arguments :
h - to be filled, [Nx0] λ - wavelength in μm, [Nx0] T - tmperature in Kelvins
PlanckFunctions.∇²ₜibb! — Method
∇²ₜibb!(h::AbstractVector{Float64},T::Float64,amat::AbstractMatrix{Float64},∇i::AbstractVector{Float64})::NothingIn-place bb intensity second order derivative with respect to temperature with provided both the intermediate matrix amat and the the Planck function first derivative
d²Ibb/dT² = C₁*(eᵃ¹/(eᵃ¹-1)²)*(C₂/(λ⁶*T³))*[(C₂/(λ*T))*(2*eᵃ¹/(eᵃ¹-1)-1)-2]
d²Ibb/dT² = C₁*(eᵃ¹/(eᵃ¹-1)²)*(a₁/(λ⁵*T²))*[a₁*(2*eᵃ¹/(eᵃ¹-1) -1)-2] a₁=C₂/(λ*T) a₂ = 1/(eᵃ¹-1) , a₃ = eᵃ¹/(eᵃ¹-1) , d²Ibb/dT² = C₁*a₂*a₃*(a₁/(λ⁵*T²))*[a₁*(2*a₃ - 1))-2] as far as Ibb = (λ⁻⁵)* C₁*a₂ and dIbb/dT = C₁*a₃*a₂*a₁*(1/(λ⁵*T)) = a₃*a₁*Ibb/T hense
d²Ibb/dT² = C₁*a₂*a₃*a₁*(1/(λ⁵*T²))*[a₁*(2*a₃ - 1))-2] = [a₃*a₁*Ibb/T^2]*[a₁*(2*a₃ - 1))-2] = [(dIbb/dT)/T]*[a₁*(2*a₃ - 1))-2]
Arguments :
h - to be filled, [Nx0] λ - wavelength in μm, [Nx0] amat - matrix of intermediate coefficients, [Nx3] ∇i - vector of bb intensity first derivatives, [Nx0]
PlanckFunctions.∇²ₜibb — Method
∇²ₜibb(λ,T)BB intensity second derivative with respect to temperature
d²Ibb/dT² = C₁*(eᵃ¹/(eᵃ¹-1)²)*(C₂/(λ⁶*T³))*[(C₂/(λ*T))*(2*eᵃ¹/(eᵃ¹-1)-1)-2] ,
d²Ibb/dT² = C₁*(eᵃ¹/(eᵃ¹-1)²)*(a₁/(λ⁵*T²))*[a₁*(2*eᵃ¹/(eᵃ¹-1) -1)-2], a₁=C₂/(λ*T), a₂ = 1/(eᵃ¹-1), a₃ = eᵃ¹/(eᵃ¹-1) ,
d²Ibb/dT² = C₁*a₂*a₃*(a₁/(λ⁵*T²))*[a₁*(2*a₃ - 1))-2]
Arguments :
λ - wavelength in μm T - tmperature in Kelvins
PlanckFunctions.∇²ₜplanck_weighted — Method
∇²ₜplanck_weighted(α::AbstractVector{Q},
λ::AbstractVector{L},
T::D) where { D <: Number , Q <: Number , L <: Number}Evaluates ∫α(λ)⋅∇²ₜibb(λ,T)dλ using numeric integration
PlanckFunctions.∇²ₜplanck_weighted_ratio — Method
∇²ₜplanck_weighted_ratio(
α::AbstractSpectralQuantity,
band1::NTuple{2},
band2::NTuple{2},
T::D) where { D <: Number}Returns the ratio of two weighted values d²/dT² [ (∫α1(λ)ibb(λ,T)dλ1 / ∫α2(λ)ibb(λ,T)dλ2) ]
Arguments
α: AnAbstractSpectralQuantity(e.g., analytical or autodiff emissivity).band1: Tuple(λ_min, λ_max)for the first spectral band (numerator), μm.band2: Tuple(λ_min, λ_max)for the second spectral band (denominator), μm.T: Temperature, K.
PlanckFunctions.∇²ₜplanck_weighted_ratio — Method
∇²ₜplanck_weighted_ratio(
α1::AbstractVector{Q},
λ1::AbstractVector{L},
α2::AbstractVector{Q},
λ2::AbstractVector{L},
T::D) where { D <: Number , Q <: Number , L <: Number}Returns the ratio of two weighted values d²/dT² [ (∫α1(λ)ibb(λ,T)dλ1 / ∫α2(λ)ibb(λ,T)dλ2) ]
PlanckFunctions.∇²ₜpower — Method
∇²ₜpower(T)Total intensity second derivative of BB (radiance) at temperature T
Units: W/(m²⋅sr⋅K)
Arguments:
T - temperature, K
PlanckFunctions.∇²ₜspectral_band_ratio — Method
∇²ₜspectral_band_ratio(λ1::NTuple{2, TL}, λ2::NTuple{2,TL}, T::Number; tol = 1e-6) where TL <: NumberSpectral band ratio second derivative
Arguments
λ1- tuple of left and right wavelength of the first band, in μm. λ2- tuple of left and right wavelength of the second band, in μm. T- Absolute temperature, in K.
PlanckFunctions.∇²ₜspectral_ratio — Method
∇²ₜspectral_ratio(λ1::Number, λ2::Number, T::Number)Spectral ratio second derivative
Arguments
λ1- First wavelength (usually the shorter one), in μm. λ2- Second wavelength (usually the longer one), in μm. T- Absolute temperature, in K.
PlanckFunctions.∇²ₜ∫ibbₗ — Method
∇²ₜ∫ibbₗ(T; λₗ=0.0, λᵣ=Inf)Relative (with respect to the integral power in the whole spectrum) integral intensity derivative (analytic) of bb intensity fraction in the spectral range λₗ...λᵣ (by default the range is 0...inf)
Arguments:
T - temperature,Kelvins (optional) λₗ - left wavelength boundary, μm λᵣ - right wavelength boundary, μm
PlanckFunctions.∇ₗibb — Method
∇ₗibb(λ,T)BB intensity first derivative with respect to the wavelength
Arguments:
λ - wavelength, μm T - temperature, K
PlanckFunctions.∇ₜ — Function
∇ₜ(f)
Differentiation operator returns the derivatives function for the input functionibb , band_power , power , spectral_ratio , spectral_band_ratio , planck_weighted,planck_weighted_ratio and their derivatives e.g ∇ₜband_power etc.
Must be implemented on user defined [`AbstractSpectralQuatity`](@ref) interface to performfast continuous function weighting derivatives evaluation
Examples
∇ₜ(ibb) # -> ∇ₜibb
F = (∇ₜ∘∇ₜ)(spectral_band_ratio) # -> ∇²ₜspectral_band_ratio
F(1253.5) # returns the second derivative with respect to temperature of the ratio of two spectral band at temperature 1253.5 KPlanckFunctions.∇ₜband_power — Method
∇ₜband_power(T , band_power_value; λₗ=0.0 , λᵣ=Inf)Evaluates bandpower derivative with respect to temperature with `bandpowervalue` provided externally (this may be usefull if one already has calculated the bandpower itself)
Arguments:
T - temperature,Kelvins band_power_value - band_power calculated elswhere
(optional) λₗ - left wavelength boundary, μm λᵣ - right wavelength boundary, μm tol - intergation tolerance
PlanckFunctions.∇ₜband_power — Method
∇ₜband_power(T;λₗ=0.0,λᵣ=Inf,tol=1e-6)Total bb with temperature T integral intensity derivative within (in-band radiance), [W/(m²⋅sr⋅K)] the spectral range λₗ...λᵣ (by default the range is 0...inf) tol - tolerance of integration
Arguments:
T - temperature,Kelvins (optional) λₗ - left wavelength boundary, μm λᵣ - right wavelength boundary, μm tol - intergation tolerance
PlanckFunctions.∇ₜibb! — Method
∇ₜibb!(g::AbstractMatrix , λ::AbstractVector , T::AbstractVector)In-place BB intensity first derivative with respect to temperature a₁=C₂/(λ*T) a₂ = 1/(eᵃ¹-1) a₃ = eᵃ¹/(eᵃ¹-1) dIbb/dT = C₁*a₃*a₂*a₁*(1/(λ⁵*T))
Arguments:
g - vector to be filled, [Nx0] λ - wavelength in μm, [Nx0] T - temperature in Kelvins
PlanckFunctions.∇ₜibb! — Method
∇ₜibb!(g::AbstractVector , λ::AbstractVector , T , amat::AbstractMatrix)In-place bb intensity first derivative with respect to temperature with externally provided amat - matrix with columns a₁,a₂,a₃
dIbb/dT = C₁*(eᵃ¹/(eᵃ¹-1)²)*(C₂/(λ⁶*T²)), a₁=C₂/(λ*T) , a₂ = 1/(eᵃ¹-1) , a₃ = eᵃ¹/(eᵃ¹-1) , dIbb/dT = C₁*a₃*a₂*a₁*(1/(λ⁵*T)),
Arguments:
g - to be filled, [Nx0] λ - wavelength in μm, [Nx0] T - temperature in Kelvins amat - matrix of intermediate coefficients, [Nx3]
PlanckFunctions.∇ₜibb! — Method
∇ₜibb!(g::AbstractVector , T , amat::AbstractMatrix , bb_intensity::AbstractVector)In-place bb intensity first derivative with respect to temperature with externally provided both amat - matrix with columns a₁,a₂,a₃ and bb_intensity
dIbb/dT = C₁(eᵃ¹/(eᵃ¹-1)²)(C₂/(λ⁶T²)) a₁=C₂/(λT) a₂ = 1/(eᵃ¹-1) # 1/expm1(a1) a₃ = eᵃ¹/(eᵃ¹-1) # exp(a)/expm1(a) dIbb/dT = C₁a₃a₂a₁(1/(λ⁵T)) as far as Ibb = C₁a₂/λ⁵ dIbb/dT = a₃a₁C₁(a₂/λ⁵)(1/T)=a₃a₁Ibb/T
Arguments:
g - to be filled, [Nx0] λ - wavelength in μm, [Nx0] T - temperature in Kelvins amat - matrix of intermediate coefficients, [Nx3]
PlanckFunctions.∇ₜibb — Method
∇ₜibb(λ::AbstractVector,T,amat::AbstractMatrix)BB intensity first derivative with respect to temperature with externally provided matrix of intermediate coefficients dIbb/dT = C₁*(eᵃ¹/(eᵃ¹-1)²)*(C₂/(λ⁶*T²)) a₁=C₂/(λ*T) a₂ = 1/(eᵃ¹-1) a₃ = eᵃ¹/(eᵃ¹-1) dIbb/dT = C₁*a₃*a₂*a₁*(1/(λ⁵*T))
Arguments:
λ - wavelength in μm, [Nx0] T - temperature in Kelvins amat - matrix of intermediate coefficients, [Nx3]
PlanckFunctions.∇ₜibb — Method
∇ₜibb(λ,T)BB intensity first derivative with respect to temperature dIbb/dT = C₁(eᵃ¹/(eᵃ¹-1)²)(C₂/(λ⁶T²)) `a₁=C₂/(λT)a₂ = 1/(eᵃ¹-1)# 1/expm1(a1)a₃ = eᵃ¹/(eᵃ¹-1)` # exp(a)/expm1(a) dIbb/dT = C₁a₃a₂a₁(1/(λ⁵*T))
Arguments:
λ - wavelength, μm T - temperature, K
PlanckFunctions.∇ₜplanck_weighted — Method
planck_weighted(α::AbstractVector{Q},
λ::AbstractVector{L},
T::D) where { D <: Number , Q <: Number , L <: Number}Evaluates ∫α(λ)⋅∇ₜibb(λ,T)dλ using numeric integration
PlanckFunctions.∇ₜplanck_weighted_ratio — Method
∇ₜplanck_weighted_ratio(
α::AbstractSpectralQuantity,
band1::NTuple{2},
band2::NTuple{2},
T::D) where { D <: Number}Returns the ratio of two weighted values d/dT [ ∫α(λ)ibb(λ,T)dλ1 / ∫α(λ)ibb(λ,T)dλ2]
Arguments
α: AnAbstractSpectralQuantity(e.g., analytical or autodiff emissivity).band1: Tuple(λ_min, λ_max)for the first spectral band (numerator), μm.band2: Tuple(λ_min, λ_max)for the second spectral band (denominator), μm.T: Temperature, K.
PlanckFunctions.∇ₜplanck_weighted_ratio — Method
∇ₜplanck_weighted_ratio(
α1::AbstractVector{Q},
λ1::AbstractVector{L},
α2::AbstractVector{Q},
λ2::AbstractVector{L},
T::D) where { D <: Number , Q <: Number , L <: Number}Returns the ratio of two weighted values d/dT [ (∫α1(λ)ibb(λ,T)dλ1 / ∫α2(λ)ibb(λ,T)dλ2) ]
PlanckFunctions.∇ₜpower — Method
∇ₜpower(T)Total intensity first derivative of BB (radiance) at temperature T
Units: W/(m²⋅sr⋅K)
Arguments:
T - temperature, K
PlanckFunctions.∇ₜspectral_band_ratio — Method
∇ₜspectral_band_ratio(λ1::NTuple{2, TL}, λ2::NTuple{2,TL}, T::Number; tol = 1e-6) where TL <: Number
First derivative of two wide spectral band ratioArguments
λ1- tuple of left and right wavelength of the first band, in μm. λ2- tuple of left and right wavelength of the second band, in μm. T- Absolute temperature, in K
PlanckFunctions.∇ₜspectral_ratio — Method
∇ₜspectral_ratio(λ1::Number, λ2::Number, T::Number)Calculate the theoretical intensity ratio derivative dR/T =d/dT ( Ibb1/Ibb2 ) between two wavelengths λ1 and λ2 at temperature T
Arguments
λ1- First wavelength (usually the shorter one), in μm. λ2- Second wavelength (usually the longer one), in μm. T- Absolute temperature, in K.
PlanckFunctions.∇ₜ∫ibbₗ — Method
∇ₜ∫ibbₗ(T; λₗ=0.0, λᵣ=Inf)Relative (with respect to the integral power in the whole spectrum) integral intensity derivative (analytic) of bb intensity fraction in the spectral range λₗ...λᵣ (by default the range is 0...inf)
Arguments:
T - temperature,Kelvins (optional) λₗ - left wavelength boundary, μm λᵣ - right wavelength boundary, μm
PlanckFunctions.∫ibbₗ — Method
∫ibbₗ(T;λₗ=0.0,λᵣ=Inf,tol=1e-6)Relative (with respect to the integral power in the whole spectrum) integral intensity of bb in the spectral range λₗ...λᵣ (by default the range is 0...inf)
Arguments:
`T - temperature,Kelvins
(optional)
λₗ - left wavelength boundary, μm λᵣ - right wavelength boundary, μm tol - intergation tolerance
PlanckFunctions.∫ₗ — Function
∫ₗ(g)
∫ₗ(g, λ₁, λ₂)
∫ₗ(g, λ::AbstractVector, α::AbstractVector)The spectral integration operator for Planck radiation quantities.
Depending on the provided argument signature, this operator returns different highly optimized, type-stable callable objects (functors) designed to minimize runtime allocations.
Arguments
g::Dfunctions: The base Planck function layer (ibb,∇ₜibb,∇²ₜibb, orDₜibb).λ₁,λ₂::Number: Spectral band boundaries in microns (μm).λ::AbstractVector,α::AbstractVector: Discrete experimental data arrays (wavelength grid and spectral coefficients).
Full Spectrum Integration (Unary)
When applied directly to a single argument, it returns a functor representing the analytical total integrated power over the entire spectrum ([0, ∞)) governed by the Stefan-Boltzmann law.
f = ∫ₗ ibb
f(1273.5) # Returns σ * T^4Spectral Band Integration
When given a function and two numeric boundaries, it returns a functor that evaluates the integrated band power within the specific interval [λ₁, λ₂].
f = ∫ₗ(ibb, 2.3, 4.5)
f(1273.5) # Returns integrated power between 2.3 and 4.5 μmTabular Data Integration
When given a function and two matching discrete arrays, it returns a functor designed for experimental data pyrometry (e.g., integrating a wavelength-dependent emissivity vector α against the Planck distribution).
f = ∫ₗ(ibb, λ_grid, e_data)
f(1273.5) # Returns the discrete Planck-weighted integral PlanckFunctions.∫ₗ — Method
∫ₗ(f::F , λ₁::Number, λ₂::Number) where F <: Union{typeof(ibb), typeof(∇²ₜibb), typeof(∇ₜibb)}Returns a callable object which returns the f function integral as a function of temperature
f = ∫ₗ(ibb , 2.3 , 4.5)
f(1273.5) # returns the value of Planck function integrated over 2.3 - 4.5 spectral range at temperature 1273,5 K