-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME.Rmd
105 lines (82 loc) · 2.65 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
---
output:
github_document:
html_preview: false
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# PEcAn Radiative Transfer Modeling module -- standalone version
**Corresponding author**:
Alexey Shiklomanov
NASA Goddard Space Flight Center
## Installation
Easiest way to install is via `install_github` from the `devtools` package.
```r
devtools::install_github("ashiklom/pecanrtm")
```
If you want a specific branch, do `install_github(..., ref="<branch>")`.
From there, you should be able to load the package in your typical R session.
*NOTE: On some OS X systems, the automatic specification of `gfortran` will
fail, causing the installation to abort. To fix this issue, you will need to
add something like the following the `~/.R/Makevars` file.*
```
FC = gfortran
```
For more information, see the vignette (`vignettes/pecanrtm.vignettes.Rmd`).
## Usage
Simulate leaf reflectance and transmittance with different versions of the PROSPECT model.
```{r}
library(PEcAnRTM)
p4 <- prospect(c(N = 1.4, Cab = 40, Cw = 0.01, Cm = 0.005), version = "4")
p5 <- prospect(c(N = 1.4, Cab = 40, Car = 8, Cw = 0.01, Cm = 0.005), version = "5")
p5b <- prospect(c(
N = 1.4, Cab = 40, Car = 8,
Cbrown = 0.1, Cw = 0.01, Cm = 0.005
), version = "5B")
pd <- prospect(c(
N = 1.4, Cab = 40, Car = 8, Canth = 10,
Cbrown = 0.1, Cw = 0.01, Cm = 0.005
), version = "D")
wl <- seq(400, 2500)
plot(0, 0, type = "n", xlim = c(400, 2500), ylim = c(0, 1),
xlab = "Wavelength (nm)", ylab = "Reflectance or 1 - Transmittance")
lines(wl, p4[, 1], col = 2)
lines(wl, 1 - p4[, 2], col = 2, lty = 2)
lines(wl, p5[, 1], col = 3)
lines(wl, 1 - p5[, 2], col = 3, lty = 2)
lines(wl, p5b[, 1], col = 4)
lines(wl, 1 - p5b[, 2], col = 4, lty = 2)
lines(wl, pd[, 1], col = 5)
lines(wl, 1 - pd[, 2], col = 5, lty = 2)
legend("topright", c("4", "5", "5B", "D"), col = 2:5, lty = 1)
```
Simulate canopy reflectance with the PRO4SAIL model (PROSPECT 5B coupled to the 4SAIL canopy RTM).
```{r}
canopy <- pro4sail(c(
N = 1.4, Cab = 40, Car = 8, Cbrown = 0, Cw = 0.01, Cm = 0.009,
# Leaf angle distribution function parameters
LIDFa = -0.35, LIDFb = -0.15, TypeLIDF = 1,
# Leaf area index
LAI = 3,
# Hot spot parameter
q = 0.01,
# Solar zenith, degrees
tts = 30,
# Observer zenith, degrees
tto = 10,
# Sun-observer azimuth
psi = 0,
# Soil moisture fraction (0 = dry, 1 = wet)
psoil = 0.7
))
matplot(canopy)
legend("topright", c("BHR", "HDR", "DHR", "BDR"), col = 1:4, lty = 1:4)
```