diff --git a/analysis/efh_bathymetry_2028/03_derive_terrain_variables.R b/analysis/efh_bathymetry_2028/03_derive_terrain_variables.R index 5af5be8..ae3b11f 100644 --- a/analysis/efh_bathymetry_2028/03_derive_terrain_variables.R +++ b/analysis/efh_bathymetry_2028/03_derive_terrain_variables.R @@ -1,6 +1,6 @@ # Generate terrain variables for 2028 EFH review # Sean Rohan -# March 26, 2024 +# January 7, 2025 library(akgfmaps) library(MultiscaleDTM) # last run: version 0.8.3 @@ -43,20 +43,40 @@ curvature_slope_dtm_100m <- MultiscaleDTM::Qfit(r = bathy_100m, start2 <- Sys.time() difftime(start2, start1) -bpi_dtm_100m <- MultiscaleDTM::BPI(r = bathy_100m, +bpi_dtm_3_64_100m <- MultiscaleDTM::BPI(r = bathy_100m, w = bpi_w, unit = "cell", # Units for window stand = "none", na.rm = TRUE ) +bpi_dtm_15_64_100m <- MultiscaleDTM::BPI(r = bathy_100m, + w = c(15, 64), + unit = "cell", # Units for window + stand = "none", + na.rm = TRUE +) + +bpi_dtm_30_124_100m <- MultiscaleDTM::BPI(r = bathy_100m, + w = c(30, 124), + unit = "cell", # Units for window + stand = "none", + na.rm = TRUE +) + end2 <- Sys.time() difftime(start2, end2) # Write 100-m rasters to GeoTIFF files ---- -writeRaster(bpi_dtm_100m, - here::here("analysis", "efh_bathymetry_2028", "output", "terrain", "efh_bpi_100m.tif"), +writeRaster(bpi_dtm_3_64_100m, + here::here("analysis", "efh_bathymetry_2028", "output", "terrain", "efh_bpi_3_64_100m.tif"), + overwrite = TRUE) +writeRaster(bpi_dtm_15_64_100m, + here::here("analysis", "efh_bathymetry_2028", "output", "terrain", "efh_bpi_15_64_100m.tif"), + overwrite = TRUE) +writeRaster(bpi_dtm_30_124_100m, + here::here("analysis", "efh_bathymetry_2028", "output", "terrain", "efh_bpi_30_124_100m.tif"), overwrite = TRUE) writeRaster(curvature_slope_dtm_100m$meanc, here::here("analysis", "efh_bathymetry_2028", "output", "terrain", "efh_dtm_meancurv_100m.tif"), @@ -82,19 +102,29 @@ writeRaster(slope_t_100m, # Resample 100-m rasters to 1-km resolution ---- +bpi_dtm_3_64_1km <- terra::aggregate(bpi_dtm_3_64_100m, fact = 10, fun = "mean") + +bpi_dtm_15_64_1km <- terra::aggregate(bpi_dtm_15_64_100m, fact = 10, fun = "mean") + +bpi_dtm_30_124_1km <- terra::aggregate(bpi_dtm_30_124_100m, fact = 10, fun = "mean") + slope_t_1km <- terra::aggregate(slope_t_100m, fact = 10, fun = "mean") slope_aspect_dtm_1km <- terra::aggregate(slope_aspect_dtm_100m, fact = 10, fun = "mean") curvature_slope_dtm_1km <- terra::aggregate(curvature_slope_dtm_100m, fact = 10, fun = "mean") -bpi_dtm_1km <- terra::aggregate(bpi_dtm_100m, fact = 10, fun = "mean") - # Write 1-km rasters to GeoTIFF files ---- -writeRaster(bpi_dtm_1km, - here::here("analysis", "efh_bathymetry_2028", "output", "terrain", "efh_bpi_1km.tif"), +writeRaster(bpi_dtm_3_64_1km, + here::here("analysis", "efh_bathymetry_2028", "output", "terrain", "efh_bpi_3_64_1km.tif"), + overwrite = TRUE) +writeRaster(bpi_dtm_15_64_1km, + here::here("analysis", "efh_bathymetry_2028", "output", "terrain", "efh_bpi_15_64_1km.tif"), + overwrite = TRUE) +writeRaster(bpi_dtm_30_124_1km, + here::here("analysis", "efh_bathymetry_2028", "output", "terrain", "efh_bpi_30_124_1km.tif"), overwrite = TRUE) writeRaster(curvature_slope_dtm_1km$meanc, here::here("analysis", "efh_bathymetry_2028", "output", "terrain", "efh_dtm_meancurv_1km.tif"), diff --git a/analysis/efh_bathymetry_2028/output/terrain/efh_bpi_1km.tif b/analysis/efh_bathymetry_2028/output/terrain/efh_bpi_1km.tif deleted file mode 100644 index 0a46b4b..0000000 Binary files a/analysis/efh_bathymetry_2028/output/terrain/efh_bpi_1km.tif and /dev/null differ diff --git a/analysis/efh_bathymetry_2028/output/terrain/efh_bpi_1km.tif.aux.xml b/analysis/efh_bathymetry_2028/output/terrain/efh_bpi_1km.tif.aux.xml deleted file mode 100644 index 9b9be02..0000000 --- a/analysis/efh_bathymetry_2028/output/terrain/efh_bpi_1km.tif.aux.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - bpi - - - -1282.9228515625 - 991.11669921875 - 256 - 1 - 0 - 1|0|0|0|0|0|0|0|0|0|0|0|1|0|0|0|0|0|0|1|0|0|0|0|1|1|0|1|3|0|1|0|0|0|0|1|2|0|1|3|1|1|1|1|3|4|3|1|5|0|2|2|7|7|6|4|7|6|6|6|6|9|10|15|13|17|9|21|19|25|22|25|29|26|39|49|36|45|58|64|69|86|73|103|100|98|119|131|132|154|151|197|199|192|209|213|245|294|351|337|371|415|454|502|513|591|602|706|760|871|923|1047|1148|1282|1389|1556|1687|1906|2028|2240|2555|2758|3066|3513|3927|4289|4904|5395|6249|6936|7702|9105|10088|11448|13390|15836|18839|22917|28612|37625|53304|87060|181394|1588276|495047|145227|81422|52965|38303|30148|24435|20312|17186|14598|12517|11054|9740|8335|7150|6350|5580|4944|4482|4020|3404|3050|2714|2417|2225|1948|1707|1507|1372|1184|1059|912|859|738|697|553|502|491|428|373|323|313|274|274|199|200|193|164|165|130|113|97|116|93|82|58|72|49|35|43|23|32|36|30|14|18|14|23|18|15|19|12|10|7|11|6|4|4|9|2|1|4|8|1|2|1|2|3|1|2|1|3|1|0|1|2|2|1|0|2|1|0|1|0|1|0|1|1|0|0|0|1 - - - - 2821.140444233924 - - 991.11669921875 - 0.070203023773418 - -7.677143 - -1282.9228515625 - 1 - 1 - 53.114409007669 - - - diff --git a/analysis/efh_bathymetry_2028/plots/BPI/BPI_Bathy_Nazan_Bay_100m.png b/analysis/efh_bathymetry_2028/plots/BPI/BPI_Bathy_Nazan_Bay_100m.png index 13261df..153ba82 100644 Binary files a/analysis/efh_bathymetry_2028/plots/BPI/BPI_Bathy_Nazan_Bay_100m.png and b/analysis/efh_bathymetry_2028/plots/BPI/BPI_Bathy_Nazan_Bay_100m.png differ diff --git a/analysis/efh_bathymetry_2028/plots/BPI/BPI_Bathy_Nazan_Bay_1km.png b/analysis/efh_bathymetry_2028/plots/BPI/BPI_Bathy_Nazan_Bay_1km.png index f23813a..8f14a78 100644 Binary files a/analysis/efh_bathymetry_2028/plots/BPI/BPI_Bathy_Nazan_Bay_1km.png and b/analysis/efh_bathymetry_2028/plots/BPI/BPI_Bathy_Nazan_Bay_1km.png differ diff --git a/analysis/efh_bathymetry_2028/plots/BPI/BPI_Bathy_Nazan_Bay_2023_method.png b/analysis/efh_bathymetry_2028/plots/BPI/BPI_Bathy_Nazan_Bay_2023_method.png index a3852b7..7fa71a2 100644 Binary files a/analysis/efh_bathymetry_2028/plots/BPI/BPI_Bathy_Nazan_Bay_2023_method.png and b/analysis/efh_bathymetry_2028/plots/BPI/BPI_Bathy_Nazan_Bay_2023_method.png differ diff --git a/analysis/efh_bathymetry_2028/plots/BPI/BPI_Bathy_Norton_Sounds_100m.png b/analysis/efh_bathymetry_2028/plots/BPI/BPI_Bathy_Norton_Sounds_100m.png index 96fe3c4..518f95a 100644 Binary files a/analysis/efh_bathymetry_2028/plots/BPI/BPI_Bathy_Norton_Sounds_100m.png and b/analysis/efh_bathymetry_2028/plots/BPI/BPI_Bathy_Norton_Sounds_100m.png differ diff --git a/analysis/efh_bathymetry_2028/plots/BPI/BPI_Bathy_Norton_Sounds_1km.png b/analysis/efh_bathymetry_2028/plots/BPI/BPI_Bathy_Norton_Sounds_1km.png index 2925ece..7f6d641 100644 Binary files a/analysis/efh_bathymetry_2028/plots/BPI/BPI_Bathy_Norton_Sounds_1km.png and b/analysis/efh_bathymetry_2028/plots/BPI/BPI_Bathy_Norton_Sounds_1km.png differ diff --git a/analysis/efh_bathymetry_2028/plots/BPI/BPI_Bathy_Norton_Sounds_2023_method.png b/analysis/efh_bathymetry_2028/plots/BPI/BPI_Bathy_Norton_Sounds_2023_method.png index 6ae5c5e..2284a78 100644 Binary files a/analysis/efh_bathymetry_2028/plots/BPI/BPI_Bathy_Norton_Sounds_2023_method.png and b/analysis/efh_bathymetry_2028/plots/BPI/BPI_Bathy_Norton_Sounds_2023_method.png differ diff --git a/analysis/efh_bathymetry_2028/plots/BPI/BPI_Bathy_Pribilof_Islands_100m.png b/analysis/efh_bathymetry_2028/plots/BPI/BPI_Bathy_Pribilof_Islands_100m.png index b65770b..57883ef 100644 Binary files a/analysis/efh_bathymetry_2028/plots/BPI/BPI_Bathy_Pribilof_Islands_100m.png and b/analysis/efh_bathymetry_2028/plots/BPI/BPI_Bathy_Pribilof_Islands_100m.png differ diff --git a/analysis/efh_bathymetry_2028/plots/BPI/BPI_Bathy_Pribilof_Islands_1km.png b/analysis/efh_bathymetry_2028/plots/BPI/BPI_Bathy_Pribilof_Islands_1km.png index 3c4bebe..60c92b5 100644 Binary files a/analysis/efh_bathymetry_2028/plots/BPI/BPI_Bathy_Pribilof_Islands_1km.png and b/analysis/efh_bathymetry_2028/plots/BPI/BPI_Bathy_Pribilof_Islands_1km.png differ diff --git a/analysis/efh_bathymetry_2028/plots/BPI/BPI_Bathy_Pribilof_Islands_2023_method.png b/analysis/efh_bathymetry_2028/plots/BPI/BPI_Bathy_Pribilof_Islands_2023_method.png index 0396e5f..81d7b05 100644 Binary files a/analysis/efh_bathymetry_2028/plots/BPI/BPI_Bathy_Pribilof_Islands_2023_method.png and b/analysis/efh_bathymetry_2028/plots/BPI/BPI_Bathy_Pribilof_Islands_2023_method.png differ diff --git a/analysis/efh_bathymetry_2028/plots/BPI/BPI_Bathy_RKC_Savings_Area_100m.png b/analysis/efh_bathymetry_2028/plots/BPI/BPI_Bathy_RKC_Savings_Area_100m.png new file mode 100644 index 0000000..36a3a1e Binary files /dev/null and b/analysis/efh_bathymetry_2028/plots/BPI/BPI_Bathy_RKC_Savings_Area_100m.png differ diff --git a/analysis/efh_bathymetry_2028/plots/BPI/BPI_Bathy_RKC_Savings_Area_1km.png b/analysis/efh_bathymetry_2028/plots/BPI/BPI_Bathy_RKC_Savings_Area_1km.png index 746bd72..b4804f2 100644 Binary files a/analysis/efh_bathymetry_2028/plots/BPI/BPI_Bathy_RKC_Savings_Area_1km.png and b/analysis/efh_bathymetry_2028/plots/BPI/BPI_Bathy_RKC_Savings_Area_1km.png differ diff --git a/analysis/efh_bathymetry_2028/plots/BPI/BPI_Bathy_RKC_Savings_Area_2023_method.png b/analysis/efh_bathymetry_2028/plots/BPI/BPI_Bathy_RKC_Savings_Area_2023_method.png index 1983490..9a1facf 100644 Binary files a/analysis/efh_bathymetry_2028/plots/BPI/BPI_Bathy_RKC_Savings_Area_2023_method.png and b/analysis/efh_bathymetry_2028/plots/BPI/BPI_Bathy_RKC_Savings_Area_2023_method.png differ