jbferet / prospect

R package for the simulation of leaf optical properties based on their biochemical and biophysical properties using the PROSPECT leaf model. A tutorial can be found on the gitlab website
https://jbferet.gitlab.io/prospect/
MIT License
17 stars 3 forks source link

Consider including plain-text versions of PROSPECT coefficients #4

Closed ashiklom closed 9 months ago

ashiklom commented 11 months ago

(Comment as part of JOSS review: https://github.com/openjournals/joss-reviews/issues/6027)

I think the typical best practice for R packages is to include plain-text versions of internal package data and the code used to convert them into the internal data. Here's the relevant discussion in Writing R Packages. In the context of this package, you might consider also including plain-text versions of the PROSPECT absorption coefficients and refractive index and the code used to put these into the final PROSPECT input data frame (which is stored in binary representation in the package). Among other things, this will (1) allow you to version-control the PROSPECT coefficients in human-readable git fashion (e.g., in case the calibrations change in the future), and (2) make the package resilient to changes in the binary encoding of Rdata and rda files.

This is not a requirement for my review; just a friendly suggestion!

jbferet commented 10 months ago

thank you @ashiklom for the suggestion! The next update will follow this recommendation.

jbferet commented 10 months ago

prospect v1.5.0 now includes additional information in the 'data-raw' directory:

  1. dataSpec_PRO.txt includes the refractive index, specific absorption coefficients for each constituent, and corresponding wavelength with 1 nm sampling.

  2. create_sysdata.R is the R script generating the variable _SpecPROSPECTFullRange, and the variable _OptDomainRT, available when loading the package.