This function gives the (energy or photon) irradiance ratio between two given wavebands of a radiation spectrum.
waveband_ratio(
w.length,
s.irrad,
w.band.num = NULL,
w.band.denom = NULL,
unit.out.num = NULL,
unit.out.denom = unit.out.num,
unit.in = "energy",
check.spectrum = TRUE,
use.cached.mult = FALSE,
use.hinges = getOption("photobiology.use.hinges", default = NULL)
)
a single numeric value giving the ratio
numeric Vector of wavelengths [
numeric vector of spectral irradiances in
[unit.in
.
waveband objects used to compute the numerator and denominator of the ratio.
character Base of expression used to
compute the numerator and denominator of the ratio. Allowed values
"energy"
, and "photon"
, or its alias "quantum"
.
character Allowed values "energy"
, and "photon"
,
or its alias "quantum"
.
logical Flag indicating whether to sanity check input data, default is TRUE.
logical Flag indicating whether multiplier values should be cached between calls.
logical Flag indicating whether to insert "hinges" into the spectral data before integration so as to reduce interpolation errors at the boundaries of the wavebands.
# photon:photon ratio
with(sun.data,
waveband_ratio(w.length, s.e.irrad,
new_waveband(400,500),
new_waveband(400,700), "photon"))
# energy:energy ratio
with(sun.data,
waveband_ratio(w.length, s.e.irrad,
new_waveband(400,500),
new_waveband(400,700), "energy"))
# energy:photon ratio
with(sun.data,
waveband_ratio(w.length, s.e.irrad,
new_waveband(400,700),
new_waveband(400,700),
"energy", "photon"))
# photon:photon ratio waveband : whole spectrum
with(sun.data,
waveband_ratio(w.length, s.e.irrad,
new_waveband(400,500),
unit.out.num="photon"))
# photon:photon ratio of whole spectrum should be equal to 1.0
with(sun.data,
waveband_ratio(w.length, s.e.irrad,
unit.out.num="photon"))
Run the code above in your browser using DataLab