This vignette has two goals:
lightrparsers produce the same output as the official software
For this, we use spectral data of the beak of the atlantic puffin, Fratercula arctica. This data was collected by Dr Claire Doutrelant, using an OceanOptics spectrometer.
By default, OceanInsight spectrometers produce
.ProcSpec files, which R cannot readily import. To help with this, OceanInsight official software, SpectraSuite has a conversion feature, which turns
.ProcSpec files into tab separated values files (
So, let’s start by comparing the
.ProcSpec spectra imported by
lightr and the
.txt files produced by OceanOptics.
We can visually inspect these two file using the dedicated S3 function
library(pavo) #> Welcome to pavo 2! Take a look at the latest features (and update your bibliography) in our recent publication: Maia R., Gruson H., Endler J. A., White T. E. (2019) pavo 2: new tools for the spectral and spatial analysis of colour in R. Methods in Ecology and Evolution, 10, 1097-1107. plot(raw_files, main = "Raw ProSpec files") plot(txt_files, main = "Exported txt files")
Spectra imported by
lightr and converted by SpectraSuite look pretty similar upon visual inspection and we can confirm this with
One possibly biologically relevant question would be to look at the interspecific variability in beak colour. I.e., do all puffin individuals have roughly the same colour or are some individuals brighter, more colourful than others?
For this, we will look at the difference in hue and brightness on the red part of the beak for two individuals, with
pavo::summary.rspec() function (after smoothing with
Okay, these two individuals seem to differ quite a lot in terms of hue and brightness. Now, one might ask if these difference can be perceived in bird vision. We can test this with the
vis_beak <- vismodel(beak, visual = "avg.uv", achromatic = "ch.dc") tcs_beak <- colspace(vis_beak) coldist(tcs_beak, achromatic = TRUE) #> Warning: Quantum catch are relative, distances may not be meaningful #> Calculating unweighted Euclidean distances and Weber luminance contrast #> patch1 patch2 dS dL #> 1 BR_PF26_1 BR_PF27_3 0.005867583 0.2004935
The values of
dL are below the 1 JND (just noticeable differences) threshold, which means that the colour of the two individuals, in spite of their difference, looks the same to the birds.