Introduction

This package, is a data only package, part of a suite, which has package ‘photobiology’ at its core. Please visit (http://www.r4photobiology.info/) for additional information. For 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)
## Loading required package: tibble
## News at https://www.r4photobiology.info/
library(photobiologyWavebands)
library(photobiologyFilters)
library(ggspectra)
## Loading required package: ggplot2
## Registered S3 methods overwritten by 'ggplot2':
##   method         from 
##   [.quosures     rlang
##   c.quosures     rlang
##   print.quosures rlang

In this very brief User Guide we describe how to access individual spectra or subsets of spectra.

The data

Spectral data is included both for optical filters, sold as such, and for materials that either on purpose or by accident may be interposed in the “light” path in photobiological experiments, including plastic sheets and films. It must be kept in mind that, 1) absorptance depends on the thickness of a filter in addition to the properties of the material it is made off, and that 2) reflectance depends on the angle of incidence of the light beam.

The spectral data have been acquired with an assortment of different instruments. Some data are measured by the authors with spectrophotometers, others have been provided by filter manufacturers.

The difference in resolution and slit function among instruments can give, for the same filter, measured “apparent” peaks and valleys of slightly different width, and slopes of slightly different steepness. This is an inevitable artefact of spectral measurements, but as except for some dichroic (= interference) filters have relatively wide (“Gaussian”) peaks the distortion is small.

Another important consideration is that some materials scatter transmitted and reflected light, and consequently such materials can be accurately measured by only use of an integrating sphere. Data included here have been in many cases measured without an integrating sphere; i.e. only by assessing the direct beam. For non-scattering materials this causes minor errors.

Glass-filter properties vary to some extent among melt batches. Variation can also be expected among batches of plastic filters. Furthermore, filters age upon exposure to light and UV radiation, and in some cases even upon exposure to air. Ageing is not limited to plastic filters and can also affect optical glass.

We do not provide spectral reflectance data for the filters in this collection, as we do not have such data available. For filters made of ionic glass and coloured plastics, reflection is not selective, and amounts to about 9 to 10% of radiation incident at an angle close to perpendicular to the surface. Anti-reflection coating (ARC) reduces reflections, and multi-coating (MC) even further. Such coatings are not equally effective at all wavelengths and, consequently, their use can modify the spectral properties of a filter. In contrast to the filters described above, dichroic or interference filters reflect the “rejected” radiation. It is also possible to produce filters that have an absorbing glass as substrate and a dichroic coating deposited onto one or both of its surfaces.

