Skip to content

Commit 8d938f4

Browse files
committed
differences for PR #494
1 parent 90cf7de commit 8d938f4

File tree

222 files changed

+117425
-60
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

222 files changed

+117425
-60
lines changed

04-raster-calculations-in-r.md

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,35 @@ See the [lesson homepage](.) for detailed information about the software,
3333
data, and other prerequisites you will need to work through the examples in
3434
this episode.
3535

36+
### Load the Data
37+
38+
For this episode, we will use the DTM and DSM from the NEON Harvard Forest
39+
Field site and San Joaquin Experimental Range. If you don't still have
40+
them loaded, do so now and turn them into dataframes:
41+
42+
# DSM (tree top) data for Harvard Forest
43+
DSM_HARV <-
44+
rast("data/NEON-DS-Airborne-Remote-Sensing/HARV/DSM/HARV_dsmCrop.tif")
45+
46+
DSM_HARV_df <- as.data.frame(DSM_HARV, xy = TRUE)
47+
48+
# DTM (bare earth) data for Harvard Forest
49+
DTM_HARV <-
50+
rast("data/NEON-DS-Airborne-Remote-Sensing/HARV/DTM/HARV_dtmCrop.tif")
51+
52+
DTM_HARV_df <- as.data.frame(DTM_HARV, xy = TRUE)
53+
54+
# DSM data for SJER
55+
DSM_SJER <-
56+
rast("data/NEON-DS-Airborne-Remote-Sensing/SJER/DSM/SJER_dsmCrop.tif")
57+
58+
DSM_SJER_df <- as.data.frame(DSM_SJER, xy = TRUE)
59+
60+
# DTM data for SJER
61+
DTM_SJER <-
62+
rast("data/NEON-DS-Airborne-Remote-Sensing/SJER/DTM/SJER_dtmCrop.tif")
63+
64+
DTM_SJER_df <- as.data.frame(DTM_SJER, xy = TRUE)
3665

3766
::::::::::::::::::::::::::::::::::::::::::::::::::
3867

@@ -64,11 +93,7 @@ with the influence of ground elevation removed.
6493

6594
::::::::::::::::::::::::::::::::::::::::::::::::::
6695

67-
### Load the Data
6896

69-
For this episode, we will use the DTM and DSM from the NEON Harvard Forest
70-
Field site and San Joaquin Experimental Range, which we already have loaded
71-
from previous episodes.
7297

7398
::::::::::::::::::::::::::::::::::::::: challenge
7499

05-raster-multi-band-in-r.md

Lines changed: 5 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Work with Multi-Band Rasters
3-
teaching: 40
4-
exercises: 20
3+
teaching: 30
4+
exercises: 15
55
source: Rmd
66
---
77

@@ -76,6 +76,8 @@ ggplot() +
7676

7777
<img src="fig/05-raster-multi-band-in-r-rendered-harv-rgb-band1-1.png" style="display: block; margin: auto;" />
7878

79+
To import the green band, we would use `lyrs = 2`.
80+
7981
::::::::::::::::::::::::::::::::::::::: challenge
8082

8183
## Challenge
@@ -136,56 +138,8 @@ represent pixels with less red in them (less red was reflected). To plot an RGB
136138
image, we mix red + green + blue values into one single color to create a full
137139
color image - similar to the color image a digital camera creates.
138140

139-
### Import A Specific Band
140-
141-
We can use the `rast()` function to import specific bands in our raster object
142-
by specifying which band we want with `lyrs = N` (N represents the band number we
143-
want to work with). To import the green band, we would use `lyrs = 2`.
144-
145-
146-
``` r
147-
RGB_band2_HARV <-
148-
rast("data/NEON-DS-Airborne-Remote-Sensing/HARV/RGB_Imagery/HARV_RGB_Ortho.tif",
149-
lyrs = 2)
150-
```
151-
152-
We can convert this data to a data frame and plot the same way we plotted the red band:
153-
141+
154142

155-
``` r
156-
RGB_band2_HARV_df <- as.data.frame(RGB_band2_HARV, xy = TRUE)
157-
```
158-
159-
160-
``` r
161-
ggplot() +
162-
geom_raster(data = RGB_band2_HARV_df,
163-
aes(x = x, y = y, alpha = HARV_RGB_Ortho_2)) +
164-
coord_equal()
165-
```
166-
167-
<img src="fig/05-raster-multi-band-in-r-rendered-rgb-harv-band2-1.png" style="display: block; margin: auto;" />
168-
169-
::::::::::::::::::::::::::::::::::::::: challenge
170-
171-
## Challenge: Making Sense of Single Band Images
172-
173-
Compare the plots of band 1 (red) and band 2 (green). Is the forested area
174-
darker or lighter in band 2 (the green band) compared to band 1 (the red band)?
175-
176-
::::::::::::::: solution
177-
178-
## Solution
179-
180-
We'd expect a *brighter* value for the forest in band 2 (green) than in band 1
181-
(red) because the leaves on trees of most often appear "green" - healthy leaves
182-
reflect MORE green light than red light.
183-
184-
185-
186-
:::::::::::::::::::::::::
187-
188-
::::::::::::::::::::::::::::::::::::::::::::::::::
189143

190144
## Raster Stacks in R
191145

data/.gitignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

data/Global/Boundaries/ne_110m_graticules_all/ne_110m_graticules_1.README.html

Lines changed: 417 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
4.1.0
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
UTF-8
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.017453292519943295]]
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)