Coder Social home page Coder Social logo

afsc-gap-products / gap_bs_data_report Goto Github PK

View Code? Open in Web Editor NEW
9.0 2.0 2.0 314.75 MB

Reproducible and annotated code for developing the EBS and NBS Annual Data report and presentation.

R 78.94% Lua 20.57% SCSS 0.32% HTML 0.17%
groundfish alaska survey bering-sea noaa-fisheries

gap_bs_data_report's People

Contributors

chrisanderson-noaa avatar emilyhmarkowitz avatar emilymarkowitz-noaa avatar liz-dawson avatar nicolecharriere-noaa avatar sean-rohan-noaa avatar sowasser avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

gap_bs_data_report's Issues

2024 Report/Future wish list

๐Ÿ‘ Prep 2023 Content

  • Clean up local-species-name xlsx to better use the new taxonomic species groupings in gap_products.taxonomic_classification
  • Community: further simplify

๐Ÿ“Ž Formatting

  • Biomass tables within species profiles and Tables in Appendix C not italicizing species names correctly, asterisks still exist around Genus and species.
  • left justify table captions
  • remove *s and italicize all species names within Table captions (species profiles and Appendix C)
  • Migrate to quarto from RMarkdown

๐ŸŸ Species Narratives

...

๐Ÿšข BS Data Report

