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

Future Data Improvements

[Future data improvement bullets]

Instream Spawning and Rearing Habiat

Data Source: FWS and 2008 FERC relicensing of DeSabla

Instream spawning and rearing habitat for [Fall Run Chinook Salmon and Steelhead] in the Butte Creek is based on data from [data source description]. The [data source] instream spawning and rearing habitat data was provided in a spreadsheet (see '.xlsx link to spreadsheet'). Mark Gard instructed us to use cells A3:B33 for spring run spawning Above Centerville Powerhouse Segment (6.5 mi) and cells A38:B68 for the reach Below Centerville Powerhouse Segment.

Units are in square feet.

Adult trout data used for steelhead

Rearing habitat is inn the same sheet in cells A71:D101. Units are square feet per 1000 ft.

# above_centerville <- read_excel('data-raw/mark_gard_data/IFIMWUA.xlsx', 
#                                 range = "A3:B33", sheet = 'Butte') 
# below_centerville <- read_excel('data-raw/mark_gard_data/IFIMWUA.xlsx', 
#                                 range = "A38:B68", sheet = 'Butte') 
# 
# spawn <- bind_rows(above_centerville, below_centerville) %>% 
#   group_by(Flow) %>% 
#   summarise(SR_spawn_wua = sum(Spawning)/(6.5 + 9)/5.28) %>% 
#   ungroup()
# 
# rear <- read_excel('data-raw/mark_gard_data/IFIMWUA.xlsx', 
#                    range = "A71:D101", sheet = 'Butte') 
# 
# butte_creek_instream <- spawn %>% 
#   full_join(rear) %>% 
#   mutate(FR_spawn_wua = SR_spawn_wua, watershed = 'Butte Creek') %>% 
#   select(flow_cfs = Flow, FR_spawn_wua, FR_fry_wua = `Fry Rearing`, 
#          FR_juv_wua = `Juv Rearing`, ST_adult_wua = `adult trout`, 
#          watershed)
# 
# butte_creek_instream
# devtools::use_data(butte_creek_instream, overwrite = TRUE)

Spawning WUA

[description]

Spawning WUA Plot

The following plot shows the weighted usable spawning area in square feet per thousand feet of river for Fall Run Chinook Salmon. These area per length rates are multiplied by the total spawning reach length mapped by the SIT.

``` {r,echo=FALSE} butte_creek_instream %>% filter(!is.na(FR_spawn_wua)) %>% ggplot(aes(x = flow_cfs , y = FR_spawn_wua)) + geom_line(color = '#7570b3') + labs(x = 'Flow (cfs)', y = 'WUA (sqft/1000ft)') + theme_minimal()

### Rearing WUA
The fry and juvenile instream rearing habitat weighted usable areas for Fall Run Chinook Salmon in the Butte Creek provided by Mark Gard (see '~/cvpiaHabitat/data-raw/mark_gard_data/IFIMWUA.xlsx'). 

#### Rearing WUA Plot

The following plot shows the weighted usable rearing area in square feet per thousand feet of river for Fall Run Chinook Salmon fry and juvenile. These rates are multiplied by the total rearing reach length mapped by the SIT. 
``` {r,echo=FALSE}
butte_creek_instream %>% 
  gather(Lifestage, wua, -flow_cfs, -watershed)  %>% 
  filter(!is.na(wua), Lifestage != 'FR_spawn_wua', Lifestage != 'ST_adult_wua') %>%
  mutate(Lifestage = ifelse(Lifestage == 'FR_fry_wua', 'Fry', 'Juvenile')) %>% 
  ggplot(aes(x = flow_cfs , y = wua, color = Lifestage)) +
  geom_line() +
  labs(x = 'Flow (cfs)', y = 'WUA (sqft/1000ft)') +
  theme_minimal() + 
  scale_color_manual(values = c('#d95f02','#7570b3'))


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