The new class cps_spct has been added to package photobiology 0.6.2, together with corresponding functions and operators. A suitable plot() method has been added to package photobiologygg 0.3.1. The reason for adding one additional class is that counts-per-second from array spectrometers can be directly used in the calculation of spectral transmittance and spectral reflectance. Objects of this class are expected to be used to hold linearised spectral counts per second with a wavelength calibration applied but no pixel gain calibration applied. The need for this class became apparent during the development of a new version of package MayaCalc for data acquisition from spectrometers, but we think that it could be more generally useful.

Another addition to both packages is the new time.unit attribute value "exposure" with the meaning of the time-integrated response for the whole irradiation or exposure event.

The documentation was tidied-up in both packages, and the User Guides expanded.

NOTE: Sources, and Windows binaries for R 3.2.x, are now available in the repository.

Major update

All packages in the suite have been updated.
This update includes several changes which are not backwards compatible:

  1. S3 classes and methods, and several other functions have been renamed. Dots have been replaced by underscores.
  2. Rescale() has been renamed to fscale().
  3. All dummy packages which have been maintained for backwards compatibility have been removed: photobiologyCry, photobiologyPhy, photobiologyUV, and photobiologyVIS are no longer available and photobiologyPlants and photobiologyWavebands should be used instead.
  4. The code has been fixed so eliminate most warnings during checking.
  5. A new vignette Upgrade Guide has been added to package photobiology.

Being such a major update all version numbers have been increased in the second digit. Current versions are:
photobiology 0.6.1, and version 0.3.0 for all the remaining packages.

Package photobiologyInOut also was modified in several respects, but still cannot be considered stable. The other packages, will not suffer major changes for the first public release of the suite.

NOTE: Please, do upgrade only at a time when you have enough time to upgrade old scripts and old data objects, and solve possible problems!

NOTE: Sources, and Windows binaries for R 3.1.x, and R 3.2.x are now available in the repository.

At the moment the repository at https://www.r4photobiology.info/R is responding very slowly, the mirror at http://www.mv.helsinki.fi/aphalo/R is faster.

New package

photobiologyInOut 0.2.0

Newly released package with functions for importing data from proprietary formats used by spectrometer instruments from LI-COR (LI-1800, .PRN files generated by the PC1800 program), Macam (.DTA files generated by the SR9910-PC spectroradiometer), and Ocean Optics (possibly all spectrometers for SpectraSuite’s output files) into R as source.spct objects.

Function for importing spectral data from files generated by the TUV solar radiation model (Sasha Madronich, version 5.0). This is an experimental function, and needs either a slightly edited output from TUV and Quick TUV, or output from a slightly modified version of the TUV program, which I will soon release.

NOTE: Sources, and Windows binaries for R 3.1.x, are now available in the repository.


I have updated all the packages in the suite. This is the result testing and programming during recent weeks.

photobiology 0.5.15

New functions normalize() and rescale() for spectra. Both functions set object attributes to flag the spectra that have been modified, and no longer are expressed in absolute units. In addition, tests were added to summary functions to disallow use of rescaled or normalized spectral data as input, with the exception of function integrate_spct().

Function rbindspct() was revised to issue a warning when only some of the spectral objects are rescaled or normalized.

Changes in the code for handling ‘time.unit‘, ‘Tfr.type‘ and ‘Rfr.type‘ attributes.
Added new functions getTimeUnit()getTfrType() and getRfrType().

New test cases were added.

photobiology 0.5.14 (not released)

New class and methods added: object.spct, with the corresponding as.object.spct(), is.object.spct(), setObjetcSpct(), and check.object.spct() functions. Also functions reflectance() and transmittance() are implemented. New function absorptance() is implemented only for object.spct objects. Objects of this class can be used to store corresponding spectral transmittance and spectral reflectance values. No operators are defined for this class as they would be ambiguous. The class attribute needs to be changed to either filter.spct or reflector.spct before using operators, however, no data is lost in the process, or written except for the class attribute, so the class can be changed back to object.spct if needed.

New function added: merge.generic.spct() is a wrapper on merge.data.table() that sets the correct class to the returned merged spectra, preserves attributes used with .spct objects and by default merges by w.length.

photobiologygg 0.2.8

Revised to use new getTimeUnit() and getTfrType() functions from package photobiology 0.5.15 which is now required. New annotation type: the string "title" in the annotations parameter of the plot() functions adds an automatic title to the plot.

photobiologygg 0.2.7 (not released)

Implemented plot() for object.spct objects. Updated User Guide accordingly. Added function multiplot() based on multiplot() example by Winston Chan in his Cookbook for R.

photobiologyFilters 0.2.4

Added data for Petri dishes.

photobiologyFilters 0.2.3

To avoid problems with conversions from spectral transmittance to spectral absorbance and taking into account that what can be really measured is that transmittance is below the detection limit of the instrument used, the minimum value of fractional transmittance has been forced to be 1E-5, with the meaning of 1E-5, consistently with the earlier encoding used for Schott optical glass filters.

photobiologyLEDs 0.2.2

Added data for UVMAX LEDs.

photobiologyPlants 0.1.0

New package combining the functions and data in the old photobiologyPhy and photobiologyCry packages and adding data on optical properties of plant leaves.

Edits to the other packages are related to documentation and in some cases rebuilding of example data with the current version of package photobiology.

NOTE: Sources, and Windows binaries for R 3.1.x, are now available in the repository.


photobiology 0.5.13

New function smooth_spct() for spectra added. Based on the smoothing code in package MayaCalc and optionally behaving as a wrapper to other smoothers available in R. Implemented for source.spct, filter.spct, reflector.spct and response.spct objects. Its interface may change. Now package caTools is neded.