All the spectral data in this package are stored in a single R object, a collection of spectra of class filter_spct. Individual or subsets of spectra can be retrieved by name. The package includes also several character vectors of names, each one containing names for filters of a given color, a given type or from a given manufacturer. The names of all these vectors are available in vector `all_filter_accessors. The names used are in most cases the codes used by the manufacturers for the given type. Any dashes in these codes have been replaced by underscores.

##  [1] "BPI_Luminance"                   "BPI_Solatrol"                   
##  [3] "Foiltek_Clear_PET_G"             "Heliopan_BG38"                  
##  [5] "McDermit_PET_Autostat_CT5_125um" "MIDOPT_AB555"                   
##  [7] "MIDOPT_Bi405"                    "MIDOPT_Bi440"                   
##  [9] "MIDOPT_Bi450"                    "MIDOPT_Bi518"                   
## [11] "MIDOPT_Bi520"                    "MIDOPT_Bi550"                   
## [13] "MIDOPT_Bi632"                    "MIDOPT_Bi650"                   
## [15] "MIDOPT_Bi660"                    "MIDOPT_Bi685"                   
## [17] "MIDOPT_Bi725"                    "MIDOPT_Bi780"                   
## [19] "MIDOPT_Bi808"                    "MIDOPT_Bi830"                   
## [21] "MIDOPT_Bi850"                    "MIDOPT_Bi880"                   
## [23] "MIDOPT_Bi905"                    "MIDOPT_BN470"                   
## [25] "MIDOPT_BN485"                    "MIDOPT_BN490"                   
## [27] "MIDOPT_BN532"                    "MIDOPT_BN535"                   
## [29] "MIDOPT_BN595"                    "MIDOPT_BN630"                   
## [31] "MIDOPT_BN650"                    "MIDOPT_BN660"                   
## [33] "MIDOPT_BN740"                    "MIDOPT_BN785"                   
## [35] "MIDOPT_BN810"                    "MIDOPT_BN840"                   
## [37] "MIDOPT_BN850"                    "MIDOPT_BN880"                   
## [39] "MIDOPT_BN940"                    "MIDOPT_BP250"                   
## [41] "MIDOPT_BP324"                    "MIDOPT_BP365"                   
## [43] "MIDOPT_BP470"                    "MIDOPT_BP485"                   
## [45] "MIDOPT_BP500"                    "MIDOPT_BP505"                   
## [47] "MIDOPT_BP525"                    "MIDOPT_BP550"                   
## [49] "MIDOPT_BP590"                    "MIDOPT_BP635"                   
## [51] "MIDOPT_BP660"                    "MIDOPT_BP695"                   
## [53] "MIDOPT_BP735"                    "MIDOPT_BP800"                   
## [55] "MIDOPT_BP810"                    "MIDOPT_BP845"                   
## [57] "MIDOPT_BP850"                    "MIDOPT_BP865"                   
## [59] "MIDOPT_BP880"                    "MIDOPT_DB395_870"               
## [61] "MIDOPT_DB475_850"                "MIDOPT_DB550_850"               
## [63] "MIDOPT_DB660_850"                "MIDOPT_DB735"                   
## [65] "MIDOPT_DB850"                    "MIDOPT_DB940"                   
## [67] "MIDOPT_PE530"                    "MIDOPT_TB475_550_850"           
## [69] "MIDOPT_TB550_660_850"            "Schott_BG18"                    
## [71] "Schott_BG25"                     "Schott_BG3"                     
## [73] "Schott_BG36"                     "Schott_BG38"                    
## [75] "Schott_BG39"                     "Schott_BG40"                    
## [77] "Schott_BG42"                     "Schott_BG50"                    
## [79] "Schott_BG55"                     "Schott_BG60"                    
## [81] "Schott_BG60HT"                   "Schott_BG61"                    
## [83] "Schott_BG62"                     "Schott_BG62HS"                  
## [85] "Schott_BG62HT"                   "Schott_BG63"                    
## [87] "Schott_BG64"                     "Schott_BG66HS"                  
## [89] "Schott_BG67"                     "Schott_BG7"                     
## [91] "Schott_UG1"                      "Schott_UG11"                    
## [93] "Schott_UG2A"                     "Schott_UG5"                     
## [95] "Unbranded_Clear_LD_PE_50um"      "Unbranded_Clear_LD_PE_50um_used"
## [97] "UQG_Blue_dichroic_CDB"           "UQG_UG1_2mm"
##  [1] "Schott_UG1"     "Schott_UG5"     "Schott_UG11"    "Schott_BG3"    
##  [5] "Schott_BG7"     "Schott_BG18"    "Schott_BG25"    "Schott_BG36"   
##  [9] "Schott_BG38"    "Schott_BG39"    "Schott_BG40"    "Schott_BG42"   
## [13] "Schott_S_8612"  "Schott_BG50"    "Schott_BG55"    "Schott_BG60"   
## [17] "Schott_BG60HT"  "Schott_BG61"    "Schott_BG62"    "Schott_BG62HT" 
## [21] "Schott_BG63"    "Schott_BG64"    "Schott_VG9"     "Schott_VG20"   
## [25] "Schott_S_8022"  "Schott_S_8023"  "Schott_GG395"   "Schott_GG400"  
## [29] "Schott_GG420"   "Schott_GG435"   "Schott_GG455"   "Schott_GG475"  
## [33] "Schott_GG495"   "Schott_OG515"   "Schott_OG530"   "Schott_OG550"  
## [37] "Schott_OG570"   "Schott_OG590"   "Schott_RG9"     "Schott_RG610"  
## [41] "Schott_RG630"   "Schott_RG645"   "Schott_RG665"   "Schott_RG695"  
## [45] "Schott_RG715"   "Schott_RG780"   "Schott_RG830"   "Schott_RG850"  
## [49] "Schott_RG1000"  "Schott_NG1"     "Schott_NG3"     "Schott_NG4"    
## [53] "Schott_NG5"     "Schott_NG9"     "Schott_NG11"    "Schott_N_WG280"
## [57] "Schott_N_WG295" "Schott_N_WG305" "Schott_N_WG320" "Schott_KG1"    
## [61] "Schott_KG2"     "Schott_KG3"     "Schott_KG5"     "Schott_BG67"   
## [65] "Schott_UG2A"    "Schott_BG62HS"  "Schott_BG66HS"

Accessing individual spectra

The filter_spct member objects in filters.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. The names are listed in the documentation and also available through the “Data Catalogue” vignette. They can also be listed with method names().

head(names(filters.mspct), 6)
## [1] "Baader_U_filter"             "BPI_Luminance"              
## [3] "BPI_Solatrol"                "BW_007_Clear_MRC_nano"      
## [5] "Courttaulds_CA_115um"        "Courttaulds_CA_115um_age000"

We can use a character string as index to extract an individual filter_spct object.

## Object: filter_spct [1,001 x 2]
## Wavelength range 200 to 5200 nm, step 1 to 50 nm 
## Label: SCHOTT UG11, thickness (m): 0.001 
## 
## # A tibble: 1,001 x 2
##    w.length     Tfr
##       <dbl>   <dbl>
##  1      200 0.00001
##  2      201 0.00001
##  3      202 0.00001
##  4      203 0.00001
##  5      204 0.00001
##  6      205 0.00001
##  7      206 0.00001
##  8      207 0.00001
##  9      208 0.00001
## 10      209 0.00001
## # ... with 991 more rows
## Object: filter_spct [1,001 x 2]
## Wavelength range 200 to 5200 nm, step 1 to 50 nm 
## Label: SCHOTT UG11, thickness (m): 0.001 
## 
## # A tibble: 1,001 x 2
##    w.length     Tfr
##       <dbl>   <dbl>
##  1      200 0.00001
##  2      201 0.00001
##  3      202 0.00001
##  4      203 0.00001
##  5      204 0.00001
##  6      205 0.00001
##  7      206 0.00001
##  8      207 0.00001
##  9      208 0.00001
## 10      209 0.00001
## # ... with 991 more rows

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

## Object: filter_mspct [1 x 1]
## --- Member: Schott_UG11 ---
## Object: filter_spct [1,001 x 2]
## Wavelength range 200 to 5200 nm, step 1 to 50 nm 
## Label: SCHOTT UG11, thickness (m): 0.001 
## 
## # A tibble: 1,001 x 2
##    w.length     Tfr
##       <dbl>   <dbl>
##  1      200 0.00001
##  2      201 0.00001
##  3      202 0.00001
##  4      203 0.00001
##  5      204 0.00001
##  6      205 0.00001
##  7      206 0.00001
##  8      207 0.00001
##  9      208 0.00001
## 10      209 0.00001
## # ... with 991 more rows
## 
## --- END ---

Of course, with this syntax it is possible to use a vector of member names.

Accessing subsets of spectra

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

## Object: filter_mspct [3 x 1]
## --- Member: glass_nn ---
## Object: filter_spct [911 x 2]
## Wavelength range 190 to 1100 nm, step 1 nm 
## Label: Petri dish lid;  glass 
## 
## # A tibble: 911 x 2
##    w.length      Tfr
##       <int>    <dbl>
##  1      190 0.000164
##  2      191 0.000193
##  3      192 0.000111
##  4      193 0.000115
##  5      194 0.000139
##  6      195 0.000101
##  7      196 0.000129
##  8      197 0.000102
##  9      198 0.000100
## 10      199 0.000100
## # ... with 901 more rows
## --- Member: PS_Sterilin101 ---
## Object: filter_spct [911 x 2]
## Wavelength range 190 to 1100 nm, step 1 nm 
## Label: Petri dish lid;  polystyrene;  Sterilin101 
## 
## # A tibble: 911 x 2
##    w.length      Tfr
##       <int>    <dbl>
##  1      190 0.000104
##  2      191 0.000130
##  3      192 0.000154
##  4      193 0.000150
##  5      194 0.000117
##  6      195 0.000100
##  7      196 0.000120
##  8      197 0.000101
##  9      198 0.000100
## 10      199 0.000100
## # ... with 901 more rows
## --- Member: PS_Sterilin109 ---
## Object: filter_spct [911 x 2]
## Wavelength range 190 to 1100 nm, step 1 nm 
## Label: Petri dish lid;  polystyrene;  Sterilin109 
## 
## # A tibble: 911 x 2
##    w.length      Tfr
##       <int>    <dbl>
##  1      190 0.000178
##  2      191 0.000116
##  3      192 0.000172
##  4      193 0.000111
##  5      194 0.000100
##  6      195 0.000100
##  7      196 0.000130
##  8      197 0.000102
##  9      198 0.000100
## 10      199 0.000100
## # ... with 901 more rows
## 
## --- END ---

The vector all_filter_accessors contains the names of the different vectors of names of members of filters.mspct.

##  [1] "acetate_filters"            "acrylic_filters"           
##  [3] "baader_filters"             "band_pass_filters"         
##  [5] "blue_filters"               "blue_green_filters"        
##  [7] "bpi_visqueen_filters"       "bw_filters"                
##  [9] "clear_filters"              "courtaulds_filters"        
## [11] "etola_filters"              "evonik_filters"            
## [13] "fake_unbranded_filters"     "firecrest_filters"         
## [15] "foiltek_filters"            "green_filters"             
## [17] "haida_filters"              "Haida_filters"             
## [19] "heat_filters"               "heliopan_filters"          
## [21] "hoya_filters"               "kenko_filters"             
## [23] "kolarivision_filters"       "lee_filters"               
## [25] "long_pass_filters"          "mcdermit_filters"          
## [27] "midopt_filters"             "neutral_filters"           
## [29] "optical_glass_filters"      "orange_filters"            
## [31] "photography_filters"        "plastic_film_filters"      
## [33] "plastic_sheet_filters"      "plexiglas_filters"         
## [35] "polycarbonate_filters"      "polyester_filters"         
## [37] "polystyrene_filters"        "polyvynil_chloride_filters"
## [39] "red_nir_filters"            "rocolax_filters"           
## [41] "rosco_filters"              "schott_filters"            
## [43] "short_pass_filters"         "tiffen_filters"            
## [45] "uqg_filters"                "uv_filters"                
## [47] "uvir_cut_filters"           "uvroptics_filters"         
## [49] "xl_horticulture_filters"    "yellow_filters"            
## [51] "zeiss_filters"              "zomei_filters"

In addition to the predefined vectors it is possible to compute numeric indexing vectors using pattern matching with grep(). In this example we extract the member spectra with names containing the string “UG”.

filters.mspct[grep("UG", names(filters.mspct))]
## Object: filter_mspct [5 x 1]
## --- Member: Schott_UG1 ---
## Object: filter_spct [1,001 x 2]
## Wavelength range 200 to 5200 nm, step 1 to 50 nm 
## Label: SCHOTT UG1, thickness (m): 0.001 
## 
## # A tibble: 1,001 x 2
##    w.length   Tfr
##       <dbl> <dbl>
##  1      200    NA
##  2      201    NA
##  3      202    NA
##  4      203    NA
##  5      204    NA
##  6      205    NA
##  7      206    NA
##  8      207    NA
##  9      208    NA
## 10      209    NA
## # ... with 991 more rows
## --- Member: Schott_UG11 ---
## Object: filter_spct [1,001 x 2]
## Wavelength range 200 to 5200 nm, step 1 to 50 nm 
## Label: SCHOTT UG11, thickness (m): 0.001 
## 
## # A tibble: 1,001 x 2
##    w.length     Tfr
##       <dbl>   <dbl>
##  1      200 0.00001
##  2      201 0.00001
##  3      202 0.00001
##  4      203 0.00001
##  5      204 0.00001
##  6      205 0.00001
##  7      206 0.00001
##  8      207 0.00001
##  9      208 0.00001
## 10      209 0.00001
## # ... with 991 more rows
## --- Member: Schott_UG2A ---
## Object: filter_spct [1,001 x 2]
## Wavelength range 200 to 5200 nm, step 1 to 50 nm 
## Label: SCHOTT UG2A, thickness (m): 0.00325 
## 
## # A tibble: 1,001 x 2
##    w.length   Tfr
##       <dbl> <dbl>
##  1      200    NA
##  2      201    NA
##  3      202    NA
##  4      203    NA
##  5      204    NA
##  6      205    NA
##  7      206    NA
##  8      207    NA
##  9      208    NA
## 10      209    NA
## # ... with 991 more rows
## --- Member: Schott_UG5 ---
## Object: filter_spct [1,001 x 2]
## Wavelength range 200 to 5200 nm, step 1 to 50 nm 
## Label: SCHOTT UG5, thickness (m): 0.001 
## 
## # A tibble: 1,001 x 2
##    w.length     Tfr
##       <dbl>   <dbl>
##  1      200 0.00001
##  2      201 0.00001
##  3      202 0.00001
##  4      203 0.00001
##  5      204 0.00001
##  6      205 0.00001
##  7      206 0.00001
##  8      207 0.00001
##  9      208 0.00001
## 10      209 0.00001
## # ... with 991 more rows
## --- Member: UQG_UG1_2mm ---
## Object: filter_spct [831 x 2]
## Wavelength range 190 to 1020 nm, step 1 nm 
## Label: Glass filter: UQG UG1 2mm 
## 
## # A tibble: 831 x 2
##    w.length      Tfr
##  *    <dbl>    <dbl>
##  1      190 0.000133
##  2      191 0.000107
##  3      192 0.000100
##  4      193 0.000100
##  5      194 0.000100
##  6      195 0.000100
##  7      196 0.000100
##  8      197 0.000118
##  9      198 0.000101
## 10      199 0.000100
## # ... with 821 more rows
## 
## --- END ---

To generate the subset of names matching a pattern, we can also use grep().

grep("UG", names(filters.mspct), value = TRUE)
## [1] "Schott_UG1"  "Schott_UG11" "Schott_UG2A" "Schott_UG5"  "UQG_UG1_2mm"

Querying metadata

The spectra are saved in objects of class "filter_spct", defined in package ‘photobiology’. Specializations of several methods including print() and summary() include a summary of the metadata in the header of the printout.

## Object: filter_spct [1,001 x 2]
## Wavelength range 200 to 5200 nm, step 1 to 50 nm 
## Label: SCHOTT UG11, thickness (m): 0.001 
## 
## # A tibble: 1,001 x 2
##    w.length     Tfr
##       <dbl>   <dbl>
##  1      200 0.00001
##  2      201 0.00001
##  3      202 0.00001
##  4      203 0.00001
##  5      204 0.00001
##  6      205 0.00001
##  7      206 0.00001
##  8      207 0.00001
##  9      208 0.00001
## 10      209 0.00001
## # ... with 991 more rows

Metadata can also be queried with other methods. Please, see the documentation for package ‘photobiology’ for the details.

getWhatMeasured(filters.mspct$Schott_UG11)
## [1] "SCHOTT UG11, thickness (m): 0.001"
getHowMeasured(filters.mspct$Schott_UG11)
## [1] "Numerical data from manufacturer."
is_normalized(filters.mspct$Schoot_UG11)
## [1] NA
cat(comment(filters.mspct$Schott_UG11), "\n")
## SCHOTT filter 'UG11' data, reference thickness (m): 0.001 and reflectance factor: 0.908
##  (c) copyright SCHOTT, reproduced with permission.

Of the different metadata items, the type of data is of great importance. Transmittance (and absorptance) can be expressed in two different ways: 1) taking incident radiation as reference, or 2) taking radiation entering the material as reference (i.e. discounting reflection). 1) is referred as total transmittance while 2) is referred as internal transmittance. Attribute `Tfr.type" is used to store this information.

