knitr::opts_chunk$set( collapse = TRUE, comment = "#>" ) library(magrittr)
Need to deal with discards in a similar fashion. It seems that Susan Wigley has a SAS script that most/some stock assessment scientists use to help with this. Edit: Spoke to Susan Wigley she says that they will have all of the discard estimates over time for all of the species in a database similar to that of the landings, length, age databases. This will make life heck of a lot simpler for us.
Discards tracked in observer database from 1989. However spotty coverage (mostly from otter trawls) until 2005
Non US landings need to be integrated also.
This is the database that the population dynamics (Pop Dy) branch use for their stock assessments.
Access to the GUI is on network drive (net)
The DOCUMENTATION is also on the network drive
Confluence page for Stock Efficiency
The landing portion are stored in the Stockeff.MV_cf_Landings materialized view. (This is equivalent to AA Trip and AA Species tables joined). Each record represents trip and species data for a specific landed species. A trip will appear as many times as there are landed species in that trip
STOCKEFF.MV_CF_LANDINGS - (WOLANDT/S,WODET/S, CFDETT/S tables combined)
STOCKEFF.MV_CF_AGE - (WOAGE, CFAGE AA tables combined)
STOCKEFF.MV_CF_LEN (WOLEN, CFLEN AA tables combined)
CFDBS.CFSPP (MKTCAT, MKTNM)
In the database there are:
Pop Dy branch will assign these records to areas based on the species of interest. Of course this means that a trip could be assigned to several different areas depending on the species of interest. The algorithm for assigning the area is run "behind the scenes" when a scientist using the web GUI makes a request for data. Methodology by Mike Palmer
21,227,636 records (60%) where GIS_LAT, GIS_LON is null
1,952,157 records (5%) where LAT, LON are null
Use link field as the unique identifier
There is a TENMSQ field but only included from 1994+
Allocation rules:
All trips WITH missing AREA (='000') need to be assigned to an AREA
If most of the GIS_LAT and GIS_LON fields contain valid entries we can allocate these TRIPS to any area of interest
For those that do not (84%) we will need to allocate these trips to the area of interest based on the statistical AREA they fished.
If trip are in an AREA that is entirely within the area of interest, we can allocate
Otherwise the AREA straddles the area of interest. We will need to look at all trips already in associated with that AREA and allocate based on most similar trips. Proceed in a similar fashion to how Sean Lucey allocates trips to missing AREA
Simplified to categories based on the species
eg Cod -> "UN", "LG", "MK", "SK"
All market category descriptions are unique to each species. eg. Mackerel (NESPP3='212', ITIS = 172414)
channel <- dbutils::connect_to_database(server,username) table <- comlandr::get_species_itis(channel,species=172414)
vs Cod (NESPP3 = '081', ITIS = 164712)
channel <- dbutils::connect_to_database(server,username) table <- comlandr::get_species_itis(channel,species=164712)
Insignificant amount of missing species info (NULL, '000' or, '999') Most assessments start in either 1982 (rec fishing data starts) or 1989 (discard data starts). Often discards are back calculated in some way from 1982-1988 when needed.
``` {r specieslookup, echo=F,eval=T} knitr::kable(mscatch::speciesLookupTable)
## Market Code Lookup Table ``` {r itis} DT::datatable(mscatch::marketCodeLookupTable %>% dplyr::distinct(), rownames=F, options=list(pageLength=15, order=list(list(0,"asc"))))
How deal with missing gear info? How much is there ?
Some months = 00 but have landings data. what do with them?
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.