New updates

The most important of these updates is that to package photobiology, which is now at version 0.3.7. The main changes have to do with spectral objects and operators for them. A lot of testing and debugging was done, and a few functions and a data sets added.

Package photobiologyFilters, which is now at version 0.1.12 had some minor fixes and data additions. The ‘catalogue of filters’ has been updated.

Package photobiologyLamps, which is now at version 0.1.12 includes the same data as earlier but the code has been updated so that only spectral energy irradiance is stored in the spectral objects.

IMPORTANT NOTE:

Since a few updates back, I have gradually changed the code to use data tables instead of data frames. Data tables are defined in package data.table, which is now required. However, the current release of data.table has a bug that breaks the code in my packages. This bug is fixed in the current development version of data.table, but this version (1.9.3) is not available through CRAN. I have built it and uploaded to the r4photo repository where my packages are.

A limitation in the current implementation of spectral objects

I noticed this morning an unexpected behaviour of .spct objects when manipulated using data.table syntax… they become data.table objects! Until I solve this problem please do not use data.table syntax for manipulating .spct objects. I will upload a bugfix release of package photobiology, after I make sure that all functions defined in the package behave as expected. This will happen later today or tomorrow.

[edited @ 14:14, 22 July 2014] This time the bug was not in the code I had written, but rather in the data.table package. The code has recently been corrected in the development version of data.table (1.9.3), but this version is not yet available through CRAN… I will most likely upload a binary archive of data.table 1.9.3 to the r4photo repository later today, and a new version of package photobiology marked as requiring this or later versions of data.table.

New major updates uploaded to repository

photobiology 0.3.4 adds object oriented functions for most of the functionality, operator definitions have been revised. There still a few minor additions planned, but except for these, the package functionality and syntax should be quite stable from now on. Some code optimizations for speed or memory use may be done.

photobiologyFilters 0.1.10 provides all data as filter.spct objects instead of the earlier data frames. User code calling functions that expect filter names as character strings should still work unchanged. Code that explicitly used the data frames, needs to be edited for the name tag change from “.data”  to “.spct”. The code itself should work as the new objects are backwards compatible. The objects now contain “w.length”, “Tfr”, and “Tpc” ‘columns’, the “Tpc” column is deprecated, and will be removed the next time the package is built. Lots of new spectral data has been added to this package.

photobiologyLamps 0.1.11 provides all data as source.spct objects instead of the earlier data frames. User code calling functions that expect filter names as character strings should still work unchanged. Code that explicitly used the data frames, needs to be edited for the name tag change from “.data”  to “.spct”. The code itself should work as the new objects are backwards compatible. The objects now contain “w.length”, “s.e.irrad”, and “s.q.irrad” ‘columns’, the “s.q.irrad” column is deprecated, and will be removed the next time the package is built. This update contains the same data as the version it replaces.

photobiologyLEDs 0.1.2 provides all data as source.spct objects instead of the earlier data frames. User code calling functions that expect filter names as character strings should still work unchanged. Code that explicitly used the data frames, needs to be edited for the name tag change from “.data”  to “.spct”. The code itself should work as the new objects are backwards compatible. The objects now contain “w.length”, “s.e.irrad”, and “s.q.irrad” ‘columns’, the “s.q.irrad” column is deprecated, and will be removed the next time the package is built. I still have quite a lot of data that I need to add to this package, and quite a few LEDs waiting to be measured.

I have tweaked how package data.table is imported, so that those time-related functions with names that clash with package lubridate are no longer imported. Furthermore, the functions imported by package photobiology from package data.frame, are re-exported by package photobiology. Thanks to this change it is no longer needed for the end user to call “library data.table” in his/her code, this should help with backward and forward compatibility of user code.

New updates to packages (photobiology 0.3.1 and several dependent packages)

The versions of the packages uploaded yesterday have several enhancements, and a few backwards incompatibilities (hopefully only in functions mostly used internally). The new versions are not yet optimized for speed, so for performance-critical code, stick for a while with earlier versions. The changes are many, and I hope give a more intuitive user interface. The new, more transparent way of doing calculations has a toll on performance. Consequently the “old” functions remain available for use in speed-critical code and for backwards compatibility. Some additional changes are planned for coming weeks.

The main improvement is the use of object-oriented programming. Now spectra are “S3” objects. This allows the definition specific versions of generic functions (e.g. print, range, etc.) and operators (e.g. +, -, *, /) for spectra. These are already working for spectral irradiance and spectral transmittance, but may still have some hidden bugs. Data for many additional filters has been added.

Most other packages, except those related to photoreceptors, have been also updated.

Please, report any problems and/or oddities to me.