knitr::opts_chunk$set(echo = TRUE)
knitr::opts_knit$set(root.dir = rprojroot::find_rstudio_root_file())
library(tidyverse)
library(readxl)
library(cvpiaHabitat)
library(scales)

Future Data Improvements

Instream Spawning and Rearing Habitat

Data Sources: EBMUD 2016 and CDFW 1991
Instream spawning and rearing habitat for Fall Run Chinook Salmon in the Mokelumne River is based on data from USFWS's 1998 instream flow evaluation and EBMUD's 2016 instream habitat evaluation. The EBMUD instream spawning and rearing habitat data was provided in a spreadsheet (see '~/cvpiaHabitat/data-raw/instream/mokelumne/LMR_habitat__s_v2mw_to_MT.xlsx') Together, these evaluations developed relationships between flow and suitable spawning and rearing habitat for reaches spanning approximately 35 miles of the Mokelumne River.

Spawning WUA

EBMUD provided a spawning habitat flow:area relationship covering the entire river. For each flow, the area was converted to an area per unit length by dividing the total spawning area by the length of the spawning reach mapped by the SIT.

# spawning reach length
moke_spawn_len <- cvpiaHabitat::watershed_lengths %>% 
  filter(watershed == 'Mokelumne River', lifestage == 'spawning') %>% 
  pull(feet)

# 'LMR_habitat__s_v2mw_to_MT.xlsx'
# spawning: 'Spawning WUA' tab A4:C8 
spawning <- read_excel('data-raw/instream/mokelumne/LMR_habitat__s_v2mw_to_MT.xlsx', 
                       sheet = 'Spawning WUA', range = 'A4:C8', 
                       col_names = c('flow_cfs', 'FR_spawn_sqft', 'ST_spawn_sqft')) %>% 
  mutate(FR_spawn_wua = FR_spawn_sqft/(moke_spawn_len / 1000), #sqft_per_1000ft
         ST_spawn_wua = ST_spawn_sqft/(moke_spawn_len / 1000)) %>% 
  select(flow_cfs, FR_spawn_wua, ST_spawn_wua)

spawning

Spawning WUA Plot

The following plot shows the weighted usable spawning area rate in square feet per thousand feet of river for Fall Run Chinook Salmon (FR_spawn_wua) and Steelhead (ST_spawn_wua). These rates are multiplied by the total spawning reach length mapped by the SIT and applied for the flow in each month in the DSM.

spawning %>% 
  gather(species, wua, -flow_cfs) %>% 
  ggplot(aes(flow_cfs, wua, color = species)) +
  geom_line() +
  labs(x = 'Flow (cfs)', y = 'Spawning WUA (sqft/1000ft)') +
  scale_y_continuous(labels = comma) + 
  theme_minimal()

Rearing WUA

The flow:area relationships from USFWS and EBMUD were first expanded using linear interpolation so that the relationships for each evaluation reach included the same flows. A single rearing habitat area representing the entire river was then estimated for each flow by weighting each area in proportion to the length of the evaluation reach from which the area was originally estimated. The resulting areas were then converted to an area per unit length by dividing the area by the length of the rearing reach mapped by the SIT.

# rearing reach length
moke_rear_len <- cvpiaHabitat::watershed_lengths %>% 
  filter(watershed == 'Mokelumne River', lifestage == 'rearing') %>% 
  pull(feet)

# 'LMR_habitat__s_v2mw_to_MT.xlsx'
# rearing: 'Instream WUA' tab A2:C8 and A11:C14 and A17:C27 weighted average
total_modeled_len <- 1.1 + 9.4 + 24.7

rearing1 <- read_excel('data-raw/instream/mokelumne/LMR_habitat__s_v2mw_to_MT.xlsx', 
                       sheet = 'Instream WUA', range = 'A2:C8') 
rearing2 <- read_excel('data-raw/instream/mokelumne/LMR_habitat__s_v2mw_to_MT.xlsx', 
                       sheet = 'Instream WUA', range = 'A11:C14')
rearing3 <- read_excel('data-raw/instream/mokelumne/LMR_habitat__s_v2mw_to_MT.xlsx', 
                       sheet = 'Instream WUA', range = 'A17:C27')

Flow <- unique(sort(c(rearing1$Flow, rearing2$Flow, rearing3$Flow)))

# reach 1 ------------
r1 <- tibble(
  Flow = Flow,
  `Fall-run fry (ft2)` = approx(rearing1$Flow, rearing1$`Fall-run fry (ft2)`, 
                                xout = Flow, rule = 2)$y,
  `Fall-run juvenile (ft2)` = approx(rearing1$Flow, rearing1$`Fall-run juvenile (ft2)`, 
                                     xout = Flow, rule = 2)$y,
  rm = 1.1
)

