diff --git a/README.md b/README.md index 2f65537b..b598680b 100644 --- a/README.md +++ b/README.md @@ -14,11 +14,10 @@ ### Lesson Maintainers: -- [Jemma Stachelek][stachelek_jemma] - [Ivo Arrey][arreyves] - [Jon Jablonski][jonjab] -- Drake Asberry +- [Braden Owsley][owsleybc] -[stachelek_jemma]: https://carpentries.org/instructors/#jsta [arreyves]: https://carpentries.org/instructors/#arreyves [jonjab]: https://carpentries.org/instructors/#jonjab +[owsleybc]: https://carpentries.org/instructors/#owsleybc diff --git a/episodes/04-raster-calculations-in-r.Rmd b/episodes/04-raster-calculations-in-r.Rmd index 1c0b850e..75c9ce7f 100644 --- a/episodes/04-raster-calculations-in-r.Rmd +++ b/episodes/04-raster-calculations-in-r.Rmd @@ -43,13 +43,13 @@ DTM_HARV <- DTM_HARV_df <- as.data.frame(DTM_HARV, xy = TRUE) -# DSM data for SJER +# DSM (treetop) data for SJER DSM_SJER <- rast("data/NEON-DS-Airborne-Remote-Sensing/SJER/DSM/SJER_dsmCrop.tif") DSM_SJER_df <- as.data.frame(DSM_SJER, xy = TRUE) -# DTM data for SJER +# DTM (bare-earth) data for SJER DTM_SJER <- rast("data/NEON-DS-Airborne-Remote-Sensing/SJER/DTM/SJER_dtmCrop.tif") @@ -64,6 +64,35 @@ See the [lesson homepage](.) for detailed information about the software, data, and other prerequisites you will need to work through the examples in this episode. +### Load the Data + +For this episode, we will use the DTM and DSM from the NEON Harvard Forest +Field site and San Joaquin Experimental Range. If you don't still have +them loaded, do so now and turn them into dataframes: + +# DSM (tree top) data for Harvard Forest +DSM_HARV <- + rast("data/NEON-DS-Airborne-Remote-Sensing/HARV/DSM/HARV_dsmCrop.tif") + +DSM_HARV_df <- as.data.frame(DSM_HARV, xy = TRUE) + +# DTM (bare earth) data for Harvard Forest +DTM_HARV <- + rast("data/NEON-DS-Airborne-Remote-Sensing/HARV/DTM/HARV_dtmCrop.tif") + +DTM_HARV_df <- as.data.frame(DTM_HARV, xy = TRUE) + +# DSM data for SJER +DSM_SJER <- + rast("data/NEON-DS-Airborne-Remote-Sensing/SJER/DSM/SJER_dsmCrop.tif") + +DSM_SJER_df <- as.data.frame(DSM_SJER, xy = TRUE) + +# DTM data for SJER +DTM_SJER <- + rast("data/NEON-DS-Airborne-Remote-Sensing/SJER/DTM/SJER_dtmCrop.tif") + +DTM_SJER_df <- as.data.frame(DTM_SJER, xy = TRUE) :::::::::::::::::::::::::::::::::::::::::::::::::: @@ -95,11 +124,7 @@ with the influence of ground elevation removed. :::::::::::::::::::::::::::::::::::::::::::::::::: -### Load the Data -For this episode, we will use the DTM and DSM from the NEON Harvard Forest -Field site and San Joaquin Experimental Range, which we already have loaded -from previous episodes. ::::::::::::::::::::::::::::::::::::::: challenge diff --git a/episodes/05-raster-multi-band-in-r.Rmd b/episodes/05-raster-multi-band-in-r.Rmd index 126e5571..e817c8b3 100644 --- a/episodes/05-raster-multi-band-in-r.Rmd +++ b/episodes/05-raster-multi-band-in-r.Rmd @@ -1,7 +1,7 @@ --- title: Work with Multi-Band Rasters -teaching: 40 -exercises: 20 +teaching: 30 +exercises: 15 source: Rmd --- @@ -77,6 +77,8 @@ ggplot() + coord_quickmap() ``` +To import the green band, we would use `lyrs = 2`. + ::::::::::::::::::::::::::::::::::::::: challenge ## Challenge @@ -124,51 +126,8 @@ represent pixels with less red in them (less red was reflected). To plot an RGB image, we mix red + green + blue values into one single color to create a full color image - similar to the color image a digital camera creates. -### Import A Specific Band - -We can use the `rast()` function to import specific bands in our raster object -by specifying which band we want with `lyrs = N` (N represents the band number we -want to work with). To import the green band, we would use `lyrs = 2`. - -```{r read-specific-band} -RGB_band2_HARV <- - rast("data/NEON-DS-Airborne-Remote-Sensing/HARV/RGB_Imagery/HARV_RGB_Ortho.tif", - lyrs = 2) -``` - -We can convert this data to a data frame and plot the same way we plotted the red band: - -```{r} -RGB_band2_HARV_df <- as.data.frame(RGB_band2_HARV, xy = TRUE) -``` + -```{r rgb-harv-band2} -ggplot() + - geom_raster(data = RGB_band2_HARV_df, - aes(x = x, y = y, alpha = HARV_RGB_Ortho_2)) + - coord_equal() -``` - -::::::::::::::::::::::::::::::::::::::: challenge - -## Challenge: Making Sense of Single Band Images - -Compare the plots of band 1 (red) and band 2 (green). Is the forested area -darker or lighter in band 2 (the green band) compared to band 1 (the red band)? - -::::::::::::::: solution - -## Solution - -We'd expect a *brighter* value for the forest in band 2 (green) than in band 1 -(red) because the leaves on trees of most often appear "green" - healthy leaves -reflect MORE green light than red light. - - - -::::::::::::::::::::::::: - -:::::::::::::::::::::::::::::::::::::::::::::::::: ## Raster Stacks in R