afsc-assessments / afscdata

An R package for data extraction of AFSC survey and fishery data
https://afsc-assessments.github.io/afscdata/
Other
2 stars 0 forks source link

Update OFL, ABC, and TAC #50

Open abby-jahn opened 3 months ago

abby-jahn commented 3 months ago

Regional office staff works with AFKIN to update OFL, ABC, and TAC post December Council meeting.

  1. Review OFL, ABC, TAC and finalize with Council
  2. Update CAS table
  3. Update AKFIN table
  4. Run specifications code to output new base table in final harvest specs publication (https://github.com/abby-jahn/harvestspecs)
MattCallahan-NOAA commented 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.

BenWilliams-NOAA commented 3 months ago

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()
MattCallahan-NOAA commented 3 months ago

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.

BenWilliams-NOAA commented 3 months ago

the function pulls fmp_area_code but the sub areas are often needed, so up to the user to dig through