-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathREADME.Rmd
61 lines (48 loc) · 1.77 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
---
output: github_document
---
<!-- 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%"
)
```
# rrtm
<!-- badges: start -->
[](https://github.com/ashiklom/rrtm/actions)
<!-- badges: end -->
The goal of `rrtm` is to provide efficient R implementations of radiative transfer models useful for vegetation remote sensing.
## Installation
`rrtm` is not currently on CRAN, but
you can install the development version of `rrtm` from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("ashiklom/rrtm")
```
## Basic usage
This is a basic example of running the PROSPECT 5 leaf radiative transfer model.
```{r basic}
library(rrtm)
out <- prospect5(1.4, 40, 10, 0, 0.01, 0.01)
plot(c(400, 2500), c(0, 1), type = "n",
xlab = "Wavelength (nm)",
ylab = "Spectra")
lines(400:2500, out$reflectance, col = "red")
lines(400:2500, 1 - out$transmittance, col = "blue")
legend("top", legend = c("reflectance", "1 - transmittance"),
lty = 1, col = c("red", "blue"))
```
Here is a basic example of running the PRO4SAIL radiative transfer model (PROSPECT 5 coupled to the 4SAIL canopy model and Hapke soil model).
```{r sail}
sail_out <- pro4sail_5(N = 1.4, Cab = 40, Car = 10, Cbrown = 0,
Cw = 0.01, Cm = 0.01,
LAI = 3, soil_moisture = 0.5)
matplot(400:2500, do.call(cbind, sail_out),
xlab = "Wavelength (nm)", ylab = "Reflectance (0-1)",
type = "l", lty = "solid", col = 1:4)
legend("topright", c("BHR", "DHR", "HDR", "BDR"),
lty = "solid", col = 1:4)
```