Notes from reviewers that we'll need to address next round:

  • Figure 2: missing corner station near Unimak (AZ0504) Consider labeling this station
  • General note: NMFS standards dictate that fish common names are lower case (unless it's a proper noun aka Kamchatka) Fix paragraphs in Species Composition and see what NMFS publishing says about the way the names are in there now.
  • pg 12: There's a sentence indicating that ~50 tows per vessel had no net mensuration data, which seemed high (bc it is!). I talked with Duane and these tows had either height or spread (except 3 on the AKK). The current sentence might benefit from some clarity. I suggest adjusting this sentence to indicate that these tows were missing either spread or height data. In the NBS, all tows on the AKK had either height or spread and 1 tow on the NWX had no data. Make sure sentence is fixed
  • pg 14: giant wrymouth has not been seen since 1993 and rarely prior to that year. I don't know if it's entirely relevant to state that this species is whole-hauled when we haven't seen it in 30 years. (select * from racebase.catch where region = 'BS' and species_code = 23792). Make sure giant wrymouth is removed from list
  • Change 3rd paragraph in 'Biomass, Abundance, and Catch per Unit Effort' section accordingly. Stan suggests eliminating these sentences or just concentrating on species that we have confidence that Bottom Trawl can detect with relativle stable efficiency. Many of these increases and decreases are observed just by random chance and it is misleading to provide these kind of numbes when we know that the BT is not design for provide reliable estimates of biomas for many of these species.
    image

๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘ Northern BS Community Highlights

  • New (and improved) photos of species. Maybe comms team has?
  • Obtain correct spellings for local species names from Mabel and from the communities
  • Meet with Gay for feedback

๐ŸŒต Forever backburner

  • develop a way to calculate spp size comp peaks - discuss the number of appropriate peaks, model sensitivity, and model types.
  • Provide all jpgs and pdfs of spp dist on site where they can be downloaded. @ChrisAnderson-NOAA maybe we can work on a webpage thing?
  • Socio-econ integration and collab

Update temperature facet plot

Update plot_temps_facet() for community data report.

Change L700 of plot_temps_facet() to show survey strata instead of default bathymetry.

2023 Report/Future wish list

๐Ÿ‘ Prep 2023 Content

  • Add 2023 survey methods to spreadsheets for target stomachs, otoliths, special projects, etc @liz-dawson-NOAA
  • Remove summary stats text from species profiles that will be replaced by new summary species table @liz-dawson-NOAA
  • Decide if some fish should not have text altogether @liz-dawson-NOAA
  • Community: review text grade level with Flesch-Kincaid tool @NicoleCharriere-NOAA (maybe)
  • Initial review of other text handwritten body paragraphs/sections @liz-dawson-NOAA

๐Ÿ“Ž Formatting

  • Add chapter headers to top of pages
  • Change area units hectares --> km2
  • Biomass tables within species profiles and Tables in Appendix C not italicizing species names correctly, asterisks still exist around Genus and species.
  • One citation within NRS species profile not generating correctly. D. W. Cooper and Nichol. The author names within the citation bib file look correct, so I'm not sure why.
  • Species names within Appendix C Table captions not being assigned correctly (for example Neptunea heros (northern Neptune snail) being assigned to population estimates for every species)
  • 1" margins
  • left justify table captions
  • remove *s and italicize all species names within Table captions (species profiles and Appendix C)
  • Reorder Hoff citation and any other in-text citations with multiple sources that are not chronological
  • add non-breaking spaces between in-text numbers and their units and in text Figures and #s
  • italicize AK Knight in Table 2
  • Tables 14 and 15 lowercase to "Estimated biomass" and "SD biomass", and "Estimated population" and "SD population" in column headers
  • Appendix A-1, add dash between all letter # appendices

๐ŸŸ Species Narratives

  • Possibly replace/automate prefab sentences in the narratives
  • Investigate metric tons vs "tons" issue--as of now Jim wants all mt changed to t (as of 4/28/2023 there all tables within species profiles still have mt still in the caption and column headers).
  • Appendix Table D-7. -- Population estimates...<- dash between D and 7, and spacing around --'s
  • New layout for species narratives
  • Integrate {akgfmaps} new function for plotting rasterplots afsc-gap-products/akgfmaps#28 (comment)

๐Ÿšข BS Data Report

  • Change "Hauls with weights" to Hauls and remove "Hauls with counts", "Hauls with lengths", and only include in one of the CPUE/kg2 or /no tables. -- Will this allow us to use portrait pages of landscape pages??
  • Change table 3 stomach collections to show length bins, not target numbers

๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘ Northern BS Community Highlights

  • New (and improved) photos of species. Maybe comms team has?
  • Obtain correct spellings for local species names from Mabel and from the communities
  • Meet with Gay for feedback
  • Develop feedback form with Duane, Gay, and Comms
  • Print more reports and send to Gay? (Duane question)
  • Should Neptunea heros -> Neptunea sp. (heros and ventricosa)?
  • Should Basket stars be included? (possibly no, we just catch a lot of them)
    @EmilyMarkowitz-NOAA
  • Check mean lines for biomass and abundance time series plots. Missing for sea peach and jellyfish. Should mean =mean(x) or mean(x1:x_{t-1})
  • add Nome, AK to map figures
  • Check Christmas presentation plot, use 2 decimals, center merge cell?

๐ŸŒต Forever backburner

  • develop a way to calculate spp size comp peaks - discuss the number of appropriate peaks, model sensitivity, and model types.
  • Provide all jpgs and pdfs of spp dist on site where they can be downloaded. @ChrisAnderson-NOAA maybe we can work on a webpage thing?
  • Socio-econ integration and collab

2022 Post processing list

  • remove *s and italicize all species names within Table captions (species profiles and Appendix C)
  • Reorder Hoff citation and any other in-text citations with multiple sources that are not chronological

Creating a multi-panel temperature plot with EBS and NBS regions on the same panel

Code for combining temperature from EBS-only years with temperature from EBS+NBS years in the same rasterbrick. Would slot-in around here:
https://github.com/EmilyMarkowitz-NOAA/gap_bs_data_report/blob/861560b2bba6def981309652ba1c64c9a4effa35/code/figtab.Rmd#L579-L593

# Setup for working example 
library(coldpool)
library(akgfmaps)
reg_dat <- akgfmaps::get_base_layers(select.region = "ebs", set.crs = "EPSG:3338")
maxyr <- 2022
yrs <- (maxyr-19):maxyr 

# CODE STARTS HERE #

# Names of EBS layers for years without NBS data
sebs_only <- names(coldpool::ebs_bottom_temperature)[which(!(names(coldpool::ebs_bottom_temperature) %in% paste0("s", names(coldpool::nbs_ebs_bottom_temperature))))]

# Select EBS years to include in rasterbrick and reproject EBS years to the extent and resolution of the EBS+NBS grid
sebs_temp <- raster::subset(coldpool::ebs_bottom_temperature,
                            subset = sebs_only) %>%
  raster::projectRaster(coldpool::nbs_ebs_bottom_temperature)

# Combine EBS and NBS layers into the same rasterbrick
rasterbrick <- raster::addLayer(sebs_temp, coldpool::nbs_ebs_bottom_temperature)

# Remove non-numeric characters from layer names to simplify subsetting based on the year range
names(rasterbrick) <- gsub("[^0-9.-]", "", names(rasterbrick))

# Subset layers for the selected years
rasterbrick <- raster::subset(rasterbrick, subset = paste0("X", yrs))

In the plotting function, remove NA values from the reprojected extent:
https://github.com/EmilyMarkowitz-NOAA/gap_bs_data_report/blob/861560b2bba6def981309652ba1c64c9a4effa35/code/functions.R#L2372-L2375

with:

  temp_df <- temp_df %>% 
    tidyr::pivot_longer(values_to = "value", 
                        names_to = "year", 
                        cols = dplyr::all_of(temp1)) %>%
    tidyr::drop_na(value)

Edits to be made to code/final word document based on RPTS editorial review (Jim Lee)

  • Vessel prefix F/V should be FV (no slash).
  • Be sure to double-check all internal and external links in document --jk kill all hyperlinks minus websites
    • I auto removed hyperlinks! - Em
  • insert 2 page breaks after abstract (one blank page after abstract), then add contents page. "use dot leaders"
  • Arial Narrow for major heading, Arial standard for level 1 headings?
  • Seems unbalanced to have a narrow font as a major heading followed by a bold font as a lesser heading. Perceived heading ranking gets confusing. Liz switched these manually, Arial for Header 1 and Arial Narrow for Header 2
  • change mt to t
  • lowercase i for St. Matthew and St. Lawrence "islands" **I did this throughout code already...pretty sure I got them all.
  • period after Figure X. then -- instead of long -, not bold, 12 pt @EmilyMarkowitz-NOAA
  • Fishing vessels FV Alaska Knight (left) and FV Vesteraalen (right) contracted to assist the 2018 Eastern Bering Sea bottom trawl survey.---Jim wants EBS spelled out in figure captions
  • dates with preceding 0, 0 should be deleted like 03 June, should just be 3 June @EmilyMarkowitz-NOAA
  • Other select species including Pacific halibut, Greenland turbot, large skates, rockfish, Atka mackerel, prowfish, Bering wolffish, giant wrymouth, Pacific cod (add scientific names)
  • Table 5. -- Biological data collected during the 2018 eEastern Bering Sea (EBS) shelf bottom trawl survey.---add full eastern Bering Sea (EBS) name to title (not just acronym)
  • Table 5 lowercase lots of column headers: [x] Length measurements, [x] Otolith age structure measurements, Stomach samples, [x] Pathobiology blood samples @EmilyMarkowitz-NOAA I couldn't figure out where to lowercase "samples" in Stomach samples column
  • Table 9a, lowercase some column headers: Estimated biomass, SD biomass
  • Table 9b, lowercase some column headers: Estimated population, SD population
  • Lang, Richar, and Foy 2019). Lang et al. 2019, et al. when three or more authors @EmilyMarkowitz-NOAA
  • During the coldest years, sea ice extended farther south and lasted later into spring resulting in cold pools that extended farther south through the middle domain into Bristol Bay and near the Alaska Peninsula (Figs. 7a and 7b). Fig. should be changes to Figs.
  • Change all (Figure X) to (Fig. X) and (Figures X and X) to (Figs. X and X)
  • Recent Technical Memorandums
  • Copies of this report and other NOAA Technical Memorandums are available from the National Technical Information Service, 5285 Port Royal Road, Springfield, VA 22167 (web site: www.ntis.gov). Paper and electronic (.pdf) copies vary in price. The recent Technical Memoranda produced by the Alaska Fisheries Science Center can be found at https://www.fisheries.noaa.gov/resource/publication-database/alaska-fisheries-science-center-technical-memorandums.--Not needed in text. This will be on cover materials.
  • Reference Section should be renamed to "Citations"
  • Acknowledgments misspelled (no e between g and m)
  • No italics in citations
  • Rerun Bottom Temperatures of Years Above Long-Term Mean Tempearture plot for 2018 @EmilyMarkowitz-NOAA
  • P/A vs. IDW plots: In all runs, I can only see P/A plots for: Longhead Dab, POP, Sakhalin sole, butterfly sculpin, bigmouth sculpin, Pacific capelin, rainbow smelt, eulachon, shortfin eelpout, and wattled eelpout----were these supposed to be IDW now? @EmilyMarkowitz-NOAA
  • RKC, BKC, snow and tanner crab IDW plots rerun @EmilyMarkowitz-NOAA
  • Yellow Irish lord--Irish was lowercase in species profile IDW caption, when it should be uppercase. I'm unsure where to change this to make it uppercase in future runs of this report @EmilyMarkowitz-NOAA
  • Tables in Appendix should be labled: Appendix Table A1. etc. Just need to add the word "Appendix" in front of Table in the Table Caption @EmilyMarkowitz-NOAA

