# User Guide

### Package ‘photobiologyLamps’ 0.5.3

#### Pedro J. Aphalo

#### 2025-09-24

## Introduction

This package, is a data only package, part of a suite, which has package ‘photobiology’ at its core. Please visit (https://www.r4photobiology.info/) for more details. For more details on plotting spectra, please consult the documentation for package ‘ggspectra’, and for information on the calculation of summaries and maths operations between spectra, please, consult the documentation for package ‘photobiology’.

    library(photobiology)
    library(photobiologyLamps)
    # Are the packages used in examples installed?
    eval_bands <- requireNamespace("photobiologyWavebands", quietly = TRUE)
    if (eval_bands) library(photobiologyWavebands)
    eval_plots <- eval_bands && requireNamespace("ggspectra", quietly = TRUE)
    if (eval_plots) library(ggspectra)

In this brief User Guide we describe how to re-scale the normalized spectra, and how to access individual spectra or subsets of spectra.

Spectra in the package are contained in several collections, listed in the table below.

Collections of spectra in package ‘photobiologyLamps’. n gives the number of spectra. Collection `lamps.mspct` contains spectra for different lamps, one spectrum for each lamp. Each of the other collections contains multiple spectra measured under different conditions or settings from one lamp or luminaire.
Collection | Description | n
--- | --- | ---
`lamps.mspct` | Spectra from imdividual lamps at full power and ambient temperature | 67
`amaran_m9.mspct` | Aputure Amaran M9 LED video lamp dimming | 6
`andoer_ir49.mspct` | Andoer IR LED photo/video lamp dimming | 2
`elgato_klm_cct.mspct` | ElGato Key Light Mini LED video lamp colour temperature | 12
`elgato_klm_dim.mspct` | ElGato Key Light Mini LED video lamp dimming | 6
`ledsavers.mspct` | LedSavers 4 channel LED bulb channel mixing | 16
`Nichia_LED_RECOM_dim.mspct` | Custom LED light source in Aralab plant-growth chamber, dimming | 8
`Osram_L_18W_840_temp.mspct` | White fluorescent tubes in Aralab plant-growth chamber at temperatures 5 C to 35 C | 8
`Percival_LED_dim.mspct` | White LEDs in Percival plant-growth chamber, dimming | 11
`qp_uvb313_temp.mspct` and `qp_uvb313_temp.spct` | Q-Panel UVB-313 UV-B fluorescent tubes at temperatures -5 C to 35 C | 7
`sunwayfoto_fl96.mspct` | Sunwayfoto FL96 LED fill light dimming and colour temperature | 7

In addition to the objects containing the data themselves, several character vectors of names of spectra are provide to facilitate the retrieval of subsets of spectra from `lamps.mspct`. These vectors group names by colour, supplier, type of lamp, and intended use.

## Using data from `lamps.mspct`

The `lamps.mspct` collection, an object of class `source_mspct`, contains 67 spectra as member objects of class`source_spct`. The member spectra of `lamps.mspct` can be accessed through their names or through a numeric index. As the numeric indexes are likely to change with updates to the package, their use is discouraged. Names as character strings should be used instead. They can be listed with method `names()`.

    names(lamps.mspct)

    ##  [1] "Airam.CF.15W.2700K"
    ##  [2] "Airam.CF.Spiraali.14W.3000K"
    ##  [3] "Airam.LED.11W.4000K"
    ##  [4] "Airam.LED.14W.4000K"
    ##  [5] "Airam.LED.9W.3000K"
    ##  [6] "Amaran.M9.LED.video.light.5500K"
    ##  [7] "Convoy.S2plus.LED.blue.flashlight"
    ##  [8] "Convoy.S2plus.LED.UVA.flashlight"
    ##  [9] "Eiko.F36T8.BLB"
    ## [10] "Fluence.LED.AnthoSpec"
    ## [11] "Fluence.LED.PhysioSpec.BROAD"
    ## [12] "Fluence.LED.PhysioSpec.BROAD.R3"
    ## [13] "Fluence.LED.PhysioSpec.BROAD.R6"
    ## [14] "Fluence.LED.PhysioSpec.BROAD.R9B"
    ## [15] "Fluence.LED.PhysioSpec.Greenhouse"
    ## [16] "Fluence.LED.PhysioSpec.Indoor"
    ## [17] "Generic.germicidal"
    ## [18] "Generic.Inc.bulb.60W"
    ## [19] "Generic.LED.9W.mosquito"
    ## [20] "Generic.LED.NIR.flashlight"
    ## [21] "Generic.LED.UVA.flashlight"
    ## [22] "Godox.XeF.AD200.H200.flash"
    ## [23] "Godox.XeF.AD200.H200j.ADFT200.flash"
    ## [24] "Godox.XeF.AD200.H200j.FTSTS40w.flash"
    ## [25] "Godox.XeF.AD200.H200R.flash"
    ## [26] "Ikea.LED.6.3W.2700K"
    ## [27] "Jaxman.E2.LED.flashlight"
    ## [28] "Jaxman.U1c.LED.UVA.flood.flashlight"
    ## [29] "LCDlighting.FT.UVA.BL"
    ## [30] "Ledenergie.LED.Nano.T8.9.5W.4000K"
    ## [31] "Ledenergie.LED.Teho.T8.9W.4000K"
    ## [32] "Ledstore.LED.10W.4000K"
    ## [33] "Osram.FT.36W.25"
    ## [34] "Osram.FT.L36W.840"
    ## [35] "Osram.FT.L36W.865"
    ## [36] "Osram.HPS.Super.Vialox"
    ## [37] "Osram.Inc.20W"
    ## [38] "Osram.LED.10W.2700K"
    ## [39] "Osram.LED.8W.2700K"
    ## [40] "Osram.MH.HQIT.400W"
    ## [41] "Philips.CF.PLS.11W.927"
    ## [42] "Philips.FT.TL.40W.01.uv"
    ## [43] "Philips.FT.TL.40W.12"
    ## [44] "Philips.FT.TL.40W.12.uv"
    ## [45] "Philips.FT.TL5.35W.830.HE"
    ## [46] "Philips.FT.TLD.36W.15"
    ## [47] "Philips.FT.TLD.36W.18"
    ## [48] "Philips.FT.TLD.36W.18.lores"
    ## [49] "Philips.FT.TLD.36W.83"
    ## [50] "Philips.FT.TLD.36W.89"
    ## [51] "Philips.FT.TLD.36W.92"
    ## [52] "Philips.FT.TLD.36W.965"
    ## [53] "Philips.FT.TLD.36W.BLB.108"
    ## [54] "Philips.FT.TLL.36W.950"
    ## [55] "Philips.Inc.50W.spot.halogen"
    ## [56] "Philips.LED.T8.10W.840"
    ## [57] "QPanel.FT.UVB313.40W"
    ## [58] "QPanel.FT.UVB340.40W"
    ## [59] "Sunwayfoto.LED.FL96.at.3000K"
    ## [60] "Sunwayfoto.LED.FL96.at.4000K"
    ## [61] "Sunwayfoto.LED.FL96.at.5500K"
    ## [62] "Sylvania.FT.215W.VHO"
    ## [63] "Toshiba.LED.12W.2700K"
    ## [64] "Toshiba.LED.9.5W.2700K"
    ## [65] "V.light.LED.2W.6000K"
    ## [66] "Valoya.LED.B50.AP67.grow.lamp"
    ## [67] "Valoya.LED.RX600HW.Solray385.grow.lamp"

### Accesing individual spectra

We can use a name as index to extract an individual `source_spct` object.

    lamps.mspct$Generic.Inc.bulb.60W

    ## Object: source_spct [601 x 2]
    ## Wavelength range 300-900 nm, step 1 nm
    ## Label: Incandescent lamp: Generic bulb 60W ca. 1995
    ## Measured on 0-08-18 13:47:11 UTC
    ## Spectral data in s.e.irrad normalized to 1 at 900 nm (max in 300-900 nm)
    ## Variables:
    ##  w.length: Wavelength [nm]
    ##  s.e.irrad: Spectral energy irradiance [normalized]
    ## --
    ## # A tibble: 601 × 2
    ##    w.length s.e.irrad
    ##       <dbl>     <dbl>
    ##  1      300  0.000665
    ##  2      301  0.000325
    ##  3      302  0.000956
    ##  4      303  0.000702
    ##  5      304  0.000306
    ##  6      305  0.000825
    ##  7      306  0.00103
    ##  8      307  0.000361
    ##  9      308  0.000497
    ## 10      309  0.000627
    ## # ℹ 591 more rows

Or a character string.

    lamps.mspct[["Generic.Inc.bulb.60W"]]

    ## Object: source_spct [601 x 2]
    ## Wavelength range 300-900 nm, step 1 nm
    ## Label: Incandescent lamp: Generic bulb 60W ca. 1995
    ## Measured on 0-08-18 13:47:11 UTC
    ## Spectral data in s.e.irrad normalized to 1 at 900 nm (max in 300-900 nm)
    ## Variables:
    ##  w.length: Wavelength [nm]
    ##  s.e.irrad: Spectral energy irradiance [normalized]
    ## --
    ## # A tibble: 601 × 2
    ##    w.length s.e.irrad
    ##       <dbl>     <dbl>
    ##  1      300  0.000665
    ##  2      301  0.000325
    ##  3      302  0.000956
    ##  4      303  0.000702
    ##  5      304  0.000306
    ##  6      305  0.000825
    ##  7      306  0.00103
    ##  8      307  0.000361
    ##  9      308  0.000497
    ## 10      309  0.000627
    ## # ℹ 591 more rows

Be aware that according to R’s rules, using single square brackets will return a `source_mspct` object possibly of length one. This statement is not equivalent to the one in the chunk immediately above.

    lamps.mspct["Generic.Inc.bulb.60W"]

    ## Object: source_mspct [1 x 1]
    ## --- Member: Generic.Inc.bulb.60W ---
    ## Object: source_spct [601 x 2]
    ## Wavelength range 300-900 nm, step 1 nm
    ## Label: Incandescent lamp: Generic bulb 60W ca. 1995
    ## Measured on 0-08-18 13:47:11 UTC
    ## Spectral data in s.e.irrad normalized to 1 at 900 nm (max in 300-900 nm)
    ## Variables:
    ##  w.length: Wavelength [nm]
    ##  s.e.irrad: Spectral energy irradiance [normalized]
    ## --
    ## # A tibble: 601 × 2
    ##    w.length s.e.irrad
    ##       <dbl>     <dbl>
    ##  1      300  0.000665
    ##  2      301  0.000325
    ##  3      302  0.000956
    ##  4      303  0.000702
    ##  5      304  0.000306
    ##  6      305  0.000825
    ##  7      306  0.00103
    ##  8      307  0.000361
    ##  9      308  0.000497
    ## 10      309  0.000627
    ## # ℹ 591 more rows
    ##
    ## --- END ---

### Accessing subsets of spectra

We can subset the `source_mspct` object by indexing with vectors of character strings. The package provides some predefined ones, and users can easily define their own, either as constants or through computation. Here we use a vector defined by the package.

    lamps.mspct[Toshiba_lamps]

    ## Object: source_mspct [2 x 1]
    ## --- Member: Toshiba.LED.12W.2700K ---
    ## Object: source_spct [654 x 2]
    ## Wavelength range 251.16-898.81 nm, step 1.023182e-12-3.78 nm
    ## Label: LED lamp: Toshiba 12W 2700K
    ## Measured on 2018-02-12 09:08:23.957523 UTC
    ## Spectral data in s.e.irrad normalized to 1 at 607.3 nm (max in 251.16-898.81 nm)
    ## Variables:
    ##  w.length: Wavelength [nm]
    ##  s.e.irrad: Spectral energy irradiance [normalized]
    ## --
    ## # A tibble: 654 × 2
    ##    w.length s.e.irrad
    ##       <dbl>     <dbl>
    ##  1     251.         0
    ##  2     254.         0
    ##  3     255.         0
    ##  4     255.         0
    ##  5     256.         0
    ##  6     256.         0
    ##  7     257.         0
    ##  8     257.         0
    ##  9     258.         0
    ## 10     258.         0
    ## # ℹ 644 more rows
    ## --- Member: Toshiba.LED.9.5W.2700K ---
    ## Object: source_spct [737 x 2]
    ## Wavelength range 251.29-898.97 nm, step 1.023182e-12-3.78 nm
    ## Label: LED lamp: Toshiba 9.5W 2700K
    ## Measured on 2021-09-02 19:48:00.171366 UTC
    ## Spectral data in s.e.irrad normalized to 1 at 605.6 nm (max in 251.29-898.97 nm)
    ## Variables:
    ##  w.length: Wavelength [nm]
    ##  s.e.irrad: Spectral energy irradiance [normalized]
    ## --
    ## # A tibble: 737 × 2
    ##    w.length s.e.irrad
    ##       <dbl>     <dbl>
    ##  1     251.         0
    ##  2     255.         0
    ##  3     255.         0
    ##  4     256.         0
    ##  5     256.         0
    ##  6     257.         0
    ##  7     257.         0
    ##  8     257.         0
    ##  9     258.         0
    ## 10     258.         0
    ## # ℹ 727 more rows
    ##
    ## --- END ---

And below we use a computed one. In this case we extract the member spectra with names containing the string “toshiba”. More generaly one can search for matching names within the collection of spectra.

    lamps.mspct[grep("Toshiba", names(lamps.mspct))]

    ## Object: source_mspct [2 x 1]
    ## --- Member: Toshiba.LED.12W.2700K ---
    ## Object: source_spct [654 x 2]
    ## Wavelength range 251.16-898.81 nm, step 1.023182e-12-3.78 nm
    ## Label: LED lamp: Toshiba 12W 2700K
    ## Measured on 2018-02-12 09:08:23.957523 UTC
    ## Spectral data in s.e.irrad normalized to 1 at 607.3 nm (max in 251.16-898.81 nm)
    ## Variables:
    ##  w.length: Wavelength [nm]
    ##  s.e.irrad: Spectral energy irradiance [normalized]
    ## --
    ## # A tibble: 654 × 2
    ##    w.length s.e.irrad
    ##       <dbl>     <dbl>
    ##  1     251.         0
    ##  2     254.         0
    ##  3     255.         0
    ##  4     255.         0
    ##  5     256.         0
    ##  6     256.         0
    ##  7     257.         0
    ##  8     257.         0
    ##  9     258.         0
    ## 10     258.         0
    ## # ℹ 644 more rows
    ## --- Member: Toshiba.LED.9.5W.2700K ---
    ## Object: source_spct [737 x 2]
    ## Wavelength range 251.29-898.97 nm, step 1.023182e-12-3.78 nm
    ## Label: LED lamp: Toshiba 9.5W 2700K
    ## Measured on 2021-09-02 19:48:00.171366 UTC
    ## Spectral data in s.e.irrad normalized to 1 at 605.6 nm (max in 251.29-898.97 nm)
    ## Variables:
    ##  w.length: Wavelength [nm]
    ##  s.e.irrad: Spectral energy irradiance [normalized]
    ## --
    ## # A tibble: 737 × 2
    ##    w.length s.e.irrad
    ##       <dbl>     <dbl>
    ##  1     251.         0
    ##  2     255.         0
    ##  3     255.         0
    ##  4     256.         0
    ##  5     256.         0
    ##  6     257.         0
    ##  7     257.         0
    ##  8     257.         0
    ##  9     258.         0
    ## 10     258.         0
    ## # ℹ 727 more rows
    ##
    ## --- END ---

Set algebra operations can be used with the indexing vectors as each vector describes a single property: color, brand, type, etc.

    lamps.mspct[intersect(Philips_lamps, red_lamps)]

    ## Object: source_mspct [2 x 1]
    ## --- Member: Philips.FT.TLD.36W.15 ---
    ## Object: source_spct [601 x 2]
    ## Wavelength range 300-900 nm, step 1 nm
    ## Label: Fluorescent tube: Philips TLD 36W 15 ca. 1995
    ## Measured on 0-08-23 10:16:11 UTC
    ## Spectral data in s.e.irrad normalized to 1 at 660 nm (max in 300-900 nm)
    ## Variables:
    ##  w.length: Wavelength [nm]
    ##  s.e.irrad: Spectral energy irradiance [normalized]
    ## --
    ## # A tibble: 601 × 2
    ##    w.length s.e.irrad
    ##       <dbl>     <dbl>
    ##  1      300  0.000196
    ##  2      301  0.000959
    ##  3      302  0.000752
    ##  4      303  0.00110
    ##  5      304  0.00126
    ##  6      305  0.000885
    ##  7      306  0.000521
    ##  8      307  0.00153
    ##  9      308  0.000167
    ## 10      309  0.000493
    ## # ℹ 591 more rows
    ## --- Member: Philips.Inc.50W.spot.halogen ---
    ## Object: source_spct [870 x 2]
    ## Wavelength range 315-800 nm, step 0.1-3.76 nm
    ## Label: Incandescent lamp: Philips 50W spot halogen
    ## Measured on 2021-09-02 20:25:24.415699 UTC
    ## Spectral data in s.e.irrad normalized to 1 at 796.4 nm (max in 315-800 nm)
    ## Variables:
    ##  w.length: Wavelength [nm]
    ##  s.e.irrad: Spectral energy irradiance [normalized]
    ## --
    ## # A tibble: 870 × 2
    ##    w.length s.e.irrad
    ##       <dbl>     <dbl>
    ##  1     315   0.000587
    ##  2     316.  0.000837
    ##  3     316.  0.000430
    ##  4     317.  0.000782
    ##  5     318.  0.000617
    ##  6     318.  0.000766
    ##  7     319.  0.000573
    ##  8     319.  0.000709
    ##  9     322.  0.00152
    ## 10     323.  0.00149
    ## # ℹ 860 more rows
    ##
    ## --- END ---

### Accesing metadata

    what_measured(lamps.mspct$Eiko.F36T8.BLB)

    ## [1] "Fluorescent tube: Eiko F36T8 BLB"

    how_measured(lamps.mspct$Eiko.F36T8.BLB)

    ## [1] "Array spectrometer, Ocean Optics Maya 2000 Pro; Bentham cosine diffuser D7H; distance unknown."

For recently measured spectra, additional information is available.

    getInstrSettings(lamps.mspct$Eiko.F36T8.BLB)

    ## integ. time (s): 7.2, 7.2
    ## total time (s): 14.4, 14.4
    ## counts @ peak (% of max): 72.1

    getInstrDesc(lamps.mspct$Eiko.F36T8.BLB)

    ## Data acquired with 'MayaPro2000' s.n. MAYP11278
    ## grating 'HC1', slit '010s'
    ## diffuser 'unknown'

    getNormalisation(lamps.mspct$Eiko.F36T8.BLB)

    ## $norm.type
    ## [1] "max"
    ##
    ## $norm.wl
    ## [1] 365.09
    ##
    ## $norm.factors
    ## [1] 19.5156
    ##
    ## $norm.cols
    ## [1] "s.e.irrad"
    ##
    ## $norm.range
    ## [1] 251.29 898.97

### Rescaling spectral data

The spectra are normalized, and consequently, several summaries expressed in absolute units are undefined, and trigger errors. Summaries like ratios which are not affected by normalization are allowed and valid. The data have been normalized as the measuring conditions used are not all the same, and in many cases not well characterized (e.g. distance to light source, or exact alignment of the spectrometer input optics with respect to the center of the light beam from sources).

These uncertainties in the measurment conditions are likely to have minimal effect on the shape of the spectrum when plotted. This allows us to reconstruct the spectrum at a different distance from the lamp(s) or under a different number of lamps as long as we know the irradiance for some known waveband, such as PAR.

In this section we will rescale the spectral data so that after re-scaling a given target value for a summary quantity will be true. As an example, we will rescale one spectrum so that it yields an energy irradiance of 100 W m-2 for the range 400 to 700 nm. By default the returned spectrum is not labelled as being expressed in relative units, as the expectation is that the operation is done to obtain spectral emission data that could have been measured at a target condition that we want to simulate or reconstruct.

    my.spct <- fscale(lamps.mspct$Generic.Inc.bulb.60W,
                      range = c(400, 700),
                      f = e_irrad,
                      target = 100
                      )
    e_irrad(my.spct, waveband(c(400,700)))

    ## E_range.400.700
    ##             100
    ## attr(,"time.unit")
    ## [1] "second"
    ## attr(,"radiation.unit")
    ## [1] "total energy irradiance"

    is_scaled(my.spct)

    ## [1] FALSE

To do the scaling based on photon irradiance, different approaches are available to change the default. Here as above we specify the function to use through the argument passed to `f` and set a suitable target in mol m-2 s-1. We use 300e-6 to indicate 300 umol m-2 s-1.

    my.spct <- fscale(lamps.mspct$Generic.Inc.bulb.60W,
                      range = c(400, 700),
                      f = q_irrad,
                      target = 300e-6
                      )
    q_irrad(my.spct, waveband(c(400,700)))

    ## Q_range.400.700
    ##           3e-04
    ## attr(,"time.unit")
    ## [1] "second"
    ## attr(,"radiation.unit")
    ## [1] "total photon irradiance"

In the special case when `target == 1`, the default changes, assuming that in this case the intention is to re-express the spectral data in relative units.

    my.spct <- fscale(lamps.mspct$Generic.Inc.bulb.60W,
                      range = c(400, 700),
                      f = e_irrad,
                      target = 1
                      )
    is_scaled(my.spct)

    ## [1] TRUE

If we want to override the defaults for tagging as scaled, we ccan pass a suitable argument to parameter `set.scaled` of `fscale()`.

In addition to scaling based of the summary calculated by a function, as shown above, it is frequent to normalize spectral data. In this case scaling is done so that spectral irradiance matches a certain value at an specific wavelength. In most cases, the wavelength used is that of the maximal spectral irradiance, and the target value is 1. These are the defaults and in this case the returned spectra are always labeled as being normalized. We use a blue fluorescent tube for this example.

    normalize(lamps.mspct$Philips.FT.TLD.36W.15)

    ## Object: source_spct [601 x 2]
    ## Wavelength range 300-900 nm, step 1 nm
    ## Label: Fluorescent tube: Philips TLD 36W 15 ca. 1995
    ## Measured on 0-08-23 10:16:11 UTC
    ## Spectral data in s.e.irrad normalized to 1 at 660 nm (max in 300-900 nm)
    ## Variables:
    ##  w.length: Wavelength [nm]
    ##  s.e.irrad: Spectral energy irradiance [normalized]
    ## --
    ## # A tibble: 601 × 2
    ##    w.length s.e.irrad
    ##       <dbl>     <dbl>
    ##  1      300  0.000196
    ##  2      301  0.000959
    ##  3      302  0.000752
    ##  4      303  0.00110
    ##  5      304  0.00126
    ##  6      305  0.000885
    ##  7      306  0.000521
    ##  8      307  0.00153
    ##  9      308  0.000167
    ## 10      309  0.000493
    ## # ℹ 591 more rows

Ratios can be calculated directly as they are not affected by normalization or linear rescaling.

    q_ratio(my.spct, Red("Smith10"), Far_red("Smith10"))

    ## R:FR[q:q]
    ## 0.6606633
    ## attr(,"radiation.unit")
    ## [1] "q:q ratio"

### Plotting the spectra

Using `autoplot()` methods for spectra defined in package ‘ggspectra’ annotated plotting are created with automatically genrateda xis labels, annotations and decorations. The defaults can be easily changed, please see the documentation in package ‘ggspectra’. For most of the data included in the package, as told above, exact alignment was not ensured and the exact distance not recorded. In such cases the data included in the package have been normalized to 1 at the tallest peak of emission, as can be seen in the example below.

    autoplot(lamps.mspct$Osram.LED.8W.2700K, w.band = VIS(), span = 51)

Data for a four channel, remote controlled, LED bulb is included in object `ledsavers.mspct`.

    what_measured(ledsavers.mspct$purple)

    ## [1] "LED lamp: LedSavers 7.5W four channels (WRGB)."

    how_measured(ledsavers.mspct$purple)

    ## [1] "Array spectrometer, Ocean Optics Maya 2000 Pro; Bentham cosine diffuser D7H; distance unknown."

In this case, data are not normalized, as all spectra in the object have been measure with the lamp and entrance optics in exactly the same position, controlling emission with wireless remote controller. In the next example we see that purple is created as a mix of blue and red light.

    autoplot(ledsavers.mspct$purple, w.band = VIS(), span = 51)

Using the `ggplot()` method for spectra from package ‘ggspectra’ plus geometries and statistics from package ‘ggplot2’ we gain additional control on the design.

    ggplot(ledsavers.mspct$purple) +
      geom_line(linetype = "dashed") +
      theme_classic()

We can also plot multiple spectra. In this example we plot the pure emission from each of the four channels of the bulb.

    autoplot(ledsavers.mspct[c( "W", "R", "G", "B")],
             annotations = c("+", "title:what"), w.band = VIS(), span = 51) +
      labs(linetype = "Channel")

### Using the data in other contexts

In general it will be easiest to use methods from packages in the ‘r4photobiology’ suite for plotting and calculation of various summaries. However, as `source_mspct` is a class derived from `list`, and `source_spct` is derived from `tibble::tibble` that is a partly compatible reimplementation of `data.frame` the data can be used very easily with R functions expecting data frames as input.

    head(as.data.frame(lamps.mspct$Osram.LED.8W.2700K))

    ##   w.length s.e.irrad
    ## 1   251.16         0
    ## 2   254.95         0
    ## 3   258.75         0
    ## 4   259.22         0
    ## 5   261.59         0
    ## 6   262.07         0

Of course `attach` and `with` also work as expected.

    attach(lamps.mspct)
    q_ratio(Osram.LED.8W.2700K, Blue(), Red())

    ## Blue:Red[q:q]
    ##     0.1395151
    ## attr(,"radiation.unit")
    ## [1] "q:q ratio"

    detach(lamps.mspct)

    attach(lamps.mspct)
    with(Osram.LED.8W.2700K, max(w.length))

    ## [1] 898.81

    detach(lamps.mspct)

    with(lamps.mspct, q_ratio(Osram.LED.8W.2700K, Blue(), Red()))

    ## Blue:Red[q:q]
    ##     0.1395151
    ## attr(,"radiation.unit")
    ## [1] "q:q ratio"

## Other data sets

The additional data sets can be used similarly as described above for `lamps.spct` when stored as collections. For datasets stored in long-form an additional variable or column identifies the individual spectra.

## Ultraviolet-B lamps and temperature

Object `qp_uvb313_temp.spct` is a `source_spct` object that contains spectra in long form for a pair of UV-B lamps measured at 7 different air temperatures.

    head(qp_uvb313_temp.spct)

    ## Object: source_spct [6 x 3]
    ## containing 7 spectra in long form
    ## Wavelength range 290-295 nm, step 1 nm
    ## Label: Fluorescent tube: Q-Panel UVB313 40W at -5C to 35C
    ## Measured on 1997-05-19 UTC
    ## Variables:
    ##  w.length: Wavelength [nm]
    ##  s.e.irrad: Spectral energy irradiance [W m-2 nm-1]
    ## --
    ## # A tibble: 6 × 3
    ##   temperature w.length s.e.irrad
    ##         <dbl>    <int>     <dbl>
    ## 1          -5      290  0
    ## 2          -5      291  0
    ## 3          -5      292  0
    ## 4          -5      293  0.000170
    ## 5          -5      294  0.000537
    ## 6          -5      295  0.00126

    unique(qp_uvb313_temp.spct$temperature)

    ## [1] -5  0  5 10 20 30 35

Collection `qp_uvb313_temp.mspct` contains the same spectra as `qp_uvb313_temp.spct` as a collection of individual `source_spct` objects.

    names(qp_uvb313_temp.mspct)

    ## [1] "minus05C" "plus00C"  "plus05C"  "plus10C"  "plus20C"  "plus30C"  "plus35C"

    summary(qp_uvb313_temp.mspct)

    ## Summary of source_mspct [7 x 1] object: qp_uvb313_temp.mspct
    ## # A tibble: 7 × 8
    ##   spct.idx class  dim   w.length.min w.length.max colnames multiple.wl time.unit
    ##   <chr>    <chr>  <chr>        <int>        <int> <list>         <dbl> <Duratio>
    ## 1 minus05C sourc… [111…          290          400 <chr>              7 1s
    ## 2 plus00C  sourc… [111…          290          400 <chr>              7 1s
    ## 3 plus05C  sourc… [111…          290          400 <chr>              7 1s
    ## 4 plus10C  sourc… [111…          290          400 <chr>              7 1s
    ## 5 plus20C  sourc… [111…          290          400 <chr>              7 1s
    ## 6 plus30C  sourc… [111…          290          400 <chr>              7 1s
    ## 7 plus35C  sourc… [111…          290          400 <chr>              7 1s

    head(qp_uvb313_temp.mspct$minus05C)

    ## Object: source_spct [6 x 3]
    ## containing 7 spectra in long form
    ## Wavelength range 290-295 nm, step 1 nm
    ## Label: Fluorescent tube: Q-Panel UVB313 40W at -5C
    ## Measured on 1997-05-19 UTC
    ## Variables:
    ##  w.length: Wavelength [nm]
    ##  s.e.irrad: Spectral energy irradiance [W m-2 nm-1]
    ## --
    ## # A tibble: 6 × 3
    ##   temperature w.length s.e.irrad
    ##         <dbl>    <int>     <dbl>
    ## 1          -5      290  0
    ## 2          -5      291  0
    ## 3          -5      292  0
    ## 4          -5      293  0.000170
    ## 5          -5      294  0.000537
    ## 6          -5      295  0.00126

## Multicolour LED lamp

Collection `ledsavers.mspct` contains 16 spectra. Each spectrum corresponds to a different combination of dimming settings of the four channels in this RGBW (red, green, blue, white) lamp.

    names(ledsavers.mspct)

    ##  [1] "B"             "blue.green"    "bluish.green"  "cool.green"
    ##  [5] "dark.orange"   "fuchsia"       "G"             "greenish.blue"
    ##  [9] "orange"        "pink"          "purple"        "R"
    ## [13] "sand"          "W"             "warm.blue"     "yellow"

We can plot the spectra for the individual channels by selecting them.

    autoplot(ledsavers.mspct[c("R", "G", "B", "W")],
             w.band = VIS_bands(), span = 51)

## Video and photography lamps

Collection `sunwayfoto_fl96.mspct` contains 7 spectra. Each spectrum corresponds to a different combination of dimming and colour temperature settings of a two channel or bi-colour (warm white and cool white) lamp sold for use in photography and video..

    names(sunwayfoto_fl96.mspct)

    ## [1] "3000K.100pc" "4000K.100pc" "5500K.100pc" "4000K.50pc"  "4000K.25pc"
    ## [6] "4000K.12pc"  "4000K.5pc"

    what_measured(sunwayfoto_fl96.mspct)

    ## # A tibble: 7 × 2
    ##   spct.idx    what.measured
    ##   <fct>       <chr>
    ## 1 3000K.100pc LED white bi-colour video lamp: Sunwayfoto Fill Light FL96 at 300…
    ## 2 4000K.100pc LED white bi-colour video lamp: Sunwayfoto Fill Light FL96 at 400…
    ## 3 5500K.100pc LED white bi-colour video lamp: Sunwayfoto Fill Light FL96 at 550…
    ## 4 4000K.50pc  LED white bi-colour video lamp: Sunwayfoto Fill Light FL96 at 400…
    ## 5 4000K.25pc  LED white bi-colour video lamp: Sunwayfoto Fill Light FL96 at 400…
    ## 6 4000K.12pc  LED white bi-colour video lamp: Sunwayfoto Fill Light FL96 at 400…
    ## 7 4000K.5pc   LED white bi-colour video lamp: Sunwayfoto Fill Light FL96 at 400…

Collection `elgato_klm_cct.mspct` contains 12 spectra. Each spectrum corresponds to a different colour temperature setting of a two channel or bi-colour (warm white and cool white) lamp sold for use in photography and video. Measurements were done with dimming set at full power.

    names(elgato_klm_cct.mspct)

    ##  [1] "at.7000K.dimmed.to.100pc" "at.6500K.dimmed.to.100pc"
    ##  [3] "at.6000K.dimmed.to.100pc" "at.5500K.dimmed.to.100pc"
    ##  [5] "at.5000K.dimmed.to.100pc" "at.4500K.dimmed.to.100pc"
    ##  [7] "at.4250K.dimmed.to.100pc" "at.4000K.dimmed.to.100pc"
    ##  [9] "at.3750K.dimmed.to.100pc" "at.3500K.dimmed.to.100pc"
    ## [11] "at.3250K.dimmed.to.100pc" "at.2900K.dimmed.to.100pc"

    what_measured(elgato_klm_cct.mspct)

    ## # A tibble: 12 × 2
    ##    spct.idx                 what.measured
    ##    <fct>                    <chr>
    ##  1 at.7000K.dimmed.to.100pc LED white bi-colour video lamp: Elgato Key Light Mi…
    ##  2 at.6500K.dimmed.to.100pc LED white bi-colour video lamp: Elgato Key Light Mi…
    ##  3 at.6000K.dimmed.to.100pc LED white bi-colour video lamp: Elgato Key Light Mi…
    ##  4 at.5500K.dimmed.to.100pc LED white bi-colour video lamp: Elgato Key Light Mi…
    ##  5 at.5000K.dimmed.to.100pc LED white bi-colour video lamp: Elgato Key Light Mi…
    ##  6 at.4500K.dimmed.to.100pc LED white bi-colour video lamp: Elgato Key Light Mi…
    ##  7 at.4250K.dimmed.to.100pc LED white bi-colour video lamp: Elgato Key Light Mi…
    ##  8 at.4000K.dimmed.to.100pc LED white bi-colour video lamp: Elgato Key Light Mi…
    ##  9 at.3750K.dimmed.to.100pc LED white bi-colour video lamp: Elgato Key Light Mi…
    ## 10 at.3500K.dimmed.to.100pc LED white bi-colour video lamp: Elgato Key Light Mi…
    ## 11 at.3250K.dimmed.to.100pc LED white bi-colour video lamp: Elgato Key Light Mi…
    ## 12 at.2900K.dimmed.to.100pc LED white bi-colour video lamp: Elgato Key Light Mi…

    autoplot(elgato_klm_cct.mspct)

Collection `elgato_klm_dim.mspct` contains 6 spectra. Each spectrum corresponds to a different dimming setting of a two channel or bi-colour (warm white and cool white) lamp sold for use in photography and video. Measurements were done with colour temperature (CCT) set to 4000K.

    names(elgato_klm_dim.mspct)

    ## [1] "at.4000K.dimmed.to.100pc" "at.4000K.dimmed.to.50pc"
    ## [3] "at.4000K.dimmed.to.25pc"  "at.4000K.dimmed.to.12pc"
    ## [5] "at.4000K.dimmed.to.6pc"   "at.4000K.dimmed.to.3pc"

    what_measured(elgato_klm_dim.mspct)

    ## # A tibble: 6 × 2
    ##   spct.idx                 what.measured
    ##   <fct>                    <chr>
    ## 1 at.4000K.dimmed.to.100pc LED white bi-colour video lamp: Elgato Key Light Min…
    ## 2 at.4000K.dimmed.to.50pc  LED white bi-colour video lamp: Elgato Key Light Min…
    ## 3 at.4000K.dimmed.to.25pc  LED white bi-colour video lamp: Elgato Key Light Min…
    ## 4 at.4000K.dimmed.to.12pc  LED white bi-colour video lamp: Elgato Key Light Min…
    ## 5 at.4000K.dimmed.to.6pc   LED white bi-colour video lamp: Elgato Key Light Min…
    ## 6 at.4000K.dimmed.to.3pc   LED white bi-colour video lamp: Elgato Key Light Min…

    autoplot(elgato_klm_dim.mspct)

Collection `amaran_m9.mspct` contains 6 spectra. Each spectrum corresponds to a different dimming setting of a single channel (cool white) lamp sold for use in photography and video.

    names(amaran_m9.mspct)

    ## [1] "dimmed.9of9" "dimmed.7of9" "dimmed.5of9" "dimmed.3of9" "dimmed.1of9"
    ## [6] "dimmed.0of9"

    what_measured(amaran_m9.mspct)

    ## # A tibble: 6 × 2
    ##   spct.idx    what.measured
    ##   <fct>       <chr>
    ## 1 dimmed.9of9 LED cool-white video lamp: Aputure Amaran AL-M9 dimmed 9/9 160mm
    ## 2 dimmed.7of9 LED cool-white video lamp: Aputure Amaran AL-M9 dimmed 7/9 160mm
    ## 3 dimmed.5of9 LED cool-white video lamp: Aputure Amaran AL-M9 dimmed 5/9 160mm
    ## 4 dimmed.3of9 LED cool-white video lamp: Aputure Amaran AL-M9 dimmed 3/9 160mm
    ## 5 dimmed.1of9 LED cool-white video lamp: Aputure Amaran AL-M9 dimmed 1/9 160mm
    ## 6 dimmed.0of9 LED cool-white video lamp: Aputure Amaran AL-M9 dimmed 0/9 160mm

## Night vision video and photography lamp

Collection `andoer_ir49.mspct` contains 2 spectra. Each spectrum corresponds to a different dimming setting of a single channel (infra-red) lamp sold for use in photography and video. This requires a modified or special camera sensitive to near infrared radiation (NIR)

    names(andoer_ir49.mspct)

    ## [1] "dimmed.100pc" "dimmed.10pc"

    what_measured(andoer_ir49.mspct)

    ## # A tibble: 2 × 2
    ##   spct.idx     what.measured
    ##   <fct>        <chr>
    ## 1 dimmed.100pc LED IR video lamp: Andoer IR49S at max power
    ## 2 dimmed.10pc  LED IR video lamp: Andoer IR49S at min power