planck.c file
Functions
- static void set_ok(bool* ok, const bool value)
-
auto vm_planck_b(vm_
float_ t T, bool* ok) -> vm_ float_ t - Integrated blackbody radiance
$B(T) = \sigma T^4 / \pi$. -
auto vm_planck_bnu(vm_
float_ t nu, vm_ float_ t T, bool* ok) -> vm_ float_ t - Spectral blackbody radiance
$B_\nu(T)$. -
static auto planck_integrand(const vm_
float_ t x) -> vm_ float_ t -
auto vm_planck_group(vm_
float_ t nu_lo, vm_ float_ t nu_hi, vm_ float_ t T, bool* ok) -> vm_ float_ t - Group integral of
$B_\nu$between two frequencies. -
auto vm_planck_db_dt(vm_
float_ t T, bool* ok) -> vm_ float_ t - Temperature derivative
$dB/dT = 4 \sigma T^3 / \pi$.
Variables
-
static const vm_
float_ t gl_x -
static const vm_
float_ t gl_w
Defines
- #define SIGMA
- #define PLANCK_H
- #define BOLTZMANN_K
- #define LIGHT_C
Function documentation
vm_ float_ t vm_planck_b(vm_ float_ t T,
bool* ok)
Integrated blackbody radiance $B(T) = \sigma T^4 / \pi$.
| Parameters | |
|---|---|
| T | Temperature. |
| ok | Set false when T <= 0; may be NULL. |
| Returns | Radiance, or 0 when T <= 0. |
vm_ float_ t vm_planck_bnu(vm_ float_ t nu,
vm_ float_ t T,
bool* ok)
Spectral blackbody radiance $B_\nu(T)$.
| Parameters | |
|---|---|
| nu | Frequency. |
| T | Temperature. |
| ok | Set false when T <= 0; may be NULL. |
| Returns | Spectral radiance, or 0 when T <= 0 or nu <= 0. |
vm_ float_ t vm_planck_group(vm_ float_ t nu_lo,
vm_ float_ t nu_hi,
vm_ float_ t T,
bool* ok)
Group integral of $B_\nu$ between two frequencies.
| Parameters | |
|---|---|
| nu_lo | Lower frequency bound. |
| nu_hi | Upper frequency bound, or <= 0 for infinity. |
| T | Temperature. |
| ok | Set false when T <= 0 or the band is empty; may be NULL. |
| Returns | Group radiance. |
nu_hi <= 0 means the upper limit is infinity and returns the analytic integrated radiance. A finite band uses a fixed Gauss quadrature in the dimensionless frequency.
vm_ float_ t vm_planck_db_dt(vm_ float_ t T,
bool* ok)
Temperature derivative $dB/dT = 4 \sigma T^3 / \pi$.
| Parameters | |
|---|---|
| T | Temperature. |
| ok | Set false when T <= 0; may be NULL. |
| Returns | Derivative, or 0 when T <= 0. |