Frequency and wavelength spectral radiance conversion (source code)

= Frequency and wavelength spectral radiance conversion
{title2=$L_\nu=L_\lambda(c/\nu)\,c/\nu^2$}

In <vacuum>, $\nu=c/\lambda$, where $c$ is the <speed of light>. Increasing <wavelength> decreases <frequency>, so the ordinary signed <differentials> satisfy $d\nu=-c\lambda^{-2}d\lambda$. A spectral slice's positive contribution to <radiance> must be unchanged. The <change of variables formula> therefore gives the absolute <Jacobian determinant>
$$
L_\nu(\nu)=L_\lambda(c/\nu)\left|\frac{d\lambda}{d\nu}\right|
=L_\lambda(c/\nu)\frac{c}{\nu^2},
\qquad
L_\lambda(\lambda)=L_\nu(c/\lambda)\frac{c}{\lambda^2}.
$$
These formulas use $L_\lambda$ per metre and $L_\nu$ per hertz. The factor $c/\nu^2$ has units $\mathrm{m\,s}=\mathrm{m\,Hz^{-1}}$, which converts the former density into the latter. If $\ell_{\rm nm}$ denotes the numerical density per nanometre in $\mathrm{W\,m^{-2}\,sr^{-1}\,nm^{-1}}$, its per-metre value is $10^9\ell_{\rm nm}$. Conversely, the per-nanometre value is $10^{-9}$ times the per-metre value. Likewise, a density per terahertz is $10^{12}$ times its per-hertz value because $1\,\mathrm{THz}=10^{12}\,\mathrm{Hz}$.

For a concrete stipulated spectrum, let $L_\lambda=C=10^9\,\mathrm{W\,m^{-2}\,sr^{-1}\,m^{-1}}$ between $\lambda_1=500\,\mathrm{nm}$ and $\lambda_2=600\,\mathrm{nm}$, and zero outside. This is exactly $1\,\mathrm{W\,m^{-2}\,sr^{-1}\,nm^{-1}}$ throughout the band. Using the exact <International System of Units> value $c=299792458\,\mathrm{m\,s^{-1}}$, the corresponding <frequency> bounds are
$$
\nu_1=\frac{c}{\lambda_2}=499.654096666\ldots\,\mathrm{THz},
\qquad
\nu_2=\frac{c}{\lambda_1}=599.584916\,\mathrm{THz}.
$$
The transformed <spectral radiance> is $L_\nu=Cc/\nu^2$ on this interval. At $\nu_1$ it is approximately $1.200830743\times10^{-12}\,\mathrm{W\,m^{-2}\,sr^{-1}\,Hz^{-1}}$, and at $\nu_2$ it is $8.339102380\times10^{-13}$ in the same units. These are respectively $1.200830743$ and $0.833910238$ per terahertz. Thus a flat <wavelength> density becomes a decreasing <frequency> density; relabelling the horizontal axis alone would miss both the shape and the units. https://www.nist.gov/si-redefinition/meet-constants[NIST, Meet the Constants: exact speed of light]{ref}.

The equality of band <radiances> has a short exact proof:
$$
\int_{\lambda_1}^{\lambda_2}C\,d\lambda
=C(\lambda_2-\lambda_1)
=100\,\mathrm{W\,m^{-2}\,sr^{-1}},
$$
$$
\int_{\nu_1}^{\nu_2}\frac{Cc}{\nu^2}\,d\nu
=Cc\left(\frac1{\nu_1}-\frac1{\nu_2}\right)
=C(\lambda_2-\lambda_1).
$$
The reversed bounds and the <Jacobian determinant> preserve the same spectral measure. Each half-band, $500$–$550\,\mathrm{nm}$ and $550$–$600\,\mathrm{nm}$, carries $50\,\mathrm{W\,m^{-2}\,sr^{-1}}$, although the corresponding <frequency> widths are about $54.508$ and $45.423\,\mathrm{THz}$.

\Image[/spectral-radiance-variable-change.png]
{title=A flat <wavelength> spectrum becomes curved in <frequency>, with equal band <radiances>}
{description=Matching colours identify the same two spectral half-bands. The shaded areas are $50\,\mathrm{W\,m^{-2}\,sr^{-1}}$ each in either coordinate. The right-hand density is plotted per terahertz; the longer-wavelength half-band occupies the lower-frequency, narrower interval. Both total shaded areas are exactly $100\,\mathrm{W\,m^{-2}\,sr^{-1}}$.}

A spectrum's peak is consequently a statement about a particular density and coordinate. The <frequency and wavelength peaks of Planck's law> differ for precisely this reason. Integrated <radiance> over a specified physical band supplies a comparison that survives the <change of variables>.