sample_fishery_totcatch: Sample a fishery catch index from an atlantis scenario

View source: R/sample_fishery_totcatch.R

sample_fishery_totcatchR Documentation

Sample a fishery catch index from an atlantis scenario

Description

The function takes total catch data from an Atlantis scenario where the data was read in from Atlantis output using load_catch function or from the load_nc_catchtons function. One does not need to use these functions to create dat, rather you must only ensure that the structure of dat is the same.

Usage

sample_fishery_totcatch(dat, cv)

Arguments

dat

A data.frame of numbers at age containing the following columns:

  • species

  • agecl

  • polygon

  • layer

  • time

  • atoutput

The data.frame is generated from either create_survey or create_fishery_subset.

cv

Coefficient of variation for the entire species specific catch a matrix with columns: species, cv

Details

If a total catch time series is input from load_catch, this function simply creates an observed total catch time series from total catch input using by applying a user-specified cv. If catch by polygon and timestep is input from load_nc_catchtons followed by create_fishery_subset, then catches are aggregated over polygons and the subannual timesteps are retained. Fleet specific catch can be created by selecting a subset of fleets as input to create_fishery_subset. Either way, the result is a coastwide catch (tons) estimate in tons from the fishery.

Value

The standard dataframe as specified used in dat.

Author(s)

Poseidon

Examples

d <- system.file("extdata", "SETAS_Example", package = "atlantisom")
groups <- c("Pisciv_T_Fish","Pisciv_S_Fish")
file <- "outputsCatch.txt"
fgs <- load_fgs(dir = d, "Functional_groups.csv")
truetotcatch <- load_catch(dir = d, fgs = fgs, file_catch = file)
groupcatch <- truetotcatch[truetotcatch$species %in% groups, ]
cv <- data.frame(species=groups, cv=c(0.2,0.3))
fishObsCatch <- sample_fishery_totcatch(dat=groupcatch,cv=cv)

r4atlantis/atlantisom documentation built on Nov. 12, 2023, 2:59 a.m.