Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update OFL, ABC, and TAC #50

Open
abby-jahn opened this issue Aug 29, 2024 · 4 comments
Open

Update OFL, ABC, and TAC #50

abby-jahn opened this issue Aug 29, 2024 · 4 comments
Assignees

Comments

@abby-jahn
Copy link

abby-jahn commented Aug 29, 2024

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
Copy link

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
Copy link
Contributor

here is R query code for the first server:

q_specs <- function(year, species, area, db, print_sql=FALSE, save=TRUE) {

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
Copy link

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
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants