knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

To use mscatch you will need to compile two data sets for a specific region of interest, whether a stock area, an ecological production unit, or a larger area:

If you want a sample data set to begin to use mscatch then you can use the function get_sample_data

Length data

Length data (lengths of sampled catch taken by port samplers) can be pulled from the oracle table (stockeff.mv_cf_len) under the stock efficiency initiative or from the annual (cflen, wolen) AA tables. It is then aggregated by YEAR, QTR, GEAR, MARKET_CODE to summarize two data sets

Size of biological samples

This is then merged with the catch data.

Individual fish lengths

The data set should have this form

``` {r lengthsneeds, echo = F, eval = T} sl <- readRDS(here::here("data-raw/data/sampleLengths.RDS")) |> dplyr::select(-tripid) sl

where each row represents the number of fish sampled of a given length in YEAR, QTR, caught using NEGEAR and classed as MARKET_CODE

* LENGTH is the length in cm of sampled fish and 
* NUMLEN is the number of fish of this size sampled 

## Catch data

Landings data can be pulled from the oracle table (`stockeff.mv_cf_landings`) under the stock efficiency initiative or from the annual (cfdet, wodet, woland) AA tables. If pulled from the AA tables, the MARKET_CODE field does not exist. NESPP4 codes will need to be mapped to MARKET_CODE categories outlined `marketCodeLookupTable`. (created from [`comlandr::get_species_itis`](https://noaa-edab.github.io/comlandr/reference/get_species_itis.html))

Some trips will have missing information in the AREA field. These trips will need to be assigned an area using the methods outlined by [@Palmer2008] prior to using `mscatch`. The package [`comlandr`](https://noaa-edab.github.io/comlandr/index.html) replicates these methods.

Trips with missing gear information is handled in `mscatch`. It is assumed that trips with unknown gear information are catching fish with lengths proportional to trips with known gear types.

Discards are not included in this data. At a future date both [`comlandr`](https://noaa-edab.github.io/comlandr/index.html) and the stock efficiency initiative will contain discard estimates using the methods of [@Wigley2020].

The resulting Catch data is then merged with the biological samples to summarize total catch (metric tons) by YEAR, QTR, GEAR, MARKET_CODE, the number of biological samples taken (`landings_nn`), and the total number of fish sampled (`len_totalNumlen`). The data set should have this form:

``` {r catchneeds, echo = F, eval = T}
sc <- readRDS(here::here("data-raw/data/sampleCatch.RDS"))
sc

Use mscatch

Once the above data sets have been assembled they can now be used to aggregate the landings and length samples and then expand the commercial landings data to length distributions using mscatch

References



NOAA-EDAB/neusCatch documentation built on Jan. 23, 2025, 3:29 a.m.