Skip to content

Commit 00e4077

Browse files
committed
# prospect v2.0.0
## change - functions in individual files - rewrite functions with snake case - fix error when computing n_struct with transmittance only - updated documentation according to v2
1 parent 1aa3bc8 commit 00e4077

File tree

6 files changed

+172
-67
lines changed

6 files changed

+172
-67
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ After installing package `devtools`, the package `prospect` can be installed wit
1313
devtools::install_github("jbferet/prospect")
1414
```
1515

16+
<span style="color:red">**WARNING : **</span> **many functions have been renamed in v2.0 of the package.**
17+
**The documentation has been updated accordingly.**
18+
**Please refer to the documentation for additional information.**
19+
1620
# 2 Tutorial
1721

1822
<!-- README.md is generated from README.Rmd. Please edit that file -->

vignettes/prospect.Rmd

Lines changed: 87 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,45 @@ knitr::opts_chunk$set(
3131

3232
# Brief introduction & useful links to go further
3333

34-
This tutorial summarizes the different functionalities of the R package `prospect` based on the eponym leaf physical model.
34+
This tutorial summarizes the different functionalities of the R package
35+
`prospect` based on the eponym leaf physical model.
3536

36-
This tutorial does not aim at detailling the principles of PROSPECT or comparing it to other models, as:
37+
This tutorial does not aim at detailing the principles of PROSPECT or comparing
38+
it to other models, as:
3739

38-
* The comprehensive description of the model and the physical principes it relies on can be found in the original paper from [Jacquemoud & Baret (1990)](https://www.sciencedirect.com/science/article/abs/pii/003442579090100Z "Jacquemoud & Baret, RSE 1990")
39-
* [this website](http://photobiology.info/Jacq_Ustin.html) and [this one](http://teledetection.ipgp.jussieu.fr/opticleaf/models.htm) provide a lot of information on this topic
40-
* [this website](http://opticleaf.ipgp.fr/) gathers references and important links for anyone interested in leaf optical properties and physical modeling
40+
* The comprehensive description of the model and the physical principles it
41+
relies on can be found in the original paper from [Jacquemoud & Baret (1990)](https://www.sciencedirect.com/science/article/abs/pii/003442579090100Z "Jacquemoud & Baret, RSE 1990")
42+
* [this website](http://photobiology.info/Jacq_Ustin.html) and
43+
[this one](http://teledetection.ipgp.jussieu.fr/opticleaf/models.htm) provide a
44+
lot of information on this topic
45+
* [this website](http://opticleaf.ipgp.fr/) gathers references and important
46+
links for anyone interested in leaf optical properties and physical modeling.
4147

42-
PROSPECT aims at simulating leaf optical properties in the optical domain from 400 nm to 2500 nm based on their biophysical properties, including a limited number of biochemical constituents and a unique structure parameter, `N`. PROSPECT is based on a simple representation derived from the __extended plate model__ ([Allen et al., 1970](https://www.osapublishing.org/josa/abstract.cfm?uri=josa-60-4-542)).
48+
PROSPECT aims at simulating leaf optical properties in the optical domain from
49+
400 nm to 2500 nm based on their biophysical properties, including a limited
50+
number of biochemical constituents and a unique structure parameter `N`.
4351

44-
Leaf optical properties correspond to __conical-hemispherical reflectance and transmittance__, and are typically measured with an integrating sphere. These optical properties are often described as __directional-hemispherical reflectance and transmittance__, although such directional quantities are conceptual quantities (see [Schaepman-Strub et al. (2006)](https://www.sciencedirect.com/science/article/abs/pii/S0034425706001167?via%3Dihub "Schaepman-Strub, RSE 2006") for a comprehensive definition of optical measurements).
4552

46-
Leaf reflectance measured with a leaf clip / contact probe (such as the device provided with the ASD FieldSpec spectroradiometer) does not correspond to __conical-hemispherical reflectance__. Therefore comparing such reflectance with PROSPECT simulations (in forward and inverse mode) may lead to biased or uncertain results. See [Li et al. (2018)](https://www.sciencedirect.com/science/article/abs/pii/S0034425717305898?via%3Dihub "Li, RSE 2018") for alternative approaches taking advantage ofphysical modeling for the estimation of leaf chemistry from such reflectance measurements.
53+
__To avoid confusion between `N`and Nitrogen content (made by multiple users), `N` has been renamed `n_struct` starting from v2.0.__
54+
55+
PROSPECT is based on a simple representation derived from the __extended plate model__
56+
([Allen et al., 1970](https://www.osapublishing.org/josa/abstract.cfm?uri=josa-60-4-542)).
57+
58+
Leaf optical properties correspond to __conical-hemispherical reflectance and transmittance__,
59+
and are typically measured with an integrating sphere.
60+
These optical properties are often described as __directional-hemispherical reflectance and transmittance__,
61+
although such directional quantities are conceptual quantities (see
62+
[Schaepman-Strub et al. (2006)](https://www.sciencedirect.com/science/article/abs/pii/S0034425706001167?via%3Dihub "Schaepman-Strub, RSE 2006")
63+
for a comprehensive definition of optical measurements).
64+
65+
Leaf reflectance measured with a leaf clip / contact probe (such as the device
66+
provided with the ASD FieldSpec spectroradiometer) does not correspond to
67+
__conical-hemispherical reflectance__. Therefore comparing such reflectance with
68+
PROSPECT simulations (in forward and inverse mode) may lead to biased or
69+
uncertain results.
70+
See [Li et al. (2018)](https://www.sciencedirect.com/science/article/abs/pii/S0034425717305898?via%3Dihub "Li, RSE 2018")
71+
for alternative approaches taking advantage of physical modeling for the
72+
estimation of leaf chemistry from such reflectance measurements.
4773

4874

4975
<p>&nbsp;</p>
@@ -52,47 +78,70 @@ Leaf reflectance measured with a leaf clip / contact probe (such as the device p
5278
</center>
5379
<p>&nbsp;</p>
5480
<center>
55-
Fig. 1. Representation of a leaf according to PROSPECT and corresponding leaf optical properties obtained as output
81+
Fig. 1. Representation of a leaf according to PROSPECT and corresponding leaf
82+
optical properties obtained as output
5683
</center>
5784
<p>&nbsp;</p>
5885

59-
Note that the `alpha` parameter is also available as input, and corresponds to the maximum incidence angle relative to the normal defining the solid angle of incident light at the surface of leaf (aims at including surface roughness, default value = 40 degrees).
86+
Note that the `alpha` parameter is also available as input, and corresponds to
87+
the maximum incidence angle relative to the normal defining the solid angle of
88+
incident light at the surface of leaf (aims at including surface roughness,
89+
default value = 40 degrees).
6090

61-
Many simplications can be identified, and alternative versions of the model have been developed through the years in order to increase the realism of the model. Among the many simplifications:
91+
Many simplications can be identified, and alternative versions of the model have
92+
been developed through the years in order to increase the realism of the model.
93+
Among the many simplifications:
6294

63-
* The refractive index identifcal for all leaves. It should theoretically change with leaf properties
95+
* The refractive index identical for all leaves.
96+
It should theoretically change with leaf properties.
6497

65-
* The leaf anatomy is not differentiated between an adaxial and an abaxial face
98+
* The leaf anatomy is not differentiated between an adaxial and an abaxial face.
6699

67-
* the leaf surface, which is defined my many properties in real life (presence of waxes, hairs, ...) is identical among leaves in PROSPECT
100+
* the leaf surface, which is defined my many properties in real life (presence
101+
of waxes, hairs, ...) is identical among leaves in PROSPECT.
68102

69103
* ...
70104

71-
The current version of the model implemented in `prospect` is __PROSPECT-PRO__, which includes the following biochemical constituents (defined as _C<sub>i</sub>_ in Fig. 1):
105+
Two versions of the model are currently implemented in `prospect`:
106+
__PROSPECT-PRO__ and __PROSPECT-D__.
107+
108+
__PROSPECT-D__ accounts for the absorption of the following biochemical
109+
constituents (defined as _C<sub>i</sub>_ in Fig. 1):
110+
111+
* chlorophyll a + b `chl`
112+
* carotenoids `car`
113+
* anthocyanins `ant`
114+
* brown pigments `brown`
115+
* equivalent water thickness `ewt`
116+
* leaf mass per area `lma` (also identified as dry matter in the literature)
72117

73-
* Chlorophyll a + b `CHL`
74-
* Carotenoids `CAR`
75-
* Anthocyanins `ANT`
76-
* Prown pigments `BROWN`
77-
* Equivalent water thickness `EWT`
78-
* proteins `PROT`
79-
* carbon-based consituents `CBC` (constituents of dry matter other than proteins)
118+
__PROSPECT-PRO__ includes the same constituents, except for `lma`, which is
119+
replaced by proteins (`prot`) and carbon-based constituents (`cbc`).
80120

81-
If you want to use __PROSPECT-D__ instead of __PROSPECT-PRO__, please define a value for `LMA` (Leaf mass per area) and set `PROT` and `CBC` to 0, or leave no value (default value = 0)
121+
If you want to use __PROSPECT-D__ instead of __PROSPECT-PRO__, please define a
122+
value for `lma` (Leaf mass per area) and set `prot` and `cbc` to 0, or leave no
123+
value (default value = 0)
82124

83125

84126

85-
The specific absoprtion coefficients corresponding to these constituents are recorded in the variable `SpecPROSPECT` available when loading the package `prospect`.
127+
The specific absorption coefficients corresponding to these constituents are
128+
recorded in the variable `spec_prospect` available when loading the package
129+
`prospect`.
86130

87131
# `prospect`: forward and inverse mode
88132

89-
In the forward mode, PROSPECT simulates leaf optical propertes based on a set of input parameters corresponding to the biochemical constituents and the N structure parameter.
133+
In the forward mode, PROSPECT simulates leaf optical properties based on a set
134+
of input parameters corresponding to the biochemical constituents and `n_struct`.
90135

91-
The performances of PROSPECT for the simulation of the leaf optical properties are based on the proper calibration of the optical constants, more particularly the specific absorption coefficients corresponding to each biochemical constituent.
136+
The performances of PROSPECT for the simulation of the leaf optical properties
137+
are based on the proper calibration of the optical constants, more particularly
138+
the specific absorption coefficients corresponding to each biochemical constituent.
92139

93-
In the inverse mode, an algorithm is used to derive the input parameters from the leaf optical properties.
140+
In the inverse mode, an algorithm is used to derive the input parameters from
141+
the leaf optical properties.
94142

95-
See the following pages of the tutorial for an illustration of how to use `prospect` in forward and inverse mode.
143+
See the following pages of the tutorial for an illustration of how to use
144+
`prospect` in forward and inverse mode.
96145

97146
<p>&nbsp;</p>
98147
<center>
@@ -109,10 +158,15 @@ See the following pages of the tutorial for an illustration of how to use `prosp
109158

