-
Notifications
You must be signed in to change notification settings - Fork 0
/
Notebook_3.Rmd
229 lines (191 loc) · 9.14 KB
/
Notebook_3.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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
---
title: "Notebook 3: Erosion and Sediment Transport"
author: "your name"
date: "June 30, 2022"
output: html_notebook
---
```{r include=FALSE}
#Setting up (to be hidden from final version)
library(ggplot2)
library(dplyr)
library(lubridate)
library(scales)
#echo=FALSE, message=FALSE hide both the code output and the message from the
#html version
```
```{r echo=FALSE, message=FALSE, warning= FALSE}
#Defining a common theme for our graphics
theme_fg = theme(axis.text=element_text(colour="black",size=14),
axis.title.y = element_text(size = 20),
axis.title.x = element_text(size = 20),
panel.grid.minor= element_line(colour = "gray", linetype = "dotted"),
panel.grid.major = element_line(colour = "gray", linetype = "dashed"),
panel.border = element_rect(fill=NA, colour = "black", size=1),
panel.background=element_blank(),
axis.ticks.length = unit(0.254, "cm"),
axis.ticks = element_line(colour = "black", size=1),
axis.line = element_line(colour = "black"),
legend.position = c(.90,.90),
legend.direction = "vertical",
legend.background = element_rect(fill=alpha(0.1)),
legend.title = element_blank())
```
# Fundamentals of Hydrology: Erosion and Sediment Transport
## Introduction
### Erosion and sediment transport
**Question**: What is erosion, and how is it related to sediment transport in streams?
**Question**: How is particulate material supplied to stream channels in mountainous headwater streams?
Today, we are going to explore suspended sediment data. These data span several decades and are part of a Long Term Ecological Research Forest in Oregon. The [H.J.Andrews LTER](https://andrewsforest.oregonstate.edu/) is located in the Oregon Cascades. But before looking at these data, we need to load some packages that we installed in the previous session
We will use the same data set analyzed in the stream flow section.
**To do**: Visit the [H.J.Andrews LTER](https://andrewsforest.oregonstate.edu/) website and find the appropriate form the data set used in our class.
```{r echo=FALSE, message=FALSE, warning=FALSE}
#Loading the data and making some internal arrangement
hjs <- read.csv("220621_fho_hjandrews.csv")
hjs$dt <- as.Date(hjs$dt, origin = "1899-12-30", format = "%Y-%m-%d")
hjs$ws.f <- factor(hjs$ws.f,levels = c("Old-growth","Logged"))
hjs$ssn <- factor(hjs$ssn,levels = c("Fall","Winter","Spring","Summer"))
```
Here, I am creating 5-year time windows for part of our analysis later.
```{r include=FALSE}
hjs$prd <- with(hjs,ifelse(wy<1975,"1969-1974",
ifelse(wy>1974&wy<1981,"1975-1980",
ifelse(wy>1980&wy<1987,"1981-1986",
ifelse(wy>1986&wy<1993,"1987-1992",
ifelse(wy>1992&wy<1999,"1993-1998",
ifelse(wy>1998&wy<2005,"1999-2004",
ifelse(wy>2004&wy<2011,"2005-2010","2011+"))))))))
```
In this dataset, Total Suspended Solids (TSS) is represented by the variable "sed.mg_l" in which mg_l is the concentration unit (miligrams per litter). Let's start with a quick look of the time series:
### Suspended sediments over time
```{r echo=FALSE, message=FALSE, warning = FALSE}
dat_tss_fig <- ggplot(hjs, aes(y=sed.mg_l, x= dt, color = ws.f, fill = ws.f))+
geom_line(alpha=0.5)+
geom_point(alpha = 0.5)+
# geom_smooth(span = 0.35)+
scale_x_date()+
scale_y_log10(breaks = trans_breaks("log10", function(x) 10^x),
labels = trans_format("log10", math_format(10^.x)))+ #the function trans_breaks comes with the package scales
xlab("Water year")+
ylab(expression(paste("Suspended Sediments (mg",l^{-1}, ")")))+
scale_color_manual(values = c("#00BFC4","#F8766D"))+
scale_fill_manual(values = c("#00BFC4","#F8766D"))+
facet_wrap(~ws.f)+
theme_fg
dat_tss_fig
```
*To do*: Add a caption to the figure and describe the changes observed over time.
### Suspended sediment concentrations along the hydrological year (Oct 1 - Sept 30)
```{r echo=FALSE,message=FALSE, warning = FALSE}
day_tss_fig <- ggplot(hjs, aes(y=sed.mg_l, x= wd, color = ws.f, fill = ws.f))+
geom_line(alpha=0.5)+
# geom_point(alpha = 0.5)+
geom_smooth(span = 0.35)+
scale_y_log10(breaks = trans_breaks("log10", function(x) 10^x),
labels = trans_format("log10", math_format(10^.x)))+
xlab("Water day")+
ylab(expression(paste("Suspended Sediments (mg",l^{-1}, ")")))+
scale_color_manual(values = c("#00BFC4","#F8766D"))+
scale_fill_manual(values = c("#00BFC4","#F8766D"))+
facet_wrap(~ws.f)+
theme_fg
day_tss_fig
```
*To do*: Add a caption to the figure and describe the changes observed over time.
### Distribution of TSS concentrations in and Old-growth and logged watershed in the Oregon Cascades
```{r echo=FALSE,message=FALSE, warning = FALSE}
hist_tss_fig <- ggplot(hjs, aes(x=sed.mg_l, color = ws.f, fill = ws.f))+
# geom_histogram(alpha = 0.5)+
geom_density(alpha = 0.5)+
scale_x_log10(breaks = trans_breaks("log10", function(x) 10^x),
labels = trans_format("log10", math_format(10^.x)))+
# ylab("Frequency")+
ylab("Estimated kernel density")+
xlab(expression(paste("Suspended Sediments (mg",l^{-1}, ")")))+
scale_color_manual(values = c("#00BFC4","#F8766D"))+
scale_fill_manual(values = c("#00BFC4","#F8766D"))+
# facet_wrap(~ws.f)+
theme_fg
hist_tss_fig
```
*To do*: add a caption to the figure and compare the density distribution of TSS concentrations between watersheds.
### Seasonal changes in the distribution of TSS concentrations in and Old-growth and logged watershed in the Oregon Cascades
```{r echo=FALSE, message=FALSE, warning = FALSE}
ssn_tss_fig <- ggplot(hjs, aes(x=sed.mg_l, color = ssn, fill = ssn))+
# geom_histogram(alpha = 0.5)+
geom_density(alpha = 0.5)+
scale_x_log10()+
ylab("Estimated kernel density")+
xlab(expression(paste("Suspended Sediments (mg",l^{-1}, ")")))+
scale_x_log10(breaks = trans_breaks("log10", function(x) 10^x),
labels = trans_format("log10", math_format(10^.x)))+
facet_wrap(~ws.f)+
theme_fg
ssn_tss_fig
```
Let's compare both watersheds season by season
```{r echo=FALSE, message=FALSE, warning = FALSE}
ssn_tss_fig <- ggplot(hjs, aes(x=sed.mg_l, color = ws.f, fill = ws.f))+
# geom_histogram(alpha = 0.5)+
geom_density(alpha = 0.5, size = 0.75)+
scale_x_log10(breaks = trans_breaks("log10", function(x) 10^x),
labels = trans_format("log10", math_format(10^.x)))+
ylab("Estimated Kernel Density")+
xlab(expression(paste("Suspended Sediments (mg",l^{-1}, ")")))+
scale_color_manual(values = c("#00BFC4","#F8766D"))+
scale_fill_manual(values = c("#00BFC4","#F8766D"))+
facet_wrap(~ssn)+
theme_fg
ssn_tss_fig
```
*To do*: add a caption to the figure and compare the density distribution of TSS concentrations between watersheds.
### Temporal evolution in the Suspended sediment load in heawater streams in the Oregon Cascades
Let's first take a look at the TSS distributions in 5-year increments:
```{r echo=FALSE, message=FALSE, warning = FALSE}
prd_tss_fig <- ggplot(hjs, aes(x=sed.mg_l, color = ws.f, fill = ws.f))+
# geom_histogram(alpha = 0.5)+
geom_density(alpha = 0.5, size = 0.75)+
scale_x_log10(breaks = trans_breaks("log10", function(x) 10^x),
labels = trans_format("log10", math_format(10^.x)))+
ylab("Estimated Kernel Density")+
xlab(expression(paste("Suspended Sediments (mg",l^{-1}, ")")))+
scale_color_manual(values = c("#00BFC4","#F8766D"))+
scale_fill_manual(values = c("#00BFC4","#F8766D"))+
facet_wrap(~prd,ncol = 4)+
theme_fg+
theme(legend.position = c(0.08,0.9))
prd_tss_fig
```
Let's take a similar look at discharge data:
```{r echo=FALSE, message=FALSE, warning = FALSE}
prd_uqm_fig <- ggplot(hjs, aes(x=uq.cm, color = ws.f, fill = ws.f))+
# geom_histogram(alpha = 0.5)+
geom_density(alpha = 0.65, size = 0.75)+
scale_x_log10(breaks = trans_breaks("log10", function(x) 10^x),
labels = trans_format("log10", math_format(10^.x)))+
ylab("Estimated Kernel Density")+
xlab("Unit discharge (cm)")+
scale_color_manual(values = c("#00BFC4","#F8766D"))+
scale_fill_manual(values = c("#00BFC4","#F8766D"))+
facet_wrap(~prd,ncol = 4)+
theme_fg
prd_uqm_fig
```
Let's now calculate sediment load:
```{r}
hjs$sed_kg_ha <- (hjs$uq.cm * hjs$sed.mg_l)/10
```
Finally, let's take a look at the temporal evolution of the sediment load:
```{r echo=FALSE, message=FALSE, warning = FALSE}
prd_sld_fig <- ggplot(hjs, aes(x=sed_kg_ha, color = ws.f, fill = ws.f))+
geom_density(alpha = 0.65, size = 0.75)+
scale_x_log10(breaks = trans_breaks("log10", function(x) 10^x),
labels = trans_format("log10", math_format(10^.x)))+
ylab("Estimated Kernel Density")+
xlab(expression(paste("Sediment load (kg", ha^{-1}, ")")))+
scale_color_manual(values = c("#00BFC4","#F8766D"))+
scale_fill_manual(values = c("#00BFC4","#F8766D"))+
facet_wrap(~prd,ncol = 4)+
theme_fg
prd_sld_fig
```
*To do*: add a caption to the figure and compare the density distribution of Sediment loads between watersheds and across time periods.