Skip to content

Commit

Permalink
cleaning and updating scores with a couple vulnerability corrections.
Browse files Browse the repository at this point in the history
  • Loading branch information
Melsteroni committed Oct 11, 2024
1 parent f234fba commit 3ce98d2
Show file tree
Hide file tree
Showing 208 changed files with 84,149 additions and 56,049 deletions.
Binary file removed _spatial/bathy_mol.tif
Binary file not shown.
Binary file removed _spatial/bathy_mol_neritic.tif
Binary file not shown.
Binary file removed _spatial/bathy_mol_shallow.tif
Binary file not shown.
Binary file removed _spatial/meow_prov_mol.tif
Binary file not shown.
1 change: 0 additions & 1 deletion _spatial/meow_rgns/meow_rgns.cpg

This file was deleted.

Binary file removed _spatial/meow_rgns/meow_rgns.dbf
Binary file not shown.
1 change: 0 additions & 1 deletion _spatial/meow_rgns/meow_rgns.prj

This file was deleted.

Binary file removed _spatial/meow_rgns/meow_rgns.shp
Binary file not shown.
Binary file removed _spatial/meow_rgns/meow_rgns.shx
Binary file not shown.
Binary file removed _spatial/meow_rgns/rgns_mol_1k.gpkg
Binary file not shown.
Binary file removed _spatial/meow_rgns_mol.tif
Binary file not shown.
21 changes: 18 additions & 3 deletions combining_pressures/combining_pressures.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,25 @@ Save final pressure files to consistent file location and adjust filenaming.
pressure_save <- "/home/shares/ohi/stressors_2021/combining_pressures/rescaled_pressures"
pressure_list <- read_csv(here("combining_pressures/pressure_list.csv"))
file.remove(list.files(pressure_save, full=TRUE))
files_to_save <- paste0(pressure_list$f_path, "/", pressure_list$fn_pressure, "_", pressure_list$fn_scenario, "_", pressure_list$fn_time, ".tif")
files_new_loc <- paste0(pressure_save, "/", pressure_list$new_fn_pressure, "_", pressure_list$fn_scenario, "_", pressure_list$fn_time, ".tif")
for (i in seq_along(files_to_save)) { # i = 178
file.copy(from = files_to_save[i], to = files_new_loc[i], overwrite = TRUE)
}
length(list.files(pressure_save)) # currently should be 203
length(list.files(pressure_save)) # currently should be 227
```


Calculate raster differences
```{r}
clean <- list.files("/home/shares/ohi/stressors_2021/combining_pressures/change", full=TRUE)
file.remove(clean)
files_df <- data.frame(fp = list.files("/home/shares/ohi/stressors_2021/combining_pressures/rescaled_pressures", full=TRUE))
files_df$fn <- basename(files_df$fp)
files_df <- files_df %>%
Expand Down Expand Up @@ -73,6 +77,9 @@ for(pressure in pressure_list){ # pressure = pressure_list[1]
Obtain cumulative pressures
```{r}
clean <- list.files("/home/shares/ohi/stressors_2021/combining_pressures/cumulative/", full=TRUE)
file.remove(clean)
files_df <- data.frame(fp = list.files("/home/shares/ohi/stressors_2021/combining_pressures/rescaled_pressures", full=TRUE))
files_df$fn <- basename(files_df$fp)
files_df <- files_df %>%
Expand All @@ -94,11 +101,14 @@ for (i in 1:dim(cumulative_list)[1]){ # i = 1
cat(as.character(scenario), " ", as.character(timeframe), " ", length(file_list$df_pressure), "\n")
stack <- rast(file_list$fp)
cumulative <- app(stack, "sum", na.rm=TRUE)
writeRaster(cumulative, sprintf("/home/shares/ohi/stressors_2021/combining_pressures/cumulative/%s_%s.tif", scenario, timeframe))
writeRaster(cumulative, sprintf("/home/shares/ohi/stressors_2021/combining_pressures/cumulative/%s_%s.tif", scenario, timeframe), overwrite=TRUE)
}
#check that all outputs have N=11 (or, whatever!)
#check that all outputs have N=12
clean <- list.files("/home/shares/ohi/stressors_2021/combining_pressures/cumulative_change/", full=TRUE)
file.remove(clean)
list.files("/home/shares/ohi/stressors_2021/combining_pressures/cumulative/", full=TRUE)
Expand Down Expand Up @@ -128,6 +138,8 @@ writeRaster(ssp585_t2, "/home/shares/ohi/stressors_2021/combining_pressures/cumu

Make cumulative figures
```{r}
clean <- list.files(here("combining_pressures/figs_cumulative"), full=TRUE)
file.remove(clean)
library(paletteer)
library(png)
Expand Down Expand Up @@ -164,6 +176,9 @@ Make cumulative difference raster plots.

```{r}
clean <- list.files(here("combining_pressures/figs_cumulative_diff"), full=TRUE)
file.remove(clean)
tmp <- list.files("/home/shares/ohi/stressors_2021/combining_pressures/cumulative", full=TRUE)
ssp245_near_change <- rast("/home/shares/ohi/stressors_2021/combining_pressures/cumulative/ssp245_near-term.tif") - rast("/home/shares/ohi/stressors_2021/combining_pressures/cumulative/ssp245_current.tif")
Expand Down
6 changes: 4 additions & 2 deletions combining_pressures/data/pressure_colors.csv
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ slr,coastal,#499894FF
slr,global,#86BCB6FF
coastal-disturbance,coastal,#E15759FF
coastal-disturbance,global,#FF9D9AFF
oxygen-deep,coastal,#79706EFF
oxygen-deep,global,#BAB0ACFF
oxygen-benthic,coastal,#79706EFF
oxygen-benthic,global,#BAB0ACFF
oa,coastal,#D37295FF
oa,global,#FABFD2FF
fisheries-biomass-loss,coastal,#B07AA1FF
fisheries-biomass-loss,global,#D4A6C8FF
sst-extremes,coastal,#9D7660FF
sst-extremes,global,#D7B5A6FF
temperature-benthic,coastal,#8C564BFF
temperature-benthic,global,#C49C94FF
Binary file modified combining_pressures/figs_cumulative/ssp245_current.tif.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified combining_pressures/figs_cumulative/ssp245_medium-term.tif.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified combining_pressures/figs_cumulative/ssp245_near-term.tif.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified combining_pressures/figs_cumulative/ssp585_current.tif.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified combining_pressures/figs_cumulative/ssp585_near-term.tif.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified combining_pressures/figs_cumulative_diff/ssp245_near-change.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified combining_pressures/figs_cumulative_diff/ssp585_near-change.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
4 changes: 4 additions & 0 deletions combining_pressures/figs_differences.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ cols_palette <- paletteer_c("ggthemes::Sunset-Sunrise Diverging", 30)
```

```{r, include = FALSE, echo=FALSE}
clean <- list.files(here("combining_pressures/figs_difference_floating_scale"), full=TRUE)
file.remove(clean)
# make the pngs of the data
files <- list.files("/home/shares/ohi/stressors_2021/combining_pressures/change/", full=TRUE)
Expand Down
300 changes: 213 additions & 87 deletions combining_pressures/figs_differences.html

Large diffs are not rendered by default.

Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
3 changes: 3 additions & 0 deletions combining_pressures/figs_rescaled_floating_scale.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ cols_palette <- paletteer_c("ggthemes::Sunset-Sunrise Diverging", 30)
```

```{r, include = FALSE, echo=FALSE}
clean <- list.files("combining_pressures/figs_floating_scale", full=TRUE)
file.remove(clean)
# make the pngs of the data
files <- list.files("/home/shares/ohi/stressors_2021/combining_pressures/rescaled_pressures", full=TRUE)
Expand Down
400 changes: 284 additions & 116 deletions combining_pressures/figs_rescaled_floating_scale.html

Large diffs are not rendered by default.

Binary file modified combining_pressures/paper_figs/current_future_scatterplot.png
Binary file removed combining_pressures/pressure_change.png
Diff not rendered.
2 changes: 1 addition & 1 deletion documents/pressure_review.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Non-indigenous species | marine vessel transport, mariculture, aquarium trade

** includes categories of extreme events (number of days > 35 or 40 C, dry and wet bulb temperatures)

We were able to get current and future estimates for 11 of the pressure categories (I am still going to assume I can get the fisheries stuff). These data included various scenarios and methodologies. Without future projections, we were able to map 14 pressures. Major data limitations include:
We were able to get current and future estimates for 10 of the pressure categories. These data included various scenarios and methodologies. Without future projections, we were able to map 14 pressures. Major data limitations include:

- locations of most coastal and marine structures (hardening, windmills, wave energy, coastal hardening)
- a great deal of uncertainty in the location of mariculture
Expand Down
Loading

0 comments on commit 3ce98d2

Please sign in to comment.