Operations between .spct objects and numeric vectors, possibly of length one, now preserve other variables (e.g. ID factors) contained in the spectral objects.

Fixed bug in reflectance() function.

Backwards compatible.

photobiology 0.5.12

Bad input error reporting improved for off-range Tfr and Rfr values in check(). Warning given by T2A() when Tfr = 0 result in A = Inf. Added na.rm = TRUE when min() and max() are called on spectral data within the package code.

The formal arguments added to function rbindspct() in version 0.5.7 have been changed to more closely follow the development version 1.9.5 of package data.table. This will break user code that uses the previous syntax as added a few weeks ago to this package.

Fixed bug in handling of 'quantity' arguments "contribution.pc" and "relative.pc" in function absorbance() which was affecting plot annotations.

Mostly backwards compatible, but new checks for validity of data be triggered by code and data that earlier silently accepted bad and dubious quality data.

photobiologyWavebands 0.2.6

Added luminous efficiency functions for human vision, and the constants used in the definition of Lumen.

Setlow’s BSWF is now stored as a response.spct object using the same variable names as in the rest of the suite. The Setlow data from TUV has already been converted to energy units, but this was not noticed when this data was added to the package. This bug is now corrected.

Updated User Guide with some examples of the calculation of luminous flux in lux from spectral irradiance data.

Added plots of the luminous efficiency curves to the Data Plots vignette.

Backwards compatible.

NOTE: Sources, and Windows binaries for R 3.1.x, are now available in the repository.

RStudio (new preview)

The people developing RStudio have done it again!

I have been using for a couple of days RStudio from the 0.99 version previews, and it is working extremely well. The new functionality improves very much the easy of use: now there is auto-complete and automatic “bubble” help, both are a hugely helpful when writing scripts and package code.

You may still want to wait, as new versions are being released almost every other day. Anyway, I wanted to share the good news.


A summary of new functionality and other changes

1) More consistent naming of function parameters. Spectral object parameters are always called spct. Waveband and lists of wavebands parameters are called w.band. Parameters that take arguments that have a range function available are now more consistently named range. However, many generic functions, and specializations of generic functions, which because of being generic already have, or could have in the future specializations to other objects, use the name x for object of their own class. In addition, parameter unit, using only in some functions has been renamed to unit.out so that naming is now consistent. In the case of wavebands, at least for this version, the old names are also accepted but the use of the old names is deprecated, as they will be removed before the wider release of the packages.

2) In this version, everywhere were a list of wavebands is expected as input, a single waveband object by itself will also work without errors.

3) All summary functions of the irrad, response, transmittance, absorbance and reflectance now work consistently. Some of these functions are new to this version. They all consistently also accept lists of wavebands, and in cases when BSWFs shouldn’t be applied, only the range of wavelengths is used with a warning. All functions now handle more elegantly wavebands that extend outside the spectral data wavelength range, and by default NO LONGER return values unless there is spectral data available for the whole extent of the waveband. A new optional argument wb.trim can be used to change this behaviour, by trimming the portion of the waveband that falls outside the data, and labelling the resulting waveband so that the trimming is visible in the output. The functions have also acquired new parameters, but the defaults preserve earlier behaviour. A parameter common to all these functions is quantity which at the moment can take one of six possible values: "average", "total", "contribution", "contribution.pc", "relative", and "relative.pc". Contribution returns the waveband totals divided by the total for whole spectrum, while relative returns the total for each waveband divided by the sum of the waveband totals. When .pc is added percentages are returned, instead of fractions for these last to types of values. Total is just the integrated value over wavelengths for each waveband, while average, are these same values, each one, divided by the wavelength spread of the corresponding waveband (in the same units as the original spectrum).

4) A new function was added, called trim_waveband, which does the work of filtering out by default, all those wavebands in a list of wavebands which do not completely fall within the range of the spectral data. However, the optional argument trim can be used to change this behaviour so that those wavebands which are partly within the spectral data range and partly outside it, are replaced by new wavebands from which the portion outside the data range has been removed or trimmed. This function is used by the package code itself, but may be also useful to users.

5) The operators’ code was fully rewritten to remove repeated code, and to improve functionality. The earlier requirement of starting an expression with spectral object is removed. Now spectrum objects can appear almost any position in statements. The allowed combinations of spectra of different types that can be mixed is now somehow more restricted, and the code tries better guess what makes sense from the point of view of light physics and what not.

6) Although very handy, operators have the problem that they cannot take additional arguments. As earlier defined operators would result always in calculations done using and values returned in energy-based units for light sources or transmittance for filters. This remains the default behaviour, but it is possible through global R options to alter the defaults. These options also affect the default for function irrad which earlier required the unit.out argument to be supplied. (The options only change the defaults, and the new default can be over-ridden as usual with optional arguments in the functions.

7) The earlier behaviour, of printing by default spectral objects returned by functions is restored, as this is the natural and expected R behaviour, but how to obtain a more brief output is now documented. This behaviour was changed in the previous version and caused confusion.

8) Most of the changes described above also apply to the plot functions. New plot function specializations were added, so that now all types of spectral objects can be plotted consistently. All the functions support the functionality described in 3) with respect to choosing the values displayed in the waveband labels, and with respect to trimming of wavebands. All the possible quantity values and time unit attributes are used to decide the correct labels and units automatically. (This of course requires that the expected units are used when creating spectral objects.) The options described in 6) also affect the default behaviour of the plot functions.

9) In process of this overhaul, I found some bugs present already in earlier versions, which are now hopefully fixed.

10) A few less important additions are described in the NEWS files of the last version, plus the NEWS files of intermediate versions that were never released.