Readme

This is an R Notebook. If you’d like to pre-rendered figures, read a summary of analysis and view code, please open the html file in a browser. If you’d like to run the code yourself downloard and open the rmd file in rstudio or any other integrated development environment that supports r and markdown.

require(tidyverse)
require(lubridate)
require(magrittr)

Rationale

This notebook collects any computational work associated with understanding bull trout in the Yakima Basin. It supports s7 consultations, recovery projects and general questions about ecology, climate and water management.

Environmental Data

Water Management

Natural Hydrograph

What was the natural hydrograph of the Yakima basin before diversions and regulated flow? Here we plot results of a BoR model that attempts to estimate unregulated flow for the Yakima River at the mouth from 1926 to 2018.

Source: US Bureau of Reclamation Technical Memorandum Modified Flows 2020, Yakima River Basin Columbia Pacific Northwest Region

yak_nat <- read.csv("data/unregulated_flows.csv")

yak_nat_median <- yak_nat %>%
  pivot_longer(-Year, names_to = "month", values_to = "acre_feet") %>%
  group_by(month) %>%
  summarise(median_af = median(acre_feet), mean_af = mean(acre_feet))

yak_nat_long <- yak_nat %>%
  pivot_longer(-Year, names_to = "month", values_to = "acre_feet") %>%
  mutate(month_n = case_when(month == "Jan" ~ 1,
                             month == "Feb" ~ 2,
                             month == "Mar" ~ 3,
                             month == "Apr" ~ 4,
                             month == "May" ~ 5,
                             month == "Jun" ~ 6,
                             month == "Jul" ~ 7,
                             month == "Aug" ~ 8,
                             month == "Sep" ~ 9,
                             month == "Oct" ~ 10,
                             month == "Nov" ~ 11,
                             month == "Dec" ~ 12))
  

ggplot(yak_nat_long)+
  geom_line(aes(month_n, acre_feet, color = Year, group = as.factor(Year)), alpha = 0.5)+
  scale_colour_viridis_c()+
  scale_x_continuous(breaks = c(1:12), labels = c("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"))+
  geom_smooth(aes(month_n, acre_feet), color = "black", linewidth = 2)+
  xlab("Month")+ylab("Yakima River Discharge (Acre-Feet)")+
  theme_classic()

This fits with the basic idea that the Yakima basin has a snowmelt dominated hydrograph, with a single pulse occurring in spring (Apr, May, June).

Rimrock

Flip-Flop

Rimrock has been under so called “flip-flop” operations since 1981. Currently, the pool is maintained at 127,000 acre-feet until August 10th to provide connectivity over a barrier waterfall at SF Tieton River (Thomas, 2001). This corresponds to a pool elevation of 2,894 msl, where a barrier waterfall as SF Tieton forms every year. This elevation keeps the barrier waterfall to 5 feet, a height where bull trout passage is assumed to be unimpaired (Thomas 2001). To avoid any waterfall forming, the pool must be maintained above 131,000 acre feet.

Let’s make a nice figure of pool height/acre feet over time to better understand operations at rimrock.

# here we import the data, pulled from the BoR hydromet page from 1981 to present (Nov 27 2023)

#rim af = RIMROCK RESERVOIR,TIETON RIVER AND WEATHER STATION Reservoir Water Storage, acre-feet
#rim fb = RIMROCK RESERVOIR,TIETON RIVER AND WEATHER STATION Reservoir Water Surface Elevation, feet
#rim gd = RIMROCK RESERVOIR,TIETON RIVER AND WEATHER STATION Average Stream Stage, feet
#rim qd = RIMROCK RESERVOIR,TIETON RIVER AND WEATHER STATION Average Stream Discharge, cfs
#rim qu = RIMROCK RESERVOIR,TIETON RIVER AND WEATHER STATION Estimated Average Unregulated Flow, cfs

rimrock <- read_tsv("data/rimrock_hydromet.txt", comment = "#")

#next let's clean thing up, we'll create a month-day column to compare data across years
rimrock %<>%
  mutate(yday = as.Date(yday(DateTime), origin = "2050-01-01"),
         year = year(DateTime))
ggplot(rimrock)+geom_line(aes(yday, rim_af, color = factor(year)), alpha = 0.5)+
  scale_x_date(date_labels = "%b", breaks = "1 month")+scale_color_viridis_d(guide = "none")+
  geom_smooth(aes(yday, rim_af), color = "black", size = 2)+
  theme_classic()+xlab("Date")+ylab("Rimrock Capacity (acre-feet)")+
  #geom_vline(aes(xintercept = mdy("08-10-2050")))+
  geom_hline(aes(yintercept = 127000))+
  annotate(geom= "text", x = mdy("04-10-2050"), y = 124000, label = "Barrier Falls Form")+
  #annotate(geom= "text", x = mdy("08-08-2050"), y = 50000, label = "Upstream Spawning\nMigration Complete", angle = 90)
  annotate("rect", xmin = mdy("06-01-2050"), xmax = mdy("08-10-2050"), ymin = -Inf, ymax = Inf, fill = "#FFEA46FF" , alpha = 0.2)+
  annotate("rect", xmin = mdy("08-10-2050"), xmax = mdy("10-15-2050"), ymin = -Inf, ymax = Inf, fill = "#00336FFF" , alpha = 0.2) +
  annotate(geom= "text", x = mdy("07-01-2050"), y = 50000, label = "Upstream Spawning\nMigration", angle = 90) +
  annotate(geom= "text", x = mdy("09-8-2050"), y = 50000, label = "Adult Downstream \n Post-Spawning Migration", angle = 90)

What about flows? Connectivity in Rimrock is not the only flip-flop concern. Currently extremely high flows during irrigation deliveries limit habitat quality in Tieton below the dam. Let’s plot these flows.

# let's plot the median discharge instead of a smoother
rimrock %<>%
  group_by(yday) %>%
  mutate(median_cfs = median(rim_qd)) %>%
  ungroup()
ggplot(rimrock)+geom_line(aes(yday, rim_qd, color = factor(year)), alpha = 0.5)+
  scale_x_date(date_labels = "%b", breaks = "1 month")+scale_color_viridis_d(guide = "none")+
  geom_line(aes(yday, median_cfs), color = "black", size = 2)+
  theme_classic()+xlab("Date")+ylab("Rimrock Discharge (cfs)")