getTfrType(filters.mspct$Schott_UG11)
## [1] "internal"

Plotting

Spectra can be plotted in the same ways as other data stored in data frames, using base R graphics, package ‘lattice’ or ‘ggplot2’. However, another package in our suite, ‘ggspectra’, built as an extension to ‘ggplot2’ makes plotting spectra extremely easy.

autoplot() methods use the metadata in the objects to set labels and decorations, as well as automatically setting the mapping of the x and y aesthetics.

To graphically compare filters, we can pass a collection of spectral objects, such as subset of filters.mspct.

autoplot(filters.mspct[c("Schott_UG1", "Schott_UG11")], 
         range = c(200, 800),
         annotations = c("+", "boundaries"), 
         span = 11)
## Warning: Removed 58 rows containing non-finite values (stat_peaks).

Package ‘ggspectra’ also defines specializations of method ggplot() for spectra.

Calculating summaries

transmittance(filters.mspct$Firecrest_UVIR_Cut, UVA())
##    UVA.ISO 
## 0.01169459 
## attr(,"Tfr.type")
## [1] "total"
## attr(,"radiation.unit")
## [1] "transmittance average"
absorbance(filters.mspct$Firecrest_UVIR_Cut, list(UVA(), NIR()))
##        UVA.ISO  NIR.ISO.tr.hi 
##       3.015710       2.902836 
## attr(,"Tfr.type")
## [1] "total"
## attr(,"radiation.unit")
## [1] "absorbance average"
transmittance(filters.mspct[grep("UG", names(filters.mspct))], 
              list(UVB(), UVA()))
