knitr::opts_chunk$set(echo = TRUE)
library(magrittr)
library(mskeyrun)
library(mscatch)
source(here::here("data-raw/R/create_species_rules_table.R"))
options(warn=-1)

Typically, fish that are landed by fishermen are not measured for length. However samples of the landed fish are taken through time by port samplers at the request of the assessment scientist. The size of the samples (the number of fish sampled) and the frequency of the samples change through time for several reasons. As a result some species are more heavily sampled than others. In addition some species are more heavily sampled during certain times of the year. In many cases the lengthed fish are assigned a market category, for example, Large, Small, Jumbo. Other times they are not and are simple considered Unclassified

For many stock assessment models and multispecies models the catch is often required as a composition of lengths. Due to the nature of the sampling program, length samples are not always available at the level the model requires. In this case there are several options. One of them being to "borrow" length samples from adjacent time periods. This assumes that fish caught from one time period to the next have similar size (length) distributions.

Expanding catch to a composition of lengths

Hydra, the multispecies length based model, is the only model that requires this type of data. Currently Hydra incorporates three distinct fleets, a demersal fleet, a pelagic fleet, and a fixed gear fleet. This data product categorizes catch by these three fleet types.

The annual catch (measured in metric tons) for each of the focal species is expanded to a composition of length. The result being that the sum of the catch over all lengths in a given year (or any other time interval) will equal the total catch for that year (or equivalent time interval). Fish are measured in 1 cm increments.

Species rules {#rules}

For each species, a set of rules are applied (similar to the approach taken in a stock assessment), to determine how the landings data and discard data (not currently incorporated) are aggregated based on the availability of length samples. Biomass (metric tons) is then estimated at each LENGTH (1 cm bins) category for a specified time interval, market category, and gear type. The expanded catch is then aggregated to annual time steps and fleets.

To create the data set WITH borrowed length samples:

create_real_fishery_lencomp()

A sample of the output for Atlantic cod is shown below.

mskeyrun::realFisheryLencomp %>%
  dplyr::filter(Code == 164712) %>%
  head(.,10) %>%
  flextable::flextable() %>% 
  flextable::colformat_num(j=c("Code","year"), big.mark = "" , digits=0 )

To create the data set WITHOUT borrowed length samples:

create_real_fishery_lencomp_raw()

A sample of the output for Atlantic cod is shown below.

mskeyrun::realFisheryLencompRaw %>%
  dplyr::filter(Code == 164712) %>%
  head(.,10) %>%
  flextable::flextable() %>% 
  flextable::colformat_num(j=c("Code","year"), big.mark = "" , digits=0 )

Fleet/Gear Types

NEGEAR2 codes observed in the catch data are attributed to one of three fleets. The designation "all" implies all other gear codes. Note that some species are not caught by all three fleets.

tab <- create_species_rules_table1("gearCodes","Fleet","Negear2")
tab

Market Codes

In a similar fashion to fleets, the market codes observed in the catch data are relabelled according to assessment scientist recommendations. The designation "all" implies all other market codes

tab <- create_species_rules_table1("marketCodes","Relablled","Market Codes")
tab

Additional preferences

Additional decision points were considered for each species in accordance with stock scientist recommendations. The following table outlines these decision points:

tab <- create_species_rules_table2()
tab

Length sample availability {.tabset}

The figures shown are generated by the function aggregate_landings from the R package mscatch. Each figure represents the number and frequency of fish lengths taken by port agents in each year, season, market category, gear type (represented as a fleet)

Goosefish

``` {r, echo = F} knitr::include_graphics("figures/11_demersal_length_frequency_table2_GOOSEFISH.png") knitr::include_graphics("figures/11_fixedGear_length_frequency_table2_GOOSEFISH.png")

#### Atlantic Cod
```r
knitr::include_graphics("figures/11_demersal_length_frequency_table2_ATLANTIC_COD.png")
knitr::include_graphics("figures/11_fixedGear_length_frequency_table2_ATLANTIC_COD.png")

Winter flounder

knitr::include_graphics("figures/11_demersal_length_frequency_table2_WINTER_FLOUNDER.png")

Yellowtail flounder

knitr::include_graphics("figures/11_demersal_length_frequency_table2_YELLOWTAIL_FLOUNDER.png")

Haddock

knitr::include_graphics("figures/11_demersal_length_frequency_table2_HADDOCK.png")
knitr::include_graphics("figures/11_fixedGear_length_frequency_table2_HADDOCK.png")

Atlantic herring

knitr::include_graphics("figures/11_pelagic_length_frequency_table2_ATLANTIC_HERRING.png")

Atlantic mackerel

knitr::include_graphics("figures/11_demersal_length_frequency_table2_ATLANTIC_MACKEREL.png")
knitr::include_graphics("figures/11_fixedGear_length_frequency_table2_ATLANTIC_MACKEREL.png")
knitr::include_graphics("figures/11_pelagic_length_frequency_table2_ATLANTIC_MACKEREL.png")

Spiny dogfish

knitr::include_graphics("figures/11_demersal_length_frequency_table2_SPINY_DOGFISH.png")
knitr::include_graphics("figures/11_fixedGear_length_frequency_table2_SPINY_DOGFISH.png")

Winter skate

knitr::include_graphics("figures/11_demersal_length_frequency_table2_WINTER_SKATE.png")

Silver Hake

knitr::include_graphics("figures/11_demersal_length_frequency_table2_SILVER_HAKE.png")


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