Skip to contents

Values calculated by interpolation from user-supplied spectral emission data or by name for light source data included in the packages photobiologySun, photobiologyLamps, or photobiologyLEDs, optionally re-scaling the spectral data values.

Usage

calc_source_output(
  w.length.out,
  w.length.in,
  s.irrad.in,
  unit.in = "energy",
  scaled = NULL,
  fill = NA,
  ...
)

Arguments

w.length.out

numeric vector of wavelengths (nm) for output.

w.length.in

numeric vector of wavelengths (nm) for input.

s.irrad.in

numeric vector of spectral transmittance value (fractions or percent).

unit.in

a character string "energy" or "photon".

scaled

NULL, "peak", "area"; div ignored if !is.null(scaled).

fill

if NA, no extrapolation is done, and NA is returned for wavelengths outside the range of the input. If NULL then the tails are deleted. If 0 then the tails are set to zero.

...

Additional arguments passed to spline if called.

Value

a source_spct with three numeric vectors with wavelength values (w.length), scaled and interpolated spectral energy irradiance (s.e.irrad), scaled and interpolated spectral photon irradiance values (s.q.irrad).

Note

This is a convenience function that adds no new functionality but makes it a little easier to plot lamp spectral emission data consistently. It automates interpolation, extrapolation/trimming and scaling.

Examples


with(sun.data,
     calc_source_output(290:1100,
                        w.length.in = w.length,
                        s.irrad.in = s.e.irrad)
    )
#> Object: source_spct [811 x 3]
#> Wavelength range 290-1100 nm, step 1 nm 
#> Variables:
#>  w.length: Wavelength [nm]
#>  s.e.irrad: Spectral energy irradiance [W m-2 nm-1]
#>  s.q.irrad: Spectral photon irradiance [mol s-1 m-2 nm-1] 
#> --
#> # A tibble: 811 × 3
#>    w.length   s.e.irrad s.q.irrad
#>       <int>       <dbl>     <dbl>
#>  1      290 NA          NA       
#>  2      291 NA          NA       
#>  3      292 NA          NA       
#>  4      293  0.00000261  6.39e-12
#>  5      294  0.00000614  1.51e-11
#>  6      295  0.0000218   5.37e-11
#>  7      296  0.0000678   1.68e-10
#>  8      297  0.000153    3.81e-10
#>  9      298  0.000367    9.14e-10
#> 10      299  0.000785    1.96e- 9
#> # ℹ 801 more rows