Errors to fix in 2022 Tech Memo

  • 1" margins
  • left justify table captions
  • Figure captions: Figure should be written out as full word (Figure), not bolded, 12 pt., Arial narrow, space between . and -- The rest looks good ex. Figure 1. -- Sampled survey stations by vessel.....
  • In text Figure/Table citations look good except # should not be bolded.
  • Error in the prefab sentences, number of stations for EBS, NBS and NEBS are all combined (like it's not adding properly for some reason) for example for EBS pollock: Out of the total number of successful hauls (376) walleye pollock were found during 510 hauls (135.6% of stations; Fig. r fig_dist).@EmilyMarkowitz-NOAA
  • In non-reference version of full data report, all figure and table numbers are missing
  • abundance is simply referring to estimated total population size (number of individuals)? Or is it CPUE (#/hectare)?
  • In non-referencing version there are purple-orange sea star info under walleye pollock
  • In referencing version, Turbot prefab sentences were not encountered in NBS but number of station and fork lengths are still populating with numbers.
  • Add number of individuals? Prefab had to tell (ATF had 2 fish but both in same station)
  • In abstract, if else statement to produce the following sentence only if it is within 6 warmest or coldest years isn't working. "The 2022 mean bottom temperatures were the nineteenth warmest observed since the beginning of the EBS shelf bottom trawl survey time series in 1982." @EmilyMarkowitz-NOAA
  • Abstract sentence "The total estimated animal biomass in the NBS increased from 3 million metric tons (t) in 2021 to 3.5 million t in 2022" Seems out of place, like either there should be an EBS counterpart to this sentence first OR it shouldn't exist in the abstract at all.
  • Add line break right before History of Bering Sea Bottom Trawl Surveys section title and right before the Survey Vessels and Sampling Gear section, Additional Research Projects, Ocean Temperatures and the Cold Pool, Selected Fish Species Estimates, Selected Invertebrates Estimates
  • No idea what is going on with the Selected Fish Species Estimates section. It seems that some species are listed multiple times in a row with the exact same figures/tables listed each time (pollock code, bering flounder, greenland turbot)
  • Is Figure 26 is the old version of figures or just looks different due to lower numbers? Axis labels are also overflowing
  • Biomass tables within species profiles and Tables in Appendix C not italicizing species names correctly, asterisks still exist around Genus and species. @EmilyMarkowitz-NOAA
  • One citation within NRS species profile not generating correctly. D. W. Cooper and Nichol. The author names within the citation bib file look correct, so I'm not sure why. @EmilyMarkowitz-NOAA
  • 2018-2021 Tech Memo citations not generating correctly fir example: (Markowitz, Dawson, Charriere, Prohaska, Rohan, Stevenson, et al., 2022b) @EmilyMarkowitz-NOAA
  • Species names within Appendix C Table captions not being assigned correctly (for example Neptunea heros (northern Neptune snail) being assigned to population estimates for every species) @EmilyMarkowitz-NOAA

code not run due to sheet data not being private

this bit is

https://docs.google.com/spreadsheets/d/10Pn3fWkB-Jjcsz4iG7UlR-LXbIVYofy1yHhKkYZhv2M/edit?usp=sharing

googledrive::drive_download(file = googledrive::as_id("10Pn3fWkB-Jjcsz4iG7UlR-LXbIVYofy1yHhKkYZhv2M"),
type = "csv",
overwrite = TRUE,
path = paste0(dir_out_rawdata, "/0_species_local_names"))

error below

source('./code/data.R')
[1] "Load data"
Error in map():
โ„น In index: 1.
Caused by error in .f():
! Client error: (404) Not Found
File not found: 10Pn3fWkB-Jjcsz4iG7UlR-LXbIVYofy1yHhKkYZhv2M.
โ€ข message: File not found: 10Pn3fWkB-Jjcsz4iG7UlR-LXbIVYofy1yHhKkYZhv2M.
โ€ข domain: global
โ€ข reason: notFound
โ€ข location: fileId
โ€ข locationType: parameter
Run rlang::last_trace() to see where the error occurred.
Warning messages:
1: attribute variables are assumed to be spatially constant throughout all geometries
2: attribute variables are assumed to be spatially constant throughout all geometries
3: attribute variables are assumed to be spatially constant throughout all geometries

2022 Report/Future wish list

Data Report

Formatting @EmilyMarkowitz-NOAA

  • Add chapter headers to top of pages
  • Fix bold/italics in table captions
  • Tables in Appendix should be labeled: Appendix Table A1. etc. Just need to add the word "Appendix" in front of Table in the Table caption

Temperature figures @EmilyMarkowitz-NOAA

  • Maps: check that the scale bar is showing the right distance. Use these resources from @sean-rohan-NOAA (feel free to add more) 1 "Center latitude is the lat_0 argument in these old proj4 strings" "scale bar is based on central meridian"
  • Maps: make it so scalebar (if we keep it) only shows in one panel of a multipanel (facet_wrap) plot.
  • Maps: check lat/lon axes (top lat sometimes missing somehow?) and add graticules behind shapefile
  • Maps: Add 2020 to 20 year plot as blank
  • Cold pool area plot: 1) change color scheme to inferno, add grids, add SD?, fix flipped legend
  • See temperature scale actually matches colors used in figure, e.g., missing warm temperatures in Norton Sound.

Species Narratives

  • Make new 20-year BT and CPUE (for pollock and pcod) plot in plot to replace above/below average temperature figure
  • Maps: Add 2020 to 20 year plot as blank
  • Fix/update prefab sentences to be more flexible and informative, and to better cite tables and figures
  • Maps: use geom_contour_fill() with a continuous grid with data.frame coordinates (no longer requiring geom_stars). (actually used geom_sf! - EHM)
  • Make sure all species figures and tables are similarly cited throughout all species narratives
  • Possibly replace/automate prefab sentences in the narratives
  • Investigate metric tons vs "tons" issue
  • Make sure there is consistent sentence structure across figure and table captions. (Srvy vs Survey, etc.)
  • CPUE plots seem to be under-representing catch. e.g., nearly full coverage of pollock, FHS in NBS

Northern BS Community Report @liz-dawson-NOAA and @ChrisAnderson-NOAA

  • New layout for species narratives
  • New (and improved) photos of species. Maybe comms team has?
  • obtain correct spellings for local species names from Mabel and from the communities
  • Meet with Gay for feedback
  • Develop feedback form with Duane, Gay, and Comms
  • Print more reports and send to Gay? (Duane question)
  • Should Neptunea heros -> Neptunea sp. (heros and ventricosa)?
  • Should Basket stars be included? (possibly no, we just catch a lot of them)
    @EmilyMarkowitz-NOAA
  • Check mean lines for biomass and abundance timeseries plots. Missing for seapeach and jellyfish. Should mean =mean(x) or mean(x1:x_{t-1})
  • add Nome, AK to map figures
  • Check Christmas presentation plot, use 2 decimals, center merge cell?
  • check when "relative abundance" is actually "biomass" -- > Use "number/weight CPUE"

Beyond report:

  • provide all jpgs and pdfs of spp dist on site where they can be downloaded. @ChrisAnderson-NOAA maybe we can work on a webpage thing?

Forever backburner

  • develop a way to calculate spp size comp peaks - discuss number of appropriate peaks, model sensitivity, and model types.
  • change all mentions of hectare to km^2

2022 Improvements to report from reviewer comments from 2018, 2019, and 2021 reports

  • Comment from Sean in 2018 Report: For next year we may consider adding contour maps with: A useful threshold for plotting deviations from average is years where bottom temperature anomalies are > 1 standard deviation away from the mean. Above and below average tends to retain some pretty close-to-average years. This way average-ish years, such as 2017, won't get lumped into the above or below average category.
  • Figure out citation issue, where repeat same author shows up as -- instead of author names/initials.

Adding 'No survey' label to multi-panel plots for 2020

EDIT: Accidentally pasted my code twice instead of code + link.

Here's an option for adding a 'No Survey' label for a 2020 multi-panel plot.

Current code
https://github.com/EmilyMarkowitz-NOAA/gap_bs_data_report/blob/861560b2bba6def981309652ba1c64c9a4effa35/code/functions.R#L2377-L2403

Proposed replacement:

panel_extent <- data.frame(reg_dat$plot.boundary)

panel_extent <- data.frame(x = panel_extent$x[c(1,2,2,1,1)],
                                   y = panel_extent$y[c(1,1,2,2,1)],
                                   year = 2020)

  label_2020 <- data.frame(x = mean(panel_extent$x),
                           y = mean(panel_extent$y),
                           label = "No\nSurvey",
                           year = 2020)
  
  figure <- ggplot() +
    ggplot2::geom_sf(data = reg_dat$akland,
                     color = NA,
                     fill = "grey50")+  
    ggplot2::geom_sf(data = reg_dat$graticule,
                     color = "grey80",
                     alpha = 0.2) +
    ggplot2::geom_tile(data = temp_df, 
                       mapping = aes(x=x, y=y, 
                                     fill=cut(value, breaks = colorbar_breaks)))  +
    geom_polygon(data = panel_extent,
                 aes(x = x,
                     y = y),
                 fill = "white") +
    geom_label(data = label_2020,
               aes(x = x,
                   y = y,
                   label = label),
               label.size = NA) +
    ggplot2::facet_wrap( ~ year, 
                         nrow = row0) +
    # coord_equal() +
    ggplot2::scale_fill_manual(values = fig_palette) +
    # ggplot2::geom_sf(data = reg_dat$survey.strata,
    #         color = "grey50",
    #         size = 0.1,
    #         # alpha = 0,
    #         fill = NA) +
    ggplot2::scale_y_continuous(name = "", #"Latitude", 
                                limits = reg_dat$plot.boundary$y, # c(557292.9, 1744114.2), #1804888.0), #reg_dat$plot.boundary$y,
                                breaks = reg_dat$lat.breaks) +
    ggplot2::scale_x_continuous(name = "", #"Longitude", 
                                limits = reg_dat$plot.boundary$x,
                                breaks = reg_dat$lon.breaks) 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.