Skip to content

Commit 9dd2ef7

Browse files
authored
Merge pull request #494 from UCSBCarpentry/main
Updating maintainers and changes from UCSB fork
2 parents ee3fdf7 + 330ef5a commit 9dd2ef7

File tree

3 files changed

+38
-55
lines changed

3 files changed

+38
-55
lines changed

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,10 @@
1414

1515
### Lesson Maintainers:
1616

17-
- [Jemma Stachelek][stachelek_jemma]
1817
- [Ivo Arrey][arreyves]
1918
- [Jon Jablonski][jonjab]
20-
- Drake Asberry
19+
- [Braden Owsley][owsleybc]
2120

22-
[stachelek_jemma]: https://carpentries.org/instructors/#jsta
2321
[arreyves]: https://carpentries.org/instructors/#arreyves
2422
[jonjab]: https://carpentries.org/instructors/#jonjab
23+
[owsleybc]: https://carpentries.org/instructors/#owsleybc

episodes/04-raster-calculations-in-r.Rmd

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ DTM_HARV <-
4343
4444
DTM_HARV_df <- as.data.frame(DTM_HARV, xy = TRUE)
4545
46-
# DSM data for SJER
46+
# DSM (treetop) data for SJER
4747
DSM_SJER <-
4848
rast("data/NEON-DS-Airborne-Remote-Sensing/SJER/DSM/SJER_dsmCrop.tif")
4949
5050
DSM_SJER_df <- as.data.frame(DSM_SJER, xy = TRUE)
5151
52-
# DTM data for SJER
52+
# DTM (bare-earth) data for SJER
5353
DTM_SJER <-
5454
rast("data/NEON-DS-Airborne-Remote-Sensing/SJER/DTM/SJER_dtmCrop.tif")
5555
@@ -64,6 +64,35 @@ See the [lesson homepage](.) for detailed information about the software,
6464
data, and other prerequisites you will need to work through the examples in
6565
this episode.
6666

67+
### Load the Data
68+
69+
For this episode, we will use the DTM and DSM from the NEON Harvard Forest
70+
Field site and San Joaquin Experimental Range. If you don't still have
71+
them loaded, do so now and turn them into dataframes:
72+
73+
# DSM (tree top) data for Harvard Forest
74+
DSM_HARV <-
75+
rast("data/NEON-DS-Airborne-Remote-Sensing/HARV/DSM/HARV_dsmCrop.tif")
76+
77+
DSM_HARV_df <- as.data.frame(DSM_HARV, xy = TRUE)
78+
79+
# DTM (bare earth) data for Harvard Forest
80+
DTM_HARV <-
81+
rast("data/NEON-DS-Airborne-Remote-Sensing/HARV/DTM/HARV_dtmCrop.tif")
82+
83+
DTM_HARV_df <- as.data.frame(DTM_HARV, xy = TRUE)
84+
85+
# DSM data for SJER
86+
DSM_SJER <-
87+
rast("data/NEON-DS-Airborne-Remote-Sensing/SJER/DSM/SJER_dsmCrop.tif")
88+
89+
DSM_SJER_df <- as.data.frame(DSM_SJER, xy = TRUE)
90+
91+
# DTM data for SJER
92+
DTM_SJER <-
93+
rast("data/NEON-DS-Airborne-Remote-Sensing/SJER/DTM/SJER_dtmCrop.tif")
94+
95+
DTM_SJER_df <- as.data.frame(DTM_SJER, xy = TRUE)
6796

6897
::::::::::::::::::::::::::::::::::::::::::::::::::
6998

@@ -95,11 +124,7 @@ with the influence of ground elevation removed.
95124

96125
::::::::::::::::::::::::::::::::::::::::::::::::::
97126

98-
### Load the Data
99127

100-
For this episode, we will use the DTM and DSM from the NEON Harvard Forest
101-
Field site and San Joaquin Experimental Range, which we already have loaded
102-
from previous episodes.
103128

104129
::::::::::::::::::::::::::::::::::::::: challenge
105130

episodes/05-raster-multi-band-in-r.Rmd

Lines changed: 5 additions & 46 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

@@ -77,6 +77,8 @@ ggplot() +
7777
coord_quickmap()
7878
```
7979

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

8284
## Challenge
@@ -124,51 +126,8 @@ represent pixels with less red in them (less red was reflected). To plot an RGB
124126
image, we mix red + green + blue values into one single color to create a full
125127
color image - similar to the color image a digital camera creates.
126128

127-
### Import A Specific Band
128-
129-
We can use the `rast()` function to import specific bands in our raster object
130-
by specifying which band we want with `lyrs = N` (N represents the band number we
131-
want to work with). To import the green band, we would use `lyrs = 2`.
132-
133-
```{r read-specific-band}
134-
RGB_band2_HARV <-
135-
rast("data/NEON-DS-Airborne-Remote-Sensing/HARV/RGB_Imagery/HARV_RGB_Ortho.tif",
136-
lyrs = 2)
137-
```
138-
139-
We can convert this data to a data frame and plot the same way we plotted the red band:
140-
141-
```{r}
142-
RGB_band2_HARV_df <- as.data.frame(RGB_band2_HARV, xy = TRUE)
143-
```
129+
144130

145-
```{r rgb-harv-band2}
146-
ggplot() +
147-
geom_raster(data = RGB_band2_HARV_df,
148-
aes(x = x, y = y, alpha = HARV_RGB_Ortho_2)) +
149-
coord_equal()
150-
```
151-
152-
::::::::::::::::::::::::::::::::::::::: challenge
153-
154-
## Challenge: Making Sense of Single Band Images
155-
156-
Compare the plots of band 1 (red) and band 2 (green). Is the forested area
157-
darker or lighter in band 2 (the green band) compared to band 1 (the red band)?
158-
159-
::::::::::::::: solution
160-
161-
## Solution
162-
163-
We'd expect a *brighter* value for the forest in band 2 (green) than in band 1
164-
(red) because the leaves on trees of most often appear "green" - healthy leaves
165-
reflect MORE green light than red light.
166-
167-
168-
169-
:::::::::::::::::::::::::
170-
171-
::::::::::::::::::::::::::::::::::::::::::::::::::
172131

173132
## Raster Stacks in R
174133

0 commit comments

Comments
 (0)