Blackbody radiation curves, with support for Unitful.jl.
TODO (help welcome, not expected)
- Documentation
- Need at least one example showing easy calculations/plotting
- need another example showing fits/gradients
- Unit tests
- Gradients
- Write out some chain rules (ChainRulesCore.jl)
Using Optim.jl we can numerically maximize the blackbody function to see how closely it agrees with Wien's law.
using Optim
# function to minimize
Teff = 5796
f(λ) = -blackbody(λ, Teff)
# bounded between 1 picometer and 10 m
res = Optim.optimize(f, 1e-12, 10)
λ = Optim.minimizer(res)
isapprox(λ, 2.898e-3 / Teff; rtol=1e-4)
If you would like to contribute, feel free to open a pull request. If you want to discuss something before contributing, head over to discussions and join or open a new topic. If you're having problems with something, please open an issue.