R for Photobiology: Theory and recipes for common calculations

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

Photobiology is the branch of science that studies the interactions of living organisms with visible and ultraviolet radiation. This book first presents the theory behind calculations related to research in photobiology and describes how to use R as a tool for carrying out these calculations. This handbook describes how to use R as a tool for doing calculations related to research in photobiology. Photobiology is the branch of science that studies the interactions of living organisms with visible and ultraviolet radiation. Many of the most frequently used calculations are either related to the characterization of radiation and of the responses of organisms to radiation. We emphasize the first of these aspects related to radiation quantification and the position of the sun. These include acquisition, processing and summarising of spectral data including the calculation of non-weighted and biologically effective exposures. Calculations related to interactions of radiation with inanimate objects and organisms are also treated in detail. The text and examples assume some familiarity with R and/or programming, but guides those readers new to the language to tutorials and books that will help them learn enough to follow, use and modify the code examples included in the book. The book is structured in five parts: I Theory behind calculations, II Tools used for calculations, III Cookbook of calculations, IV Data acquisition and exchange and V Catalogue of example data.

Author(s): Pedro J. Aphalo, T. Matthew Robson, Titta Kotilainen
Year: 2023

Language: English
Pages: 388

Contents
List of Tables
List of Figures
Preface
Typographical conventions
Acknowledgements
Theory behind calculations
Radiation properties
Packages used in this chapter
Ultraviolet and visible radiation
Solar radiation
Artificial radiation
Radiation interactions
Radiation and molecules
Absorption
Fluorescence
Phosphorescence
Radiation and simple objects
Angle of incidence
Refraction
Difraction
Scatering
Radiation in tissues and cells
Radiation interactions in plant canopies
Radiation interactions in water bodies
Physical quantities
Specular and total reflectance
Internal and total transmittance
Absorbance and absorptance
Photochemistry and photobiology
Light driven reactions
Silver salts and photographic films
Bleaching by UV radiation
Chlorophyll
Plant photoreceptors
Animal photoreceptors
Action spectroscopy
Photoreception tuning
Algorithms
Integration
Area under a spectral curve
Discontinuous functions
Scaling
Normalization
Interpolation
Astronomy
Times to events
Position of the sun
Array-detector spectrometers
Measurements—problems and solutions
Data processing steps for irradiance
Tools used for calculations
Software
Introduction
The different pieces
R
RStudio
Revision control: Git and Subversion
C++ compiler
LaTeX
Markdown
R for Photobiology packages
Expected use and users
The design of the framework
The suite
The r4photobiology repository
Cookbook of calculations
Storing data
Packages used in this chapter
Introduction
Spectra
How are spectra stored?
Spectral data assumptions
Task: Create a spectral object from numeric vectors
Task: Create a spectral object from a data frame
Task: Convert a data frame into a spectral object
Task: trimming a spectrum
Task: interpolating a spectrum
Task: Row binding spectra
Task: Merging spectra
Collections of multiple spectra
Task: Constructing Scale = 0.89 0.05ptcolor push gray 0color pop_mspctcodeshadecolorcolor push gray 0color poptowidthheightdepth objects from Scale = 0.89 0.05ptcolor push gray 0color pop_spctcodeshadecolorcolor push gray 0color poptowidthheightdepth objects
Task: Retrieving Scale = 0.89 0.05ptcolor push gray 0color pop_spctcodeshadecolorcolor push gray 0color poptowidthheightdepth objects from Scale = 0.89 0.05ptcolor push gray 0color pop_mspctcodeshadecolorcolor push gray 0color poptowidthheightdepth objects
Task: Subsetting Scale = 0.89 0.05ptcolor push gray 0color pop_mspctcodeshadecolorcolor push gray 0color poptowidthheightdepth objects
Task: Combining Scale = 0.89 0.05ptcolor push gray 0color pop_mspctcodeshadecolorcolor push gray 0color poptowidthheightdepth objects
Internal-use functions
Wavebands
How are wavebands stored?
Task: Create waveband objects
Task: trimming wavebands
Arithmetic operators and mathematical functions
Packages used in this chapter
Introduction
Conversion between units of expression
Task: conversion of irradiance from energy to photon base
Task: conversion of responsivity from energy to photon base
Task: conversion irradiance from photon to energy base
Task: conversion of responsivity from photon to energy base
Task: conversion of transmittance into absorptance
Task: conversion of transmittance into absorbance
Task: conversion of absorptance into transmittance
Task: conversion of absorbance into transmittance
Arithmetic operators and mathematical functions for spectra
Operators and operations between a spectrum and a numeric vector
Math functions taking a spectrum as argument
Comparison operators
Task: Simulating spectral irradiance under a filter
Task: Uniform scaling of a spectrum
Task: Arithmetic operations within one spectrum
Task: Using operators on underlying vectors
Task: Using options to change default behaviour of maths operators and functions
Wavebands
Mathematical operators
Task: Compute weighted spectral quantities
Spectra: simple summaries and features
Packages used in this chapter
Task: Printing spectra
Task: Summaries related to object properties
Task: Integrating spectral data
Task: Averaging spectral data
Task: Summaries related to wavelength
Task: Finding the class of an object
Task: Querying other attributes
Task: Query how spectral data contained is expressed
Task: Querying about `origin' of data
Task: Plotting a spectrum
Task: Other R's methods
Task: Extract peaks and valleys
Task: finding the location of peaks as an index into vectors with spectral data
Task: Extracting peaks and valleys using vectors
Task: Refining the location of peaks and valleys
Bell-shaped function
Spline with a single node
Spline with three nodes
Wavebands: simple summaries and features
Packages used in this chapter
Task: Printing wavebands
Task: Summaries related to object properties
Task: Summaries related to wavelength
Task: Querying other properties
Task: R's methods
Task: Plotting a waveband
Irradiance (not weighted)
Packages used in this chapter
Introduction
Task: use simple predefined wavebands
Task: define simple wavebands
Task: define lists of simple wavebands
Task: (energy) irradiance from spectral irradiance
Task: photon irradiance from spectral irradiance
Task: irradiance for more than one waveband
Task: calculate fluence for an irradiation event
Task: photon ratios
Task: energy ratios
Task: calculate average number of photons per unit energy
Task: split energy irradiance into regions
Task: calculate overlap between spectra
Collections of spectra
Irradiance (weighted or effective)
Packages used in this chapter
Introduction
Task: specifying the normalization wavelength
Task: use of weighted wavebands
Task: define wavebands that use weighting functions
Task: calculate effective energy irradiance
Task: calculate effective photon irradiance
Task: calculate daily effective energy exposure
From spectral daily exposure
From spectral irradiance
Transmission and reflection
Packages used in this chapter
Introduction
Task: absorbance, absorptance and transmittance
Task: spectral absorbance from spectral transmittance
Task: spectral transmittance from spectral absorbance
Task: transmitted spectrum from spectral transmittance and spectral irradiance
Task: reflected spectrum from spectral reflectance and spectral irradiance
Task: total spectral transmittance from internal spectral transmittance and spectral reflectance
Task: combined spectral transmittance of two or more filters
Ignoring reflectance
Considering reflectance
Task: light scattering media (natural waters, plant and animal tissues)
Task: simulating the spectral irradiance under a LED luminaire
Astronomy
Packages used in this chapter
Introduction
Time coordinates
Geographic coordinates
Algorithm and peculiarities of time data
Task: calculating the length of the photoperiod
Task: Calculating times of sunrise, solar noon and sunset
Task: calculating the position of the sun
Task: plotting sun elevation through a day
Task: plotting day or night length through the year
Task: plotting local time at sunrise
Task: plotting solar time at sunrise
Colour
Packages used in this chapter
Introduction
Task: calculating an RGB colour from a single wavelength
Task: calculating an RGB colour for a range of wavelengths
Task: calculating an RGB colour for spectrum
Standard CIE illuminants
A sample of colours
Colour based indexes
Packages used in this chapter
What are colour-based indexes?
Task: Calculation of the value of a known index from spectral data
Task: Estimation of an optimal index for discrimination
Task: Fitting a simple optimal index for prediction of a continuous variable
Task: PCA or PCoA applied to spectral data
Task: Working with spectral images
Plotting spectra and colours
Packages used in this chapter
Set up
Introduction to plotting spectra
Using autoplot() methods with spectra
Task: plotting of Scale = 0.89 0.05ptcolor push gray 0color popsource_spctcodeshadecolorcolor push gray 0color poptowidthheightdepth objects
Task: plotting of normalized Scale = 0.89 0.05ptcolor push gray 0color popsource_spctcodeshadecolorcolor push gray 0color poptowidthheightdepth objects
Task: plotting of Scale = 0.89 0.05ptcolor push gray 0color popresponse_spctcodeshadecolorcolor push gray 0color poptowidthheightdepth objects
Task: plotting of Scale = 0.89 0.05ptcolor push gray 0color popfilter_spctcodeshadecolorcolor push gray 0color poptowidthheightdepth objects
Task: plotting of Scale = 0.89 0.05ptcolor push gray 0color popreflector_spctcodeshadecolorcolor push gray 0color poptowidthheightdepth objects
Task: plotting of Scale = 0.89 0.05ptcolor push gray 0color popobject_spctcodeshadecolorcolor push gray 0color poptowidthheightdepth objects
Task: plotting collections of spectra
Plotting spectra with ggplot
Task: plotting Scale = 0.89 0.05ptcolor push gray 0color popsource_spctcodeshadecolorcolor push gray 0color poptowidthheightdepth objects
Task: Saving axis-label definitions for re-use
Task: plotting a spectrum as discrete columns
Task: using a log scale
Task: compare energy and photon spectral units
Task: annotating peaks and valleys in spectra
Annotating wavebands and wavelengths
Task: annotate a plot with waveband names as labels
Task: annotate a plot with waveband summary values as labels
Using colour as data in plots
Task: Plots using colour for the spectral data
Task: Plots using waveband definitions
Plotting the result of operations on spectral data
Task: plotting effective spectral irradiance
Task: making a bar plot of effective irradiance
Task: plotting a spectrum using colour bars
Task: plotting colours in Maxwell's triangle
Human vision: RGB
Radiation physics
Packages used in this chapter
Introduction
Task: black body emission
Data acquisition and exchange
Importing and exporting `R' data
Packages used in this chapter
Base R
Task: Import one spectrum from a Scale = 0.89 0.05ptcolor push gray 0color popdata.framecodeshadecolorcolor push gray 0color poptowidthheightdepth
Task: Export one spectrum to a Scale = 0.89 0.05ptcolor push gray 0color popdata.framecodeshadecolorcolor push gray 0color poptowidthheightdepth
Task: Import one spectrum from a Scale = 0.89 0.05ptcolor push gray 0color popmatrixcodeshadecolorcolor push gray 0color poptowidthheightdepth
Task: Export one spectrum to Scale = 0.89 0.05ptcolor push gray 0color popmatrixcodeshadecolorcolor push gray 0color poptowidthheightdepth
Task: Import a collection of spectra from a Scale = 0.89 0.05ptcolor push gray 0color popmatrixcodeshadecolorcolor push gray 0color poptowidthheightdepth
Task: Export a collection of spectra to Scale = 0.89 0.05ptcolor push gray 0color popmatrixcodeshadecolorcolor push gray 0color poptowidthheightdepth
Package `hyperSpec'
To `hyperSpec'
From `hyperSpec'
Package `colorSpec'
From `colorSpec'
To `colorSpec'
Package `pavo'
From `pavo'
Packages `fda' and `fda.usc'
Importing and exporting `foreign' data
Introduction
Packages used in this chapter
Reading and writing common file formats
Task: Read and write spectra from text files
Task: Read a spectrum from an Excel workbook
Reading instrument-output files
Task: Import data from Ocean Optics instruments and software
Task: Import data from Avantes instruments and software
Task: Import data from Macam instruments and software
Task: Import data from LI-COR instruments and software
Task: Import data from Bentham instruments and software
Data acquisition from within R
Introduction
Packages and other software used in this chapter
Adcquiring spectra with Ocean Optics spectrometers
Task: Acquiring raw-counts data from Ocean Optics spectrometers
Task: Acquiring spectral irradiance with Ocean Optics spectrometers
Task: Acquiring spectral transmittance with Ocean Optics spectrometers
Task: Acquiring spectral reflectance with Ocean Optics spectrometers
Task: Acquiring spectral absorptance with Ocean Optics spectrometers
sglux spectrometers and sensors
Task: Acquiring spectral data with sglux instrument
YoctoPuce modules
Task: Acquiring data with YoctoPuce modules and servers
Calibration
Task: Calibration of broadband sensors
Task: Correcting for non-linearity of sensor response
Task: Applying a spectral calibration to raw spectral data
Task: Wavelength calibration and peak fitting
Simulation
Task: Running TUV in batch mode
Task: Importing into R simulated spectral data from TUV
Task: Running libRadtran in batch mode
Task: Importing into R simulated spectral data from libRadtran
Catalogue of example data
Radiation sources
Packages used in this chapter
Introduction
Data: extraterrestrial solar radiation spectra
Data: terrestrial solar radiation spectra
Data: radiation within plant canopies
Data: radiation in water bodies
Data: lamps
Data: LEDs
Optical properties of inanimate objects
Packages used in this chapter
Introduction
Data: spectral transmittance of filters, glass, plastic sheets and films
Data: spectral reflectance of materials and objects
Example data for organisms
Packages used in this chapter
Introduction
Plants
Data: Optical properties of organs
Data: Photoreceptors
Data: Photosynthesis
Data: Mass pigments and other metabolites
Animals, including humans
Data: Surface properties of organs
Data: Photoreceptors
Data: Light driven synthesis
Data: Damage
Data: Metabolites
Microbes
Data: Photoreceptors
Data: Light driven synthesis
Data: Damage
Data: Metabolites
Further reading
Radiation physics
Photochemistry
Photobiology
Using R
Programming in R
Bibliography
Appendix
Build information
Blank Page
Blank Page