-
Notifications
You must be signed in to change notification settings - Fork 1
/
wq1.Rnw
266 lines (221 loc) · 9.01 KB
/
wq1.Rnw
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
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
\documentclass[final,t]{beamer}
\mode<presentation>{\usetheme{I6dv}}
% settings
\setbeamerfont{itemize}{size=\normalsize}
\setbeamerfont{itemize/enumerate body}{size=\normalsize}
\setbeamerfont{itemize/enumerate subbody}{size=\normalsize}
\setbeamertemplate{caption}[numbered]
% packages
\usepackage{xcolor}
\usepackage{times}
\usepackage{amsmath,amsthm, amssymb, latexsym}
\usepackage{exscale}
\usepackage{subfig}
\usepackage{booktabs, array}
\usepackage{tabularx}
\usepackage[latin1]{inputenc}
\usepackage[orientation=landscape,size=custom,width=21.59,height=27.94,scale=0.45]{beamerposter} % in cm, equal to 8.5" wide x 11" high
\usepackage{color, colortbl}
% \usepackage[printwatermark]{xwatermark}
\usepackage{graphicx}
\usepackage{tikz}
\definecolor{links}{HTML}{2A1B81}
\definecolor{tabgreen}{rgb}{0.18, 0.79, 0.22}
\definecolor{tabyellow}{rgb}{0.91, 0.76, 0.09}
\definecolor{tabred}{rgb}{0.80, 0.20, 0.19}
\hypersetup{colorlinks,linkcolor=,urlcolor=links}
% % for watermark using tikz
% \newsavebox\mybox
% \savebox\mybox{\tikz[color=red,opacity=0.3]\node{DRAFT};}
% \newwatermark*[
% allpages,
% angle=45,
% scale=6,
% xpos=-20,
% ypos=15
% ]{\usebox\mybox}
% \setcounter{figure}{1}
\renewcommand{\arraystretch}{1.35}
<<setup, echo = F, warning = F, message = F, eval = T, results = 'hide'>>=
knitr::opts_chunk$set(echo = F, message = F, warning = F, eval = T)
# libraries
library(dplyr)
library(knitr)
library(here)
library(tbeptools)
library(tibble)
library(ggplot2)
library(Hmisc)
library(patchwork)
# remotes::install_github("tbep-tech/tbeptools")
# devtools::load_all('../tbeptools/.')
# local file path
xlsx <- here('data-raw', 'Results_Provisional.xlsx')
# xlsx <- here('data-raw', 'Results_Updated.xls')
# import and download if new
epcdata <- read_importwq(xlsx, download_latest = F)
# epcdata <- read_importwq(xlsx, download_latest = T)
maxyr <- 2024
partialyr <- F
@
\title{\Large \Sexpr{maxyr} Tampa Bay Water Quality Assessments}
\author{\normalsize A Tampa Bay Estuary Program Initiative to Maintain and Restore \\ the Bay's Seagrass Resources}
\begin{document}
\begin{frame}
\vspace{-0.4cm} %spacing for block distance from header
\begin{columns}[t]
%%%%%%%%%%%%%%
% left
%%%%%%%%%%%%%%
\begin{column}{.2\linewidth}
\vspace{-0.2in}
<<attainmat, echo = F, fig = F, include = F>>=
p <- show_matrix(epcdata, yrrng = c(1975, maxyr), txtsz = 5, abbrev = T, historic = T, partialyr = partialyr) +
theme(
plot.background = element_rect(fill = NA, color = NA),
axis.text.y = element_text(size = 14, colour = 'black'),
axis.text.x = element_text(size = 14, colour = 'black'),
plot.title = element_text(size = 22, colour = 'black')
) +
ggtitle("Historic results:")
pdf(here('figure', 'attainmat.pdf'), family = 'serif', height = 13.75, width = 2.6)
p
dev.off()
@
\begin{figure}
\centerline{\includegraphics[trim = 0cm 0cm 0cm 0cm, width=1.1\linewidth]{figure/attainmat.pdf}}
\caption{\footnotesize Decision matrix results for 1975 to \Sexpr{maxyr} (April, May data missing for 2020).}
\label{fig:attainmat}
\end{figure}
\end{column}
%%%%%%%%%%%%%%
% right
%%%%%%%%%%%%%%
\begin{column}{.79\linewidth}
\begin{block}{Background}
\begin{minipage}{0.5\textwidth}
\vspace{-0.2in}
\footnotesize
Light availability to seagrass is the guiding paradigm for TBEP's Nitrogen Management Strategy. Because excessive nitrogen loads to the bay generally lead to increased algae blooms (higher chlorophyll-a levels) (Figure \ref{fig:nitro}) and reduced light penetration to seagrass, an evaluation method was developed to assess whether load reduction strategies are achieving desired water quality results (i.e. reduced chlorophyll-a concentrations and increased water clarity).
\end{minipage}
\hspace{0.1in}
\begin{minipage}{0.45\textwidth}
\begin{figure}
\includegraphics[width=0.9\textwidth]{www/nitro.jpg}
\caption{\footnotesize Seagrass restoration with N management.}
\label{fig:nitro}
\end{figure}
\end{minipage}
\vspace{-0.2in}
\end{block}
\begin{block}{Decision Support Approach}
\begin{minipage}{0.5\textwidth}
\footnotesize
Year to year algae abundance (measured as chlorophyll-a concentrations) and visible light penetration through the water column (secchi disk depth visibility) have been identified as critical water quality indicators in Tampa Bay. Tracking the attainment of bay segment specific targets for these indicators provides the framework for developing and initiating bay management actions. TBEP management actions adopted in response to the annually-assessed decision support results are shown to the right.
\end{minipage}
\hspace{0.01in}
\begin{minipage}{0.45\textwidth}
\includegraphics[width=1\textwidth]{www/stoplight.PNG}
\end{minipage}
\end{block}
\begin{block}{\Sexpr{maxyr} Decision Matrix Results}
\vspace{-0.1in}
\begin{minipage}{0.45\textwidth}
\footnotesize
Water quality remained supportive of seagrass in most bay segments in comparison to prior years (Table \ref{tab:segtab}, Figure \ref{fig:thrplot}). One tropical storm and two hurricanes affected the region in the fall. As a result, management targets for chlorophyll-a were exceeded in Old Tampa Bay (OTB) and Middle Tampa Bay (MTB). Light attenuation targets were exceeded in Lower Tampa Bay (LTB), causing the bay segment to receive a "Caution" outcome. Water quality conditions in OTB remain under investigation based on observations of significant decreases in seagrass coverage between 2016 and 2022.
\end{minipage}
\hspace{0.1in}
\begin{minipage}{0.5\textwidth}
\footnotesize
<<results = 'asis', eval = T>>=
tab <- anlz_yrattain(epcdata, yrsel = maxyr, partialyr = partialyr) %>%
mutate(
chla_val = round(chla_val, 1),
chla_target = round(chla_target, 1),
la_val = round(la_val, 2),
la_target = round(la_target, 2),
outcome = case_when(
outcome == 'green' ~ 'tabgreen',
outcome == 'yellow' ~ 'tabyellow',
outcome == 'red' ~ 'tabred'
),
bay_segment = paste0('\\cellcolor{', outcome, '}', bay_segment)
) %>%
column_to_rownames('bay_segment') %>%
select(-outcome)
cap.val <- paste0('{\\footnotesize Water quality outcomes for ', maxyr , '.}')
cgrps <- c('Chl-a (ug/L)','Light Penetration (m$^{-1}$)')
latex(
tab,
file = '',
caption = cap.val,
caption.loc = 'top',
cgroup = cgrps,
n.cgroup = c(2, 2),
rowlabel = 'Segment',
colheads = c(maxyr, 'target', maxyr, 'target'),
label = 'tab:segtab',
col.just = c("c","c","c","c"),#rep('p{0.45in}', 5)
table.env = F
)
@
\end{minipage}
\end{block}
\vspace{-0.4in}
\begin{columns}[t]
<<thrplot, echo = F, fig = F, include = F, eval = T>>=
yrrng <- c(1975, maxyr)
txtcol <- 'black'
thrthm <- theme(
plot.background = element_rect(fill = NA, color = NA),
axis.text.y = element_text(colour = txtcol, size = 14),
axis.title = element_blank(),
plot.title = element_text(size = 22, colour = txtcol),
legend.text = element_text(size = 16, colour = txtcol),
axis.text.x = element_text(colour = txtcol, angle = 0, size = 14, hjust = 0.5)
)
sclx <- scale_x_continuous(breaks = seq(1975, maxyr, by = 5))
p1 <- show_thrplot(epcdata, bay_segment = "OTB", thr = "chla", yrrng = yrrng, partialyr = partialyr) + sclx
p2 <- show_thrplot(epcdata, bay_segment = "HB", thr = "chla", yrrng = yrrng, partialyr = partialyr) + sclx
p3 <- show_thrplot(epcdata, bay_segment = "MTB", thr = "chla", yrrng = yrrng, partialyr = partialyr) + sclx
p4 <- show_thrplot(epcdata, bay_segment = "LTB", thr = "chla", yrrng = yrrng, partialyr = partialyr) + sclx
p <- (guide_area() / (p1 + p2 + p3 + p4)) + plot_layout(ncol = 1, guides = 'collect', heights = unit(c(1, 1), c("cm", "null"))) & thrthm
pdf(here('figure', 'thrplot.pdf'), family = 'serif', height = 9, width = 10.25)
p
dev.off()
@
\begin{column}{0.585\textwidth}
\vspace{-0.4cm}
\begin{figure}[htbp]
% \hspace*{2cm}
\includegraphics[trim = 0cm 0cm 0cm 0cm, width=1.09\linewidth]{figure/thrplot.pdf}
\caption{\footnotesize Historic chlorophyll-a annual averages for the four bay segments.}
\label{fig:thrplot}
\end{figure}
\end{column}
<<sitemap, echo = F, fig = F, include = F, eval = T>>=
txtcol <- 'black'
p <- show_sitemap(epcdata, yrsel = maxyr, partialyr = partialyr) +
theme(
plot.background = element_rect(fill = NA, color = NA),
axis.text = element_blank(),
axis.ticks = element_blank()
)
pdf(here('figure', 'sitemap.pdf'), family = 'serif', height = 5, width = 4)
p
dev.off()
@
\begin{column}{0.37\textwidth}
\begin{figure}
\centerline{\includegraphics[trim = 0cm 0cm 0cm -1.25cm, width=1.1\linewidth]{figure/sitemap.pdf}}
\caption{\footnotesize Chlorophyll attainment outcomes by site for \Sexpr{maxyr}.}
\label{fig:sitemap}
\end{figure}
\end{column}
\end{columns}
\vspace{-0.4cm}
\tiny \textit{\textbf{Note}: Continuing water quality monitoring support provided by the Environmental Protection Commission of Hillsborough County. Full methods in Janicki et al. 2000. \href{https://drive.google.com/file/d/1XMULU8w4syWcSv_ciOUOhnC_G4xt6GIF/view?usp=drivesdk}{TBEP Technical Report \#04-00}. Points in map above show site-specific attainment of a bay segment target and are for reference only.} \\
\end{column}
\end{columns}
\end{frame}
\end{document}