## # A tibble: 5 x 3
##   spct.idx    transmittance_UVB.ISO transmittance_UVA.ISO
##   <fct>                       <dbl>                 <dbl>
## 1 Schott_UG1                 0.153                  0.659
## 2 Schott_UG11                0.851                  0.694
## 3 Schott_UG2A                0.0472                 0.660
## 4 Schott_UG5                 0.957                  0.924
## 5 UQG_UG1_2mm                0.125                  0.517

Using the data in other contexts

As filter_mspct is a class derived from list, and filter_spct is derived from tibble::tible which is a mostly compatible reimplementation of data.frame the data can be used very easily with any R function.

head(as.data.frame(filters.mspct$Schott_UG11))
##   w.length   Tfr
## 1      200 1e-05
## 2      201 1e-05
## 3      202 1e-05
## 4      203 1e-05
## 5      204 1e-05
## 6      205 1e-05

Of course attach and with also work as expected.

attach(filters.mspct)
transmittance(Schott_UG11, UVA())
##   UVA.ISO 
## 0.6941875 
## attr(,"Tfr.type")
## [1] "internal"
## attr(,"radiation.unit")
## [1] "transmittance average"
detach(filters.mspct)
attach(filters.mspct)
with(Schott_UG11, range(w.length))
## [1]  200 5200
detach(filters.mspct)
with(filters.mspct, transmittance(Schott_UG11, UVA()))
##   UVA.ISO 
## 0.6941875 
## attr(,"Tfr.type")
## [1] "internal"
## attr(,"radiation.unit")
## [1] "transmittance average"