Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

split_irradiance

Energy or photon irradiance for split spectrum regions


Description

This function returns the energy or photon irradiance for a series of contiguous wavebands from a radiation spectrum. The returned values can be either absolute or relative to their sum.

Usage

split_irradiance(
  w.length,
  s.irrad,
  cut.w.length = range(w.length),
  unit.out = getOption("photobiology.base.unit", default = "energy"),
  unit.in = "energy",
  scale = "absolute",
  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).

cut.w.length

numeric Vector of wavelengths (nm).

unit.out

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

unit.in

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

scale

a character A string indicating the scale used for the returned values ("absolute", "relative", "percent").

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 numeric vector of irradiances with no change in scale factor: [W m-2 nm-1] -> [mol s-1 m-2] or [mol s-1 m-2 nm-1] -> [mol s-1 m-2] or relative values (as fraction of one if scale == "relative" or percentages if scale == "percent".

Note

The last three parameters control speed optimizations. The defaults should be suitable in most cases. If you set check.spectrum=FALSE then you should call check_spectrum at least once for your spectrum before using any of the other functions. If you will use repeatedly the same SWFs on many spectra measured at exactly the same wavelengths you may obtain some speed up by setting use.cached.mult=TRUE. However, be aware that you are responsible for ensuring that the wavelengths are the same in each call, as the only test done is for the length of the w.length vector.

Examples

with(sun.data,
      split_irradiance(w.length, s.e.irrad,
                       cut.w.length = c(300, 400, 500, 600, 700),
                       unit.out = "photon"))

photobiology

Photobiological Calculations

v0.10.10
GPL (>= 2)
Authors
Pedro J. Aphalo [aut, cre] (<https://orcid.org/0000-0003-3385-972X>), Titta K. Kotilainen [ctb] (<https://orcid.org/0000-0002-2822-9734>), Glenn Davis [ctb], Agnese Fazio [ctb]
Initial release
2022-03-24

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.