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

gap_products area_id correction #27

Closed
BenWilliams-NOAA opened this issue Jun 16, 2023 · 5 comments
Closed

gap_products area_id correction #27

BenWilliams-NOAA opened this issue Jun 16, 2023 · 5 comments

Comments

@BenWilliams-NOAA
Copy link
Contributor

In the gap_products.area table for the EBS slope there is a duplicate area_id for instance:

survey_definition_id = 78
area_id = 1
type = "STRATUM"
area_name = "all"
description = Bering Sea Slope Survey, All Subareas, Depth Range 200-300 m

survey_definition_id = 78
area_id = 1
type = "SUBAREA"
area_name = "1.0"
description = EBS slope subarea 1: All depths

No other tables entries (that I've looked at) appear to duplicate values. This instance precludes filtering biomass or specimen data on aurvey_definition_id and area_id alone, thus forcing an undesired join with the area table. Any chance of a correction?

@MargaretSiple-NOAA
Copy link
Collaborator

MargaretSiple-NOAA commented Jun 17, 2023 via email

@MargaretSiple-NOAA
Copy link
Collaborator

Never mind! Zack has already looked! He asked me to paste this since he can't log into his GitHub at sea:

Hi Ben,

Thanks for looking at the tables. For the Bering Sea shelf and slope surveys, the definitions and/or shapes of the strata are periodically updated. The “DESIGN_YEAR” field in the GAP_PRODUCTS.AREA table is used to version those changes over the years. That means that there will be duplicate AREA_ID values for a given survey. The GAP_PRODUCTS.SURVEY_DESIGN table tells you which DESIGN_YEAR to use for a given survey and survey year. So, if you wanted all of the spatial records for the Bering Sea slope survey, you want to be filtering for AREA_ID values where DESIGN_YEAR = 2002.

Thanks,

Zack

@BenWilliams-NOAA
Copy link
Contributor Author

Thanks you two. One note though for my clarification.
While reviewing these fields I filtered out anything 2023+ so am skipping the duplicate field during that.
For the EBS slope there are two design years 2000 and 2002 which do have duplicate area_id fields.
Is there a guide where survey_definition_id, design_year and area_id are identified , for example here is what I gather the GOA codes are:

  survey definition 47 = GOA        area_id
    type = "stratum"                10:550
    type = "region"                 99903
    type = "INPFC By Depth"         c(911:914,921:924,931:934,941:944,951:954)
    type = "inpfc"                  seq(919,959,10)
    type = "depth" - all            991:994
    type = "area" - regulatory      803:805

but when I get to the EBS slope there are two survey_definition_id's (78, 98) with the following design years:

   design_year survey_definition_id
       <dbl>                <dbl>
        2022                   78
        2000                   78
        2002                   78
        2022                   98
        2019                   98
        2010                   98
        2002                   98
        1993                   98
        1992                   98

All of the survey_definition_id == 98 appear to be for the shelf except for the design_year == 2002 which has slope subarea in the description (and has the duplicate area_id with survey_definition_id == 78, design_year==2000). Is this correct? and if so I could really use a guide.

@zoyafuso-NOAA
Copy link
Collaborator

Sorry again for the late response. Just got back from survey and post-survey leave.

Ohh, okay I see what you mean. I think the records in GAP_PRODUCTS.AREA where we have survey_definition_id == 98 and design_year == 2002 are erroneously duplicated from records associated with survey_definition_id == 78, design_year==2002. We'll remove those records to avoid confusion. So if you are only interested in Bering Sea Slope records in the GAP_PRODUCTS.AREA, filter records with survey_definition_id == 78, design_year==2002.

A guide for which design year to use for a given survey/year can be found in GAP_PRODUCTS.SURVEY_DESIGN.

@zoyafuso-NOAA
Copy link
Collaborator

The gap_products.area table has been cleaned up to remove duplicates and non-standard areas. Closing the issue here unless anything comes up again.

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