knitr::opts_chunk$set(echo = TRUE)
library(magrittr)
library(mskeyrun)
source(here::here("data-raw/R/capitalize_first_letter.R"))
source(here::here("data-raw/R/plot_stock_areas.R"))

Focal species {#focal}

focalSpecies %>%
  dplyr::select(LongName,SCIENTIFIC_NAME,SPECIES_ITIS) %>%
  dplyr::filter(!(LongName == "Pollock")) %>%
  dplyr::rename(Common_Name = LongName) %>%
  dplyr::mutate(SCIENTIFIC_NAME = capitalize_first_letter(SCIENTIFIC_NAME)) %>% 
  dplyr::distinct() %>%
  flextable::flextable() %>%
  flextable::autofit()

Stock areas

Numbered Statistical areas define the stock area used in an assessment. Overlaid in red denotes the statistical areas used to pull catch data for the Georges Bank region.

Length sample data are also pulled from the GB region. For stocks that are transient on Georges Bank (Herring, Mackerel, Spiny dogfish, Winter skate, Goosefish) length samples are used from the whole shelf.

options(warn = -1)
crs <- 4326
coast <- sf::st_read(here::here("data-raw/gis/NES_LME_coast.shp"), quiet = T) %>%
  sf::st_transform(.,crs=crs)

suppressMessages(sf::sf_use_s2(FALSE))

statareas <- NEFSCspatial::Statistical_Areas_2010  %>%
  sf::st_transform(.,crs=crs)
centroids <- sf::st_coordinates(sf::st_centroid(statareas))
statareas <- cbind(statareas,centroids)

# GB footprint
GB <-  sf::st_read(here::here("data-raw/gis/GB_SOE_strata.shp"),quiet=T) %>%
    sf::st_transform(.,crs=crs) 

species <- data.frame(itis = c("172909","172414","161722","164744","172905","172905","164712","160617","564145","164791","164791","164499"),stock = c(NA,NA,NA,NA,"GB","SNEMA",NA,NA,NA,"North","South",NA))

Atlantic cod

itis <- 164712
speciesRules <- mscatch::get_species_object(itis,stock = NA)
speciesKeyrun <- mscatch::get_species_object_mskeyrun(itis)
p <- plot_stock_areas(coast,statareas,GB,speciesRules$statStockArea,speciesKeyrun$statStockArea)
print(p)

Atlantic Herring

itis <- 161722
speciesRules <- mscatch::get_species_object(itis,stock = NA)
speciesKeyrun <- mscatch::get_species_object_mskeyrun(itis)
p <- plot_stock_areas(coast,statareas,GB,speciesRules$statStockArea,speciesKeyrun$statStockArea)
print(p)

Atlantic Mackerel

itis <- 172414
speciesRules <- mscatch::get_species_object(itis,stock = NA)
speciesKeyrun <- mscatch::get_species_object_mskeyrun(itis)
p <- plot_stock_areas(coast,statareas,GB,speciesRules$statStockArea,speciesKeyrun$statStockArea)
print(p)

Haddock

itis <- 164744
speciesRules <- mscatch::get_species_object(itis,stock = NA)
speciesKeyrun <- mscatch::get_species_object_mskeyrun(itis)
p <- plot_stock_areas(coast,statareas,GB,speciesRules$statStockArea,speciesKeyrun$statStockArea)
print(p)

Goosefish

itis <- 164499
speciesRules <- mscatch::get_species_object(itis,stock = NA)
speciesKeyrun <- mscatch::get_species_object_mskeyrun(itis)
p <- plot_stock_areas(coast,statareas,GB,speciesRules$statStockArea,speciesKeyrun$statStockArea)
print(p)

Winter flounder

Winter Flounder comprises two stocks; a Georges Bank stock (Eastern portion of Georges Bank) and a Southen New England stock. The boundary between the two lies through the center of Georges Bank (longitudanally)

itis <- 172905
speciesRules <- mscatch::get_species_object(itis,stock = "GB")
speciesKeyrun <- mscatch::get_species_object_mskeyrun(itis)

speciesRulesSNEMA <- mscatch::get_species_object(itis,stock = "SNEMA")
areasSNEMA <- statareas %>%
  dplyr::filter(Id %in% speciesRulesSNEMA$statStockArea)

p <- plot_stock_areas(coast,statareas,GB,speciesRules$statStockArea,speciesKeyrun$statStockArea,
                      addAreas = areasSNEMA)
print(p)

Yellowtail flounder

itis <- 172909
speciesRules <- mscatch::get_species_object(itis,stock = NA)
speciesKeyrun <- mscatch::get_species_object_mskeyrun(itis)
p <- plot_stock_areas(coast,statareas,GB,speciesRules$statStockArea,speciesKeyrun$statStockArea)
print(p)

Silver hake

Silver Hake comprises two stocks; a northern and southern stock. The boundary between the two lies through the center of Georges Bank (latitudinally)

itis <- 164791
speciesRules <- mscatch::get_species_object(itis,stock = "North")
speciesKeyrun <- mscatch::get_species_object_mskeyrun(itis)

# Additional stock area
speciesRulesS <- mscatch::get_species_object(itis,stock = "South")
areasS <- statareas %>% 
    dplyr::filter(Id %in% speciesRulesS$statStockArea)

p <- plot_stock_areas(coast,statareas,GB,speciesRules$statStockArea,speciesKeyrun$statStockArea,addAreas = areasS)


print(p)

Spiny dogfish

itis <- 160617
speciesRules <- mscatch::get_species_object(itis,stock = NA)
speciesKeyrun <- mscatch::get_species_object_mskeyrun(itis)
p <- plot_stock_areas(coast,statareas,GB,speciesRules$statStockArea,speciesKeyrun$statStockArea)
print(p)

Winter skate

itis <- 564145
speciesRules <- mscatch::get_species_object(itis,stock = NA)
speciesKeyrun <- mscatch::get_species_object_mskeyrun(itis)
p <- plot_stock_areas(coast,statareas,GB,speciesRules$statStockArea,speciesKeyrun$statStockArea)
print(p)

options(warn = 0)


NOAA-EDAB/ms-keyrun documentation built on April 20, 2024, 10:07 a.m.