110159
## Fluorescence & extended infrared domain
111160

112-
The package currently only includes a version of the model covering the domain from 400 nm to 2500 nm. However, several valuable alternative versions exist, but are not available in the current version of the package:
161+
The package currently only includes a version of the model covering the domain
162+
from 400 nm to 2500 nm. However, several valuable alternative versions exist,
163+
but are not available in the current version of the package:
113164

114-
- [PROSPECT-VISIR](https://www.sciencedirect.com/science/article/abs/pii/S0034425710002841?via%3Dihub), modeling directional–hemispherical reflectance and transmittance of fresh and dry leaves from 0.4 μm to 5.7 μm.
115-
- [FLUSPECT](https://www.sciencedirect.com/science/article/abs/pii/S0034425718301573?via%3Dihub), radiative transfer model for leaf chlorophyll fluorescence.
165+
- [PROSPECT-VISIR](https://www.sciencedirect.com/science/article/abs/pii/S0034425710002841?via%3Dihub),
166+
modeling directional–hemispherical reflectance and transmittance of fresh and
167+
dry leaves from 0.4 μm to 5.7 μm.
168+
- [FLUSPECT](https://www.sciencedirect.com/science/article/abs/pii/S0034425718301573?via%3Dihub),
169+
radiative transfer model for leaf chlorophyll fluorescence.
116170

117171
These models may be added in a future version of the package.
118172

@@ -124,8 +178,8 @@ is available in the R package [`prosail`](https://jbferet.gitlab.io/prosail/inde
124178
Alternative implementations of PROSPECT and PROSAIL can be found in various languages.
125179
A non-exhaustive list of distributions of these models is available at
126180
[this webpage](http://teledetection.ipgp.jussieu.fr/prosail/).
127-
It includes Matlab, Fortran and R implementations of versions 4, 5, D and PRO
128-
of PROSPECT.
181+
It includes Matlab, Fortran and R implementations of versions __4__, __5__,
182+
__D__ and __PRO__ of PROSPECT.
129183

130184
__We strongly recommend using version D or PRO instead of versions 4 and 5__.
131185

vignettes/prospect1.Rmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ maximum spectral sampling of 1 nm.
4848

4949
* `spec_prospect`: a data frame including the refractive index and specific
5050
absorption coefficients (which are optical constants for a given version of PROSPECT).
51-
** `spec_prospect` alo defines the spectral domain used for simulation.
51+
** `spec_prospect` also defines the spectral domain used for simulation.
5252
** The default value of `spec_prospect` is defined by `prospect::spec_prospect_full_range`,
5353
which includes optical constants over the spectral domain ranging from 400 nm
5454
to 2500 nm.
@@ -233,7 +233,7 @@ PROSPECT and set `car` as a constant fraction of `chl`.
233233
# Computing a Look-Up-Table with `prospect`
234234

235235
Look-Up-Tables (LUT) are widely used in order to infer leaf characteristics from
236-
PROSPECT, based on minimization techniques. The function `PROSPECT_LUT` allows
236+
PROSPECT, based on minimization techniques. The function `prospect_lut` allows
237237
computation of a LUT directly based on a data frame of input parameters.
238238

239239
The following example produces LUTs in the VSWIR and VNIR domains with the

vignettes/prospect2.Rmd

Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ knitr::opts_chunk$set(
3030

3131
`prospect` can be inverted using iterative optimization, by calling the function
3232
`invert_prospect`.
33-
This iterative optimization is based on the function [`fmincon` included in the package `pracma`](https://rdrr.io/cran/pracma/man/fmincon.html).
33+
This iterative optimization is based on the function `fmincon` included in the
34+
package [`pracma`](https://rdrr.io/cran/pracma/man/fmincon.html).
3435

3536
By default, the merit function used for the inversion named [merit_prospect_rmse](https://jbferet.gitlab.io/prospect/reference/merit_prospect_rmse.html)
3637
minimizes the RMSE between the simulated and the measured leaf optical properties.
@@ -103,6 +104,21 @@ not found in juvenile, mature or early senescent leaves.
103104
* `estimate_alpha` boolean. Should `alpha` be assessed or not? Keep in mind that most
104105
published results use `alpha` with its default value.
105106

107+
In order to reduce the number of input parameters for `invert_prospect` and
108+
other functions, an input variable `options` has been implemented.
109+
`options` is list combining several variables that advanced users may need to
110+
adjust.
111+
This variable is created as follows, and elements of the list can then be
112+
modified.
113+
Examples will follow, illustrating how to proceed to use it.
114+
115+
116+
```{r options variable}
117+
options <- set_options_prospect(fun = 'invert_prospect')
118+
options$estimate_brown_pigments <- TRUE
119+
```
120+
121+
106122
## Output variables
107123
`invert_prospect` returns a list of assessed PROSPECT parameters defined in
108124
`parms_to_estimate`.
@@ -227,11 +243,16 @@ output_prospect_5 <- invert_prospect(refl = subset_lop$refl,
227243
```
228244

229245
# PROSPECT-D inversion: using optimal spectral domains
230-
The function `invert_prospect_OPT` automatically sets the optimal spectral domains during inversion for all constituents to be assessed.
246+
The function `invert_prospect_OPT` automatically sets the optimal spectral
247+
domains during inversion for all constituents to be assessed.
231248

232-
Optimal spectral domains and configuration are defined in [Féret et al. (2019)](https://doi.org/10.1016/j.rse.2018.11.002), [Féret et al. (2021)](https://doi.org/10.1016/j.rse.2020.112173), and [Spafford et al. (2021)](https://doi.org/10.1016/j.rse.2020.112176).
249+
Optimal spectral domains and configuration are defined in
250+
[Féret et al. (2019)](https://doi.org/10.1016/j.rse.2018.11.002),
251+
[Féret et al. (2021)](https://doi.org/10.1016/j.rse.2020.112173), and
252+
[Spafford et al. (2021)](https://doi.org/10.1016/j.rse.2020.112176).
233253

234-
`n_struct` does not need to be part of `parms_to_estimate`, as it is automatically assessed when needed.
254+
`n_struct` does not need to be part of `parms_to_estimate`, as it is
255+
automatically assessed when needed.
235256

236257

237258
```{r prospect inverse mode 5}
@@ -248,9 +269,13 @@ ParmEst <- invert_prospect_opt(lambda = lrt_d$wvl,
248269

249270
# PROSPECT-PRO inversion
250271
Such definition of optimal spectral domains can also be set manually.
251-
For example, here is how to estimate protein content from leaf optical properties using the optimal spectral domain defined in [Féret et al. (2021)](https://doi.org/10.1016/j.rse.2020.112173).
272+
For example, here is how to estimate protein content from leaf optical
273+
properties using the optimal spectral domain defined in
274+
[Féret et al. (2021)](https://doi.org/10.1016/j.rse.2020.112173).
252275

253-
Please note that `n_struct` needs to be added to `parms_to_estimate`, if user want it to be assessed during the inversion, otherwise it will be set to its default value.
276+
Please note that `n_struct` needs to be added to `parms_to_estimate`, if user
277+
want it to be assessed during the inversion, otherwise it will be set to its
278+
default value.
254279

255280

256281
```{r prospect inverse mode 6}
@@ -280,13 +305,14 @@ output_prospect_6 <- invert_prospect(refl = subset_lop$refl,
280305

281306
# PROSPECT inversion with user-defined merit function
282307

283-
A new merit function can be defined, as long as it uses the same input and output
284-
variables as the function [merit_prospect_rmse](https://jbferet.gitlab.io/prospect/reference/merit_prospect_rmse.html).
308+
A new merit function can be defined, as long as it uses the same input and
309+
output variables as the function
310+
[merit_prospect_rmse](https://jbferet.gitlab.io/prospect/reference/merit_prospect_rmse.html).
285311

286312
Here is an example of a function using __nMRSE__ instead of __RMSE__ for the
287313
merit function.
288-
This means that for each spectral band, the square difference between measured and
289-
simulated leaf optics is normalized by the value of the measured leaf optics.
314+
This means that for each spectral band, the square difference between measured
315+
and simulated leaf optics is normalized by the value of the measured leaf optics.
290316

291317
First, the merit function is defined as follows:
292318

0 commit comments

Comments
 (0)