Open abby-jahn opened 3 months ago
Currently one can select from akr.v_cas_tac on AKFIN or akfish_cas2.v_cas_tac on AKR's servers to get harvest specs 2007-present. We are currently working to harmonize area and stock naming conventions and extend the time series back to the 1970s, with the end goal being a single table that anyone can pull specs for their stock, and that table will get updated after specs are set.
here is R query code for the first server: https://github.com/afsc-assessments/afscdata/blob/3f41c2c1b714b1f3ad4bde019c0f18c743cce5d5/R/queries.R#L1420
example:
library(afscdata)
library(dplyr)
db <- connect() # if you setup keyring this will just work https://afsc-assessments.github.io/afscdata/articles/getting-started.html
# globals
year <- 2024
species <- 'PCOD'
area <- 'goa'
# query data
df <- q_specs(year=year, species=species, area=area, db=db, save=F)
distinct(df, area_label)
# pull out all of goa
df %>%
dplyr::filter(area_label=='GOA') %>%
dplyr::glimpse()
# by region
df %>%
dplyr::filter(area_label=='W') %>%
dplyr::glimpse()
df %>%
dplyr::filter(area_label=='C') %>%
dplyr::glimpse()
df %>%
dplyr::filter(area_label=='E') %>%
dplyr::glimpse()
# globals
area <- 'bsai'
# query data
df <- q_specs(year=year, species=species, area=area, db=db, save=F)
distinct(df, area_label)
# pull out aleutians
df %>%
dplyr::filter(area_label=='AI') %>%
dplyr::glimpse()
# bering sea
df %>%
dplyr::filter(area_label=='BS') %>%
dplyr::glimpse()
# both
df %>%
dplyr::filter(!(area_label %in% c('AI', 'BS'))) %>%
dplyr::glimpse()
If you want all of BSAI or GOA I would use fmp_area_code rather than area_label. There are a lot of inconsistently labeled areas between stocks.
the function pulls fmp_area_code
but the sub areas are often needed, so up to the user to dig through
Regional office staff works with AFKIN to update OFL, ABC, and TAC post December Council meeting.