Converts the spectral values in a lux_spectrum between energy and
photon-flux units, or between mW and W for radiance spectra. Supported
conversions: "W/m2/nm" \(\leftrightarrow\)
"umol/m2/s/nm" / "mmol/m2/s/nm" / "mol/m2/s/nm",
and the corresponding "/sr" photonic units. Energy radiance units
"W/m2/sr/nm" and "mW/m2/sr/nm" are also interchangeable.
Examples
lam <- seq(400, 700, by = 10)
x_W <- lux_spectrum(rep(1, length(lam)), lam, "irradiance", "W/m2/nm")
x_mol <- convert_unit(x_W, "umol/m2/s/nm")
x_mol$unit
#> [1] "umol/m2/s/nm"