Open mkapur-noaa opened 2 years ago
Awesome, thanks -- I think just embedding this perhaps at the top of Chapter 3.4 would make sense.
There are separate species codes for RACE, NORPAC, AKR, and IPHC...and then species group codes... species are defined and aggregated differently within each of these code lists. There is no master list to my knowledge. The AKR has a species translation table but it only includes AKR and NORPAC to my knowledge.
This table has the RACE/Observer codes. NORPAC.ATL_LOV_SPECIES_CODE
And then for the region codes they can be found here: norpac.species_group_codes
For the species codes there are two tables on NORPAC that can do the translations NORPAC.ATL_LOV_SPECIES_CODE and norpac.species_group_codes
The group codes for the foreign catch accounting data are different from those two tables, and as far as I know there isn't a key. I will look into it though.
Here is a SQL script that will connect the 2 for a master table, could probably get a view put up on AKFIN pretty easily.
SELECT norpac.atl_lov_species_group.species_code, norpac.atl_lov_species_group.prohib_species_group_code, norpac.atl_lov_species_group.common_name, norpac.atl_lov_species_group.scientific_name, norpac.atl_lov_species_group.group_code, norpac.atl_lov_species_group.unid_code, norpac.species_group_codes.bsa_group, norpac.species_group_codes.goa_group, norpac.species_group_codes.woc_group FROM norpac.atl_lov_species_group INNER JOIN norpac.species_group_codes ON norpac.atl_lov_species_group.species_code = norpac.species_group_codes.species WHERE norpac.species_group_codes.year = 0 ORDER BY norpac.atl_lov_species_group.species_code
Maybe a simple way to move forward (which could be made fancier in the future) would be to provide either a link or a description of how to access each list of species codes. It would be really nice to be able to look in one place to figure out where to go for these pieces of info.
If this already exists, provide a link, otherwise a table which indicates the codes for given species within each dataset. Might make sense to have this in tandem with the area/stratum codes as a reference for people building SQL queries.