waveband_ratio: Photon or energy ratio

Description Usage Arguments Value Note Examples

View source: R/waveband.ratio.r

Description

This function gives the (energy or photon) irradiance ratio between two given wavebands of a radiation spectrum.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
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)
)

Arguments

w.length

numeric Vector of wavelengths (nm)

s.irrad

numeric vector of spectral (energy or photon) irradiances (W m-2 nm-1) or (mol s-1 m-2 nm-1).

w.band.num

waveband object used to compute the numerator of the ratio.

w.band.denom

waveband object used to compute the denominator of the ratio.

unit.out.num

character Allowed values "energy", and "photon", or its alias "quantum".

unit.out.denom

character Allowed values "energy", and "photon", or its alias "quantum".

unit.in

character Allowed values "energy", and "photon", or its alias "quantum".

check.spectrum

logical Flag indicating whether to sanity check input data, default is TRUE.

use.cached.mult

logical Flag indicating whether multiplier values should be cached between calls.

use.hinges

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.

Value

a single numeric value giving the ratio

Note

The default for both w.band parameters is a waveband covering the whole range of w.length. From version 9.19 onwards use of this default does not trigger a warning, but instead is used silently.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# 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"))

photobiology documentation built on Aug. 28, 2020, 1:11 a.m.