# reach 2 ----------
r2 <- tibble(
  Flow = Flow,
  `Fall-run fry (ft2)` = approx(rearing2$Flow, rearing2$`Fall-run fry (ft2)`, 
                                xout = Flow, rule = 2)$y,
  `Fall-run juvenile (ft2)` = approx(rearing2$Flow, rearing2$`Fall-run juvenile (ft2)`, 
                                     xout = Flow, rule = 2)$y,
  rm = 9.4
)

# reach 3 ----------
r3 <- tibble(
  Flow = Flow,
  `Fall-run fry (ft2)` = approx(rearing3$Flow, rearing3$`Fall-run fry (ft2)`, 
                                xout = Flow, rule = 2)$y,
  `Fall-run juvenile (ft2)` = approx(rearing3$Flow, rearing3$`Fall-run juvenile (ft2)`, 
                                     xout = Flow, rule = 2)$y,
  rm = 24.7
)

# combine reaches
rearing <- r1 %>% 
  bind_rows(r2, r3) %>% 
  gather(lifestage, sq_ft, -Flow, -rm) %>%
  group_by(lifestage, Flow) %>% 
  summarise(wua = sum(sq_ft/rm/5.28 * rm/total_modeled_len)) %>% 
  spread(lifestage, wua) %>% 
  rename(flow_cfs = Flow, FR_fry_wua = `Fall-run fry (ft2)`, FR_juv_wua = `Fall-run juvenile (ft2)`)


# 300 cfs fry, double check calculation
(203823/1.1/5.28 * 1.1/35.2 + 1718536/9.4/5.28 * 9.4/35.2 + 1697397/24.7/5.28 * 24.7/35.2) -
(rearing %>% 
  filter(flow_cfs == 300) %>% 
  pull(FR_fry_wua))

Rearing WUA Plots

The following plots show the raw instream rearing area data for Fall Run Chinook Salmon fry in one of the three rearing reaches of the Mokelumne River. The first plot is the original evaluation data for one of the rearing reaches. The second plot is the rearing habitat data expanded by linear interpolation to generate values for all flows from all three evaluations.

rearing1 %>% 
  ggplot(aes(Flow, `Fall-run fry (ft2)`)) +
  geom_point()
r1 %>% 
  ggplot(aes(Flow, `Fall-run fry (ft2)`)) +
  geom_point()

Combine Instream Spawning and Rearing Habitat Data

The instream spawning and rearing habitat data described above is combined for use in the DSM in the following format.

mokelumne_river_instream <- spawning %>% 
  full_join(rearing) %>% 
  arrange(flow_cfs) %>% 
  mutate(watershed = 'Mokelumne River') %>% 
  select(flow_cfs, FR_spawn_wua, FR_fry_wua, FR_juv_wua, ST_spawn_wua, watershed)

mokelumne_river_instream
# devtools::use_data(mokelumne_river_instream, overwrite = TRUE)

Floodplain

The flow : floodplain area relationship for the Mokelumne River is based on high resolution (4 square foot cell size) two-dimensional hydraulic modeling completed by EBMUD in 2017 (Technical Memorandum in preparation by Robyn Bilski at EBMUD). The extent of this modeling is from River Mile 62.8 to River Mile 64. All area inundated by flows less than or equal to 400 cfs were considered instream. The inundated area per length from this modeled reach was extrapolated to the entire rearing reach in the Mokelumne River from Camanche Dam downstream to the point of tidal influence. This flow : floodplain area relationship was used for all salmon and steelhead runs in the Mokelumne River. The following table contains the flow : floowplain area relationships used in the DSM.

# 'LMR_habitat__s_v2mw_to_MT.xlsx', 'Floodplain (new flows)' tab C21:D26 Camanche to tidal low estimate
# 400 cfs = 0 acres 

mokelumne_river_floodplain <- read_excel('data-raw/instream/mokelumne/LMR_habitat__s_v2mw_to_MT.xlsx', 
                       sheet = 'Floodplain (new flows)', range = 'C21:D26',
                       col_names = c('flow_cfs', 'FR_floodplain_acres')) %>% 
  bind_rows(tibble(flow_cfs = 400, FR_floodplain_acres = 0)) %>% 
  arrange(flow_cfs) %>% 
  mutate(SR_floodplain_acres = FR_floodplain_acres,
         ST_floodplain_acres = FR_floodplain_acres,
         watershed = "Mokelumne River")

mokelumne_river_floodplain
# devtools::use_data(mokelumne_river_floodplain, overwrite = TRUE)


FlowWest/cvpiaHabitat documentation built on Oct. 27, 2020, 2:09 p.m.