diff --git a/.gitignore b/.gitignore index 4064bfd..d4d51f9 100644 --- a/.gitignore +++ b/.gitignore @@ -50,3 +50,4 @@ vignettes/*.pdf /Presentation/ /output/ *.tiff +/plots/cpchange \ No newline at end of file diff --git a/0_update_cold_pool_index.Rmd b/0_update_cold_pool_index.Rmd index 4034966..1330b32 100644 --- a/0_update_cold_pool_index.Rmd +++ b/0_update_cold_pool_index.Rmd @@ -231,7 +231,7 @@ if(update_sysdata) { file_name_contains = "ste_", file_type = ".tif") - cpa_pre2021 <- coldpool:::cpa_pre2021 + cpa_pre2021 <- read.csv(file = here::here("inst", "extdata", "old_method_cpa_temperature_2021.csv")) ebs_proj_crs <- coldpool:::ebs_proj_crs cold_pool_index <- output_df diff --git a/1_cold_pool_index.Rmd b/1_cold_pool_index.Rmd index c5b19e0..77a8e87 100644 --- a/1_cold_pool_index.Rmd +++ b/1_cold_pool_index.Rmd @@ -609,6 +609,74 @@ print(plot_sebs_average_temperature) dev.off() ``` +```{r zscore_temperature} +cp_summary <- dplyr::bind_rows( + dplyr::mutate(cold_pool_index, + diff = MEAN_GEAR_TEMPERATURE - mean(MEAN_GEAR_TEMPERATURE)) |> + dplyr::mutate(sign = sign(diff), + z = diff/sd(MEAN_GEAR_TEMPERATURE)) |> + dplyr::inner_join(data.frame(sign = c(-1,1), + symbol = c("-","+"), + col = c(1,2))) |> + dplyr::select(YEAR, diff, symbol, z, col) |> + dplyr::mutate(var = "Bottom temperature"), + dplyr::mutate(cold_pool_index, + diff = MEAN_SURFACE_TEMPERATURE - mean(MEAN_SURFACE_TEMPERATURE)) |> + dplyr::mutate(sign = sign(diff), + z = diff/sd(MEAN_SURFACE_TEMPERATURE)) |> + dplyr::inner_join(data.frame(sign = c(-1,1), + symbol = c("-","+"), + col = c(1,2))) |> + dplyr::select(YEAR, diff, symbol, z, col) |> + dplyr::mutate(var = "Sea surface temperature"), + dplyr::mutate(cold_pool_index, + diff = AREA_LTE2_KM2 - mean(AREA_LTE2_KM2)) |> + dplyr::mutate(sign = sign(diff), + z = diff/sd(AREA_LTE2_KM2)) |> + dplyr::inner_join(data.frame(sign = c(-1,1), + symbol = c("-","+"), + col = c(2,1))) |> + dplyr::select(YEAR, diff, symbol, z, col) |> + dplyr::mutate(var = "Cold pool area")) |> + dplyr::mutate(group = YEAR < 2020, + var = factor(cp_summary$var, + levels = c("Bottom temperature", + "Sea surface temperature", + "Cold pool area"))) + +zscore_plot <- ggplot(data = cp_summary, + aes(x = YEAR, + y = z, + group = group)) + + geom_hline(yintercept = c(0), linetype = 1) + + geom_hline(yintercept = c(-1,1), linetype = 2) + + geom_hline(yintercept = c(-2,2), linetype = 3) + + geom_point() + + geom_line() + + geom_text(data = cp_summary, + aes(x = YEAR, y = 2.5, label = symbol, color = factor(col))) + + facet_wrap(~var, nrow = 3) + + scale_x_continuous(name = "Year") + + scale_y_continuous(name = "Anomaly") + + scale_color_manual(values = c("blue", "red")) + + theme_bw() + + theme(axis.text = element_text(color = "black"), + axis.ticks = element_line(color = "black"), + panel.border = element_rect(color = "black", fill = NA), + panel.background = element_rect(color = "black", fill = NA), + strip.text = element_text(size = 9, + color = "white", + face = "bold", + margin = margin(0.5, 0, 0.5, 0, "mm")), + strip.background = element_rect(fill = "#0055a4", + color = NA), + legend.position = "none") + +png(file = here::here("plots", paste0(max_year, "_anomaly.png")), width = 6, height = 6, units = "in", res = fig_res) +print(zscore_plot) +dev.off() +``` + Contributed by Sean Rohan^1^ and Lewis Barnett^1^ ^1^ Resource Assessment and Conservation Engineering Division, Alaska Fisheries Science Center, National Marine Fisheries Service, NOAA **Contact**: sean.rohan@noaa.gov diff --git a/DESCRIPTION b/DESCRIPTION index f9c37c0..88fdc67 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: coldpool Type: Package Title: Generate GAP's EBS temperature products -Version: 1.3 +Version: 1.4 Authors@R: c(person("Sean", "Rohan", email = "sean.rohan@noaa.gov", role = c("aut", "cre")), person("Lewis", "Barnett", email = "lewis.barnett@noaa.gov", role = c("aut", "ctb")), person("Emily", "Markowitz", role = c("ctb"))) diff --git a/NAMESPACE b/NAMESPACE index c9a8dec..d5117c3 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -3,6 +3,7 @@ export(cold_pool_index) export(compare_cpa_station_filter) export(cpa_from_raster) +export(cpa_pre2021) export(ebs_bottom_temperature) export(ebs_proj_crs) export(ebs_surface_temperature) diff --git a/R/data.R b/R/data.R index 685388b..c3eccf8 100644 --- a/R/data.R +++ b/R/data.R @@ -35,21 +35,29 @@ #' Historical cold pool area calculations (cpa_pre2021) #' -#' Historical temperature cold pool and temperature band areas that were calculated prior to 2021 by Bob Lauth and Lyle Britt. Historical cold pool calculations were conducted in ArcGIS and used inverse distance weighting with a maximum of four nearest neighbor points for interpolation (search radius nmax = 4) and weighting function power equal to 2 (i.e., idp = 2). Default ArcGIS settings were used to generate rasters cells for interpolation (cell dimensions equal to the smaller horizontal or vertical dimension divided by 250). Protocols for including stations for interpolation varied among years but it was intended for all standard survey grid stations from the EBS survey to be included. In some years, it is possible that near-shore stations or red king crab resample stations were included in the calculations. Rasters were converted to polygon shapefiles and areas were calculated from polygons. The CRS used in ArcGIS .mxd files was North American Datum 1983 / Albers Equal Area Alaska (EPSG:3338) +#' Historical temperature cold pool area (AREA_SUM_KM2_LTE2) and other temperature isotherm (AREA_KM2_MINUS1, AREA_KM2_0, AREA_KM2_1, AREA_KM2_2, AREA_KM2_LTE0, AREA_KM2_LTE1) areas that were calculated prior to 2021 by Bob Lauth, Lyle Britt, Dan Nichol, and Rebecca Haehn. These calculations were obtained from raster surfaces generated using ArcMap by interpolating temperatures using inverse distance weighting with a maximum of four nearest neighbor points for interpolation (search radius nmax = 4) and weighting function power equal to 2 (i.e., idp = 2). Default ArcGIS settings were used to generate rasters cells for interpolation (cell dimensions equal to the smaller horizontal or vertical dimension divided by 250). Protocols for including stations for interpolation varied among years but it was intended for all standard survey grid stations from the EBS survey to be included. In some years, it is possible that near-shore stations or red king crab resample stations were included in the calculations. Rasters were converted to polygon shapefiles and areas were calculated from polygons. The CRS used in ArcGIS .mxd files was North American Datum 1983 / Albers Equal Area Alaska (EPSG:3338). Historical weighted average temperature data products (AVGBSBT_PLUSNW, AVGBSST_PLUSNW, AVGBSBT_STANDARD, AVGBSST_STANDARD, AVGBSBT_NBS, AVGBSST_NBS, AVGBSBT_LT100M, AVGBSST_LT100M) were calculated by weighting temperature observations from survey stations in proportion to the area of the stratum where they were collected relative to the total survey area. Historical mean temperature for stations at bottom depths < 100 m (AVGBSBT_LT100M, AVGBSST_LT100M) were calculated by averaging temperature observations from samples collected at bottom depths < 100 m. #' -#' @format A data frame with 38 rows and 9 columns: +#' @format A data frame with 39 rows and 16 columns: #' \describe{ #' \item{YEAR}{Year} -#' \item{AVG_STRATA_WEIGHTED_BOTTEMP_STD_AREA}{Mean bottom temperature by stratum, weighted by stratum area, in square kilometers} #' \item{AREA_KM2_MINUS1}{Area with bottom temperatures less than -1 celsius, in square kilometers} #' \item{AREA_KM2_0}{Area with bottom temperatures between -1 and 0 celsius, in square kilometers} #' \item{AREA_KM2_1}{Area with bottom temperatures between 0 and 1 celsius, in square kilometers} #' \item{AREA_KM2_2}{Area with bottom temperatures between 1 and 2 celsius, in square kilometers} #' \item{AREA_SUM_KM2_LTE2}{Cold Pool Index. Total area with bottom temperatures less than or equal to 2 celsius, in square kilometers} #' \item{AREA_KM2_LTE1}{Total area with bottom temperatures less than or equal to 1 celsius, in square kilometers} -#' \item{AREA_KM2_LTE0}{Total area with bottom temperatures less than or equal to 0 celsius, in square kilometers} +#' \item{AREA_KM2_LTE0}{Total area with bottom temperatures less than or equal to 0 celsius, in square kilometers} +#' \item{AVGBSBT_PLUSNW}{Stratum-area weighted mean bottom temperature for EBS shelf standard and plusNW survey strata} +#' \item{AVGBSST_PLUSNW}{Stratum-area weighted mean sea surface temperature for EBS shelf standard and plusNW survey strata} +#' \item{AVGBSBT_STANDARD}{Stratum-area weighted mean bottom temperature for EBS shelf standard survey strata} +#' \item{AVGBSST_STANDARD}{Stratum-area weighted mean sea surface temperature for EBS shelf standard survey strata} +#' \item{AVGBSBT_NBS}{Stratum-area weighted mean bottom temperature for the NBS} +#' \item{AVGBSST_NBS}{Stratum-area weighted mean sea surface temperature for the NBS} +#' \item{AVGBSBT_LT100M}{Mean bottom temperature for EBS shelf stations at bottom depths < 100 m} +#' \item{AVGBSST_LT100M}{Mean sea surface temperature for EBS shelf stations at bottom depths < 100 m} #' } #' @source \url{https://www.fisheries.noaa.gov/contact/groundfish-assessment-program} +#' @export "cpa_pre2021" #' CRS for eastern Bering Sea cold pool index diff --git a/R/figs.R b/R/figs.R index 88fa67a..13150b4 100644 --- a/R/figs.R +++ b/R/figs.R @@ -28,7 +28,8 @@ plot_stn_doy <- function() { dplyr::summarise()) %>% dplyr::inner_join(haul_dat %>% dplyr::group_by(STATIONID) %>% - dplyr::summarise(MEAN_DOY = mean(DOY))) + dplyr::summarise(MEAN_DOY = mean(DOY), + MEAN_DEPTH = mean(BOTTOM_DEPTH, na.rm = TRUE))) # Define plot exent (through trial end error) panel_extent <- data.frame(x = c(-1326559.21, -87636.05), @@ -113,8 +114,84 @@ plot_stn_doy <- function() { legend.position = "right", legend.background = element_blank()) + doy_for_tm <- ggplot() + + geom_sf(data = ebs_layers$akland, + fill = "grey70", + color = "black") + + geom_sf(data = start_df, + aes(fill = MEAN_DOY)) + + geom_sf_text(data = start_df, + aes(label = round(MEAN_DOY))) + + ggplot2::geom_sf(data = agg_stratum, + fill = NA, + color = "black", + size = rel(1.1)) + + shadowtext::geom_shadowtext(data = data.frame(agg_stratum = sf::st_centroid(agg_stratum)$agg_stratum, # Centroid of aggregate stratum polygons + x = sf::st_coordinates(sf::st_centroid(agg_stratum))[,1], # Coordinates of centroid of aggregate stratum polygons + y = sf::st_coordinates(sf::st_centroid(agg_stratum))[,2]),# Coordinates of centroid of aggregate stratum polygons + aes(x = x, + y = y, + label = agg_stratum), + size = rel(4.5), + color = "black", + bg.color = "white") + + shadowtext::geom_shadowtext(data = data.frame(x = -158.5, + y = 62.4, + lab = "Alaska") %>% + akgfmaps::transform_data_frame_crs(out.crs = coldpool:::ebs_proj_crs), + mapping = aes(x = x, + y = y, + label = lab), + size = rel(6), + color = "black", + bg.color = "white") + + shadowtext::geom_shadowtext(data = data.frame(x = -166.2, + y = 60.08, + lab = "Nunivak\nIsland") %>% + akgfmaps::transform_data_frame_crs(out.crs = coldpool:::ebs_proj_crs), + mapping = aes(x = x, + y = y, + label = lab), + size = rel(2.5), + color = "black", + bg.color = "white") + + shadowtext::geom_shadowtext(data = data.frame(x = c(-169, -159.5), + y = c(66.3, 57.7), + lab = c("Bering\nStrait", "Bristol\nBay")) %>% + akgfmaps::transform_data_frame_crs(out.crs = coldpool:::ebs_proj_crs), + mapping = aes(x = x, + y = y, + label = lab), + size = rel(3), + color = "black", + bg.color = "white") + + scale_fill_viridis_c(name = "Sample Mean\nDay of Year", + option = "B") + + scale_color_brewer() + + coord_sf(xlim = panel_extent$x, + ylim = panel_extent$y) + + ggplot2::scale_x_continuous(name = "Longitude", + breaks = ebs_layers$lon.breaks) + + ggplot2::scale_y_continuous(name = "Latitude", + breaks = ebs_layers$lat.breaks) + + theme_bw() + + ggplot2::theme(axis.title = element_blank(), + panel.border = element_rect(color = "black", fill = NA), + legend.title = element_text(size = 9, color = "black"), + legend.text = element_text(size = 8, color = "black"), + axis.text = element_text(size = 8, color = "black"), + panel.grid = element_blank(), + panel.background = element_rect(color = "black", fill = "#bee8ff"), + legend.margin = margin(-12,0,0,0), + legend.position = "right", + legend.background = element_blank()) + png(filename = here::here("plots", "ebs_nbs_survey_area.png"), width = 5, height = 5, units = "in", res = 600) print(plot_ebs_nbs_survey_stations) dev.off() + png(filename = here::here("plots", "doy_for_tm.png"), width = 10, height = 10, units = "in", res = 120) + print(doy_for_tm) + dev.off() + } diff --git a/R/make_tm_product_figs.R b/R/make_tm_product_figs.R index 82144a2..f7df3c2 100644 --- a/R/make_tm_product_figs.R +++ b/R/make_tm_product_figs.R @@ -119,8 +119,7 @@ make_tm_product_figs <- function(fig_res = 600) { y = coords[,2], temperature = coldpool:::ebs_bottom_temperature@data@values[,i]) sel_layer_df <- sel_layer_df[!is.na(sel_layer_df$temperature),] - sel_layer_df <- sel_layer_df %>% - dplyr::filter(temperature <= 2) + # sel_layer_df <- sel_layer_df sel_layer_df$year <- year_vec[i] if(i == start_year) { @@ -169,7 +168,8 @@ make_tm_product_figs <- function(fig_res = 600) { geom_sf(data = sebs_layers$akland, fill = "black", color = NA) + geom_sf(data = sebs_layers$survey.area, fill = "grey75") + - geom_tile(data = bt_year_df, + geom_tile(data = bt_year_df %>% + dplyr::filter(temperature <= 2), aes(x = x, y = y, fill = temp_disc), @@ -223,8 +223,7 @@ make_tm_product_figs <- function(fig_res = 600) { y = coords[,2], temperature = coldpool:::ebs_bottom_temperature@data@values[,i]) sel_layer_df <- sel_layer_df[!is.na(sel_layer_df$temperature),] - sel_layer_df <- sel_layer_df %>% - dplyr::filter(temperature <= 2) + # sel_layer_df <- sel_layer_df sel_layer_df$year <- year_vec[i] if(i == (mid_year+1)) { @@ -295,8 +294,6 @@ make_tm_product_figs <- function(fig_res = 600) { ) # Setup EBS+NBS layers ---- - - nbs_ebs_layers <- akgfmaps::get_base_layers(select.region = "ebs", set.crs = coldpool:::ebs_proj_crs) @@ -457,6 +454,137 @@ make_tm_product_figs <- function(fig_res = 600) { nrow = 2, rel_heights = c(0.8,0.2)) + # tm_temp_grid_1.png + + ebs_nbs_bt_grid <- ggplot2::ggplot() + + ggplot2::geom_sf(data = nbs_ebs_layers$akland, + fill = "grey70", + color = "black") + + ggplot2::geom_sf(data = nbs_ebs_layers$survey.area, fill = "grey65") + + ggplot2::geom_tile(data = bt_year_df, + aes(x = x, + y = y, + fill = cut(temperature, + breaks = nbs_ebs_temp_breaks))) + + ggplot2::geom_sf(data = nbs_ebs_agg_strata, + fill = NA, + color = "black") + + ggplot2::facet_wrap(~year, nrow = 2) + + ggplot2::coord_sf(xlim = panel_extent$x, + ylim = panel_extent$y) + + ggplot2::scale_x_continuous(name = "Longitude", + breaks = nbs_ebs_layers$lon.breaks) + + ggplot2::scale_y_continuous(name = "Latitude", + breaks = nbs_ebs_layers$lat.breaks) + + ggplot2::scale_fill_manual(values = viridis_pal(option = nbs_ebs_viridis_option)(n_temp_breaks)) + + theme_bw() + + ggplot2::theme(axis.title = element_blank(), + axis.text = element_text(color = "black"), + axis.ticks = element_line(color = "black"), + panel.border = element_rect(color = "black", fill = NA), + panel.background = element_rect(color = "black", fill = NA), + legend.key.width = unit(12, "mm"), + legend.position = "none", + legend.direction = "horizontal", + plot.margin = unit(c(5.5, 5.5,-25,5.5), units = "pt")) + + ebs_nbs_layers <- akgfmaps::get_base_layers(select.region = "ebs", + set.crs = coldpool:::ebs_proj_crs) + + year_vec <- as.numeric(gsub("[^0-9.-]", "", names(coldpool:::ebs_nbs_bottom_temperature))) + start_year <- which(year_vec == min_year) + mid_year <- which(year_vec == max_year) + end_year <- which(year_vec == 2021) + + coords <- raster::coordinates(coldpool:::ebs_bottom_temperature) + + for(i in start_year:mid_year) { + sel_layer_df <- data.frame(x = coords[,1], + y = coords[,2], + temperature = coldpool:::ebs_bottom_temperature@data@values[,i]) + sel_layer_df <- sel_layer_df[!is.na(sel_layer_df$temperature),] + sel_layer_df <- sel_layer_df + sel_layer_df$year <- year_vec[i] + + if(i == start_year) { + bt_year_df <- sel_layer_df + } else{ + bt_year_df <- dplyr::bind_rows(bt_year_df, sel_layer_df) + } + } + + cold_pool_cbar <- coldpool::legend_discrete_cbar(breaks = c(-Inf, -1, 0, 1, 2), + colors = rev(c("#21dae7", "#0071ff", "#0000e3", "#000040")), + legend_direction = "vertical", + font_size = 3.5, + width = 0.1, + expand_size.x = 0.3, + expand_size.y = 0.3, + expand.x = 0.2, + expand.y = 0.9, + spacing_scaling = 1, + text.hjust = 0, + font.family = "sans", + neat.labels = FALSE) + + annotate("text", + x = 1.1, + y = 2.05, + label = expression(bold("Bottom\nTemperature"~(degree*C))), + size = rel(3.2)) + + theme(plot.margin = unit(c(-25, 0,0,-10), units = "pt")) + + sebs_bt_panels <- ggplot() + + geom_sf(data = sebs_layers$akland, fill = "black", + color = NA) + + geom_sf(data = sebs_layers$survey.area, fill = "grey75") + + geom_tile(data = bt_year_df, + aes(x = x, + y = y, + fill = temperature), + color = NA) + + geom_sf(data = sebs_layers$survey.area, + fill = NA, + color = "black") + + geom_sf(data = sebs_layers$bathymetry) + + geom_label(data = label_2020, + aes(x = x, + y = y, + label = label), + label.size = NA) + + coord_sf(xlim = panel_extent$x, + ylim = panel_extent$y, + expand = c(0,0)) + + scale_x_continuous(name = "Longitude", + breaks = c(-180, -170, -160)) + + scale_y_continuous(name = "Latitude", + breaks = c(54, 58, 62)) + + scale_fill_viridis(option = "C") + + # scale_fill_manual(name = expression("T"~(degree*C)), + # values = rev(cpa_palette), + # drop = FALSE, + # na.value = NA) + + theme_bw() + + theme(axis.title = element_blank(), + axis.text = element_text(color = "black"), + axis.ticks = element_line(color = "black"), + panel.border = element_rect(color = "black", fill = NA), + panel.background = element_rect(color = "black", fill = NA), + strip.text = element_text(size = 9, + color = "white", + face = "bold", + margin = margin(0.5, 0, 0.5, 0, "mm")), + strip.background = element_rect(fill = "#0055a4", + color = NA), + legend.position = "none") + + facet_wrap(~year, ncol = 4) + + cold_pool_grid_1 <- cowplot::plot_grid( + cold_pool_panels, + cowplot::plot_grid(NA, cold_pool_cbar, NA, + nrow = 3), + rel_widths = c(0.9,0.2) + ) + # tm_average_temperature.png ---- sebs_temperatures <- coldpool:::cold_pool_index %>% diff --git a/R/sysdata.rda b/R/sysdata.rda index 15d672a..9e4bd71 100644 Binary files a/R/sysdata.rda and b/R/sysdata.rda differ diff --git a/analysis/temperature_summary.R b/analysis/temperature_summary.R new file mode 100644 index 0000000..50bc6ce --- /dev/null +++ b/analysis/temperature_summary.R @@ -0,0 +1,62 @@ +library(coldpool) + +# Consecutive years with above and below average temperatures +dplyr::mutate(cold_pool_index, + diff_bt = MEAN_GEAR_TEMPERATURE - mean(MEAN_GEAR_TEMPERATURE), + diff_sst = MEAN_SURFACE_TEMPERATURE - mean(MEAN_SURFACE_TEMPERATURE), + diff_area = AREA_LTE2_KM2 - mean(AREA_LTE2_KM2)) |> + dplyr::mutate(sign_area = sign(diff_area), + sign_bt = sign(diff_bt), + sign_sst = sign(diff_sst), + z_bt = diff_bt/sd(MEAN_GEAR_TEMPERATURE), + z_sst = diff_sst/sd(MEAN_SURFACE_TEMPERATURE), + z_cpa = diff_area/sd(AREA_LTE2_KM2), + group = YEAR < 2020) |> + dplyr::inner_join(data.frame(sign_area = c(-1,1), + symbol_area = c("-","+"))) |> + dplyr::inner_join(data.frame(sign_bt = c(-1,1), + symbol_bt = c("-","+"))) |> + dplyr::inner_join(data.frame(sign_sst = c(-1, 1), + symbol_sst = c("-","+"))) + + +mean(cold_pool_index$MEAN_GEAR_TEMPERATURE[cold_pool_index$YEAR <= 2010]) +mean(cold_pool_index$MEAN_GEAR_TEMPERATURE[cold_pool_index$YEAR > 2010]) + +mean(cold_pool_index$AREA_LTE2_KM2) +range(cold_pool_index$AREA_LTE2_KM2) + +mean(cold_pool_index$AREA_LTE2_KM2)/493850 +range(cold_pool_index$AREA_LTE2_KM2)/493850 + +mean(cold_pool_index$AREA_LTE0_KM2) +range(cold_pool_index$AREA_LTE0_KM2) + +mean(cold_pool_index$AREA_LTE0_KM2)/493850 +range(cold_pool_index$AREA_LTE0_KM2)/493850 + +Hmisc::rcorr(cold_pool_index |> + dplyr::select(AREA_LTE2_KM2, AREA_LTE1_KM2, AREA_LTE0_KM2, AREA_LTEMINUS1_KM2,MEAN_GEAR_TEMPERATURE, MEAN_SURFACE_TEMPERATURE) |> + as.matrix(), + type = "pearson") + + +cor.test(coldpool::cold_pool_index$AREA_LTE0_KM2, + coldpool::cold_pool_index$AREA_LTE2_KM2) + +cor.test(coldpool::cold_pool_index$MEAN_GEAR_TEMPERATURE, + coldpool::cold_pool_index$MEAN_SURFACE_TEMPERATURE) + +cor.test(coldpool::cold_pool_index$AREA_LTE2_KM2, + coldpool::cold_pool_index$MEAN_SURFACE_TEMPERATURE) + +cor.test(coldpool::cold_pool_index$AREA_LTE2_KM2, + coldpool::cold_pool_index$MEAN_GEAR_TEMPERATURE) + +cor.test(coldpool::nbs_mean_temperature$MEAN_GEAR_TEMPERATURE, + coldpool::nbs_mean_temperature$MEAN_SURFACE_TEMPERATURE) + +plot(coldpool::nbs_ebs_bottom_temperature-mean(coldpool::nbs_ebs_bottom_temperature, na.rm = TRUE)) + + + diff --git a/inst/extdata/old_method_cpa_temperature_2021.csv b/inst/extdata/old_method_cpa_temperature_2021.csv new file mode 100644 index 0000000..67def9c --- /dev/null +++ b/inst/extdata/old_method_cpa_temperature_2021.csv @@ -0,0 +1,40 @@ +"YEAR","AREA_KM2_MINUS1","AREA_KM2_0","AREA_KM2_1","AREA_KM2_2","AREA_SUM_KM2_LTE2","AREA_KM2_LTE1","AREA_KM2_LTE0","AVGBSBT_PLUSNW","AVGBSST_PLUSNW","AVGBSBT_STANDARD","AVGBSST_STANDARD","AVGBSBT","AVGBSST","AVGBSBT_NBS","AVGBSST_NBS" +1982,141,20864,103365,93180,217550,124370,21005,NA,NA,2.26856156774945,5.57083944683013,1.84069721558868,4.89569826503375,NA,NA +1983,0,15189,47913,102920,166022,63102,15189,NA,NA,3.02211181667236,8.58096298911574,3.00543180485478,8.40016618207258,NA,NA +1984,14462,63835,54957,71799,205053,133255,78298,NA,NA,2.33263061541736,7.23507572708154,2.03787217945637,6.6300636292851,NA,NA +1985,7090,33198,54768,120672,215728,95056,40288,NA,NA,2.36693793253167,6.62678001338205,2.21094544507569,6.04539501708184,NA,NA +1986,37751,41121,69418,110245,258535,148290,78872,NA,NA,1.85904218794074,5.67607465631966,1.5171977231122,4.97680396157683,NA,NA +1987,0,4148,35816,55334,95298,39964,4148,3.08157798954408,6.89504284568731,3.21991310828905,6.78843393500833,3.13194469870091,6.06133179578252,NA,NA +1988,21243,38854,45149,107285,212532,105247,60097,2.16750552811601,6.66087017347662,2.35716471506508,6.61191887914343,2.15894135902697,6.07057559335834,NA,NA +1989,0,8224,14712,80779,103715,22937,8224,2.8457371362395,6.80178673731189,2.96870601698079,6.66303228263455,2.90272691283288,5.9023806098708,NA,NA +1990,22957,50398,37826,65100,176282,111182,73355,2.26853828238313,7.22480865523237,2.44798510699199,7.12398158276929,2.37928445955737,6.55304223922288,NA,NA +1991,25913,42673,44146,59346,172079,112732,68586,2.46597549022411,7.9038677936532,2.69727134228678,7.75768796733689,2.79883681845025,7.18383418161672,NA,NA +1992,51448,54854,71161,72840,250303,177463,106302,1.85901039129696,6.93111742160021,2.01415358368978,6.83176533423117,1.76938330643278,6.23001268339315,NA,NA +1993,2724,16016,31670,85625,136035,50410,18740,2.89532174681473,7.11107580160372,3.057916594884,6.9853001745015,3.02104924829625,6.31829362833414,NA,NA +1994,76312,40869,56435,95001,268618,173616,117181,1.42077195782428,5.63080016389597,1.57148751145774,5.54617226636316,1.29925885202639,5.05034375765144,NA,NA +1995,58034,40293,88660,93968,280955,186987,98327,1.5819343469319,6.10931324391027,1.74377610244574,6.04173163196518,1.47801809979024,5.44720123637908,NA,NA +1996,0,0,14134,74344,88478,14134,0,3.28224017375527,6.69726978827692,3.42355786045465,6.59331892828173,3.32424077541509,5.92530629065461,NA,NA +1997,10302,26267,39517,99633,175719,76085,36568,2.60306741629066,7.90841954896661,2.74217956758376,7.82889730645152,2.515091925251,7.39506986310214,NA,NA +1998,0,3745,15838,84866,104450,19584,3745,3.1357472739297,7.53806353863207,3.27458241484399,7.4609910222501,3.38943333537948,7.08085059027467,NA,NA +1999,61855,102094,152750,76895,393595,316700,163950,0.728809254995997,3.92579583992291,0.828418317296475,3.749935970826,0.34190647568375,2.81552896436905,NA,NA +2000,14969,19867,49648,130991,215476,84484,34837,1.99226375421491,6.2571647332638,2.15780574930757,6.16621133639517,1.99141292289694,5.37992470273528,NA,NA +2001,10395,24160,42918,103663,181136,77473,34556,2.43939509995134,5.88377015474489,2.57504600711481,5.8172919562869,2.40934300787882,5.25174726464715,NA,NA +2002,948,14935,15607,72396,103885,31489,15882,3.06095425336469,6.9319535739574,3.24758049770042,6.87701634415856,3.28817620055757,6.35093369010341,NA,NA +2003,0,5187,9980,33091,48258,15167,5187,3.67474627984997,7.84322582133364,3.81224245878886,7.78290598597347,3.74437679465571,7.35761627915456,NA,NA +2004,6090,10453,32880,44991,94414,49423,16543,3.20321717753159,8.4467947564315,3.38665506905059,8.30825324557171,3.37451623283696,7.76932331994188,NA,NA +2005,12567,18014,23997,34082,88660,54578,30581,3.28965416932441,7.23726126090177,3.47295552213087,7.22458455782323,3.44427713278504,6.81332718906009,NA,NA +2006,53164,47881,52057,85724,238827,153102,101045,1.71272340464864,5.67647528224946,1.87448504912084,5.58743042410334,1.49627378073632,4.68538112076687,NA,NA +2007,45115,46281,87502,110854,289752,178898,91396,1.64346872042149,6.48058544505292,1.78680608872702,6.30928870666727,1.48047673204425,5.50517656936858,NA,NA +2008,59896,40444,101081,131100,332521,201420,100339,1.15133135941043,4.30007944915179,1.29031363107566,4.23711706538443,0.935187004142934,3.2988373952765,NA,NA +2009,48674,92805,62163,129552,333195,203642,141479,1.24362721142998,4.69676936233416,1.38392796205563,4.67163147128175,1.00964644907088,3.95622073194677,NA,NA +2010,58398,72846,57843,88738,277824,189086,131243,1.42180298953391,5.34092658046699,1.53122837730966,5.13697051488269,0.963513684492462,4.42803267304377,2.00980555352613,9.35338383310665 +2011,5913,33798,48178,87065,174954,87889,39711,2.33484698325989,5.06942274000778,2.46709703664036,5.02954058680666,2.27691289963658,4.2481221020858,NA,NA +2012,68196,84735,127946,92782,373659,280877,152931,0.888620801375033,5.07311022449607,1.00785137679668,4.87746545294355,0.646178160014057,3.99737989496408,NA,NA +2013,56138,35824,71387,97071,260420,163349,91962,1.70106707236038,6.40068133552659,1.87294310900694,6.24510809273996,1.60159400567592,5.32969417036729,NA,NA +2014,9106,24539,40555,57651,131851,74200,33645,3.02041899315841,8.23635358241703,3.22364087222282,8.16358616804377,3.26502011330883,7.43465456146931,NA,NA +2015,18395,44272,29182,32649,124498,91849,62667,3.14678591835895,7.19337827242448,3.36299942893672,7.16335042978886,3.31827850560193,6.56051910455584,NA,NA +2016,7638,11686,14128,61246,94698,33452,19324,4.19141684523456,9.57802503937924,4.45760022144862,9.53732167624364,4.8229034758607,9.20217342026295,NA,NA +2017,11179,24421,83571,49518,168690,119172,35600,2.66961623800512,7.98895071127768,2.83232398020373,7.83443747907548,2.5479303147911,7.23177361312549,4.45832063340772,9.62156596366445 +2018,0,0,0,6924,6924,0,0,4.13756740475294,7.59301491386589,4.26020486368238,7.49883292913217,4.47997193257935,7.08868369443161,NA,NA +2019,0,855,9277,21078,31210,10132,855,4.34043720422498,9.24132631103736,4.53015563298465,9.16244663136598,4.83319633081288,8.84106660794889,5.74567349516478,10.8350874379406 +2021,NA,NA,NA,NA,NA,NA,NA,3.34059968745433,7.23931411397464,3.50559824666952,7.12845478319806,3.61920881512324,6.50516299914757,4.02033837101475,8.4800213232335 diff --git a/man/cold_pool_index.Rd b/man/cold_pool_index.Rd index 376caf1..ead5edb 100644 --- a/man/cold_pool_index.Rd +++ b/man/cold_pool_index.Rd @@ -14,7 +14,7 @@ A data frame with 39 rows and 9 columns. \item{AREA_LTEMINUS1_KM2}{Total area with bottom temperatures less than or equal to -1 celsius, in square kilometers} \item{MEAN_GEAR_TEMPERATURE}{Mean gear temperature (i.e. bottom temperature) in the survey area.} \item{MEAN_SURFACE_TEMPERATURE}{Mean sea surface temperature in the survey area.} - \item{MEAN_BT_LT100M}{Mean gear temperature (i.e. bottom temperature) for EBS shelf strata with bottom depth less than or equal to 100 m (strata 10, 20, 31, 32, 41, 42, 43).} + \item{MEAN_BT_LT100M}{Mean gear temperature (i.e. bottom temperature) for EBS shelf *STANDARD* strata (i.e., excluding northwest strata 82 and 90) with bottom depth less than 100 m (strata 10, 20, 31, 32, 41, 42, 43).} \item{LAST_UPDATE}{Date when cold pool index and temperature rasters were last updated.} } } diff --git a/man/cpa_pre2021.Rd b/man/cpa_pre2021.Rd index 9c07425..348b63c 100644 --- a/man/cpa_pre2021.Rd +++ b/man/cpa_pre2021.Rd @@ -15,7 +15,15 @@ A data frame with 38 rows and 9 columns: \item{AREA_KM2_2}{Area with bottom temperatures between 1 and 2 celsius, in square kilometers} \item{AREA_SUM_KM2_LTE2}{Cold Pool Index. Total area with bottom temperatures less than or equal to 2 celsius, in square kilometers} \item{AREA_KM2_LTE1}{Total area with bottom temperatures less than or equal to 1 celsius, in square kilometers} - \item{AREA_KM2_LTE0}{Total area with bottom temperatures less than or equal to 0 celsius, in square kilometers} + \item{AREA_KM2_LTE0}{Total area with bottom temperatures less than or equal to 0 celsius, in square kilometers} + \item{AVGBSBT_PLUSNW}{Stratum-area weighted mean bottom temperature for EBS shelf standard and plusNW survey strata} + \item{AVGBSST_PLUSNW}{Stratum-area weighted mean sea surface temperature for EBS shelf standard and plusNW survey strata} + \item{AVGBSBT_STANDARD}{Stratum-area weighted mean bottom temperature for EBS shelf standard survey strata} + \item{AVGBSST_STANDARD}{Stratum-area weighted mean sea surface temperature for EBS shelf standard survey strata} + \item{AVGBSBT_NBS}{Stratum-area weighted mean bottom temperature for the NBS} + \item{AVGBSST_NBS}{Stratum-area weighted mean sea surface temperature for the NBS} + \item{AVGBSBT_LT100M}{Stratum-area weighted mean bottom temperature for EBS shelf stations at bottom depths < 100 m} + \item{AVGBSST_LT100M}{Stratum-area weighted mean sea surface temperature for EBS shelf stations at bottom depths < 100 m} } } \source{ diff --git a/plots/2021_anomaly.png b/plots/2021_anomaly.png new file mode 100644 index 0000000..4d75838 Binary files /dev/null and b/plots/2021_anomaly.png differ diff --git a/plots/doy_for_tm.png b/plots/doy_for_tm.png new file mode 100644 index 0000000..69651e2 Binary files /dev/null and b/plots/doy_for_tm.png differ diff --git a/plots/ebs_nbs_survey_area.png b/plots/ebs_nbs_survey_area.png index 79ab28d..3625f57 100644 Binary files a/plots/ebs_nbs_survey_area.png and b/plots/ebs_nbs_survey_area.png differ