Skip to content
Snippets Groups Projects
Commit 36c90e71 authored by Bock, Andy's avatar Bock, Andy
Browse files

Updates from MR feedback

parent 048e85c5
No related branches found
No related tags found
1 merge request!169Updates through 07_merge
...@@ -20,6 +20,7 @@ library(dplyr) ...@@ -20,6 +20,7 @@ library(dplyr)
library(sf) library(sf)
source("R/utils.R") source("R/utils.R")
source("R/config.R")
if(!dir.exists("data")) {dir.create("data")} if(!dir.exists("data")) {dir.create("data")}
if(!dir.exists("bin")) {dir.create("bin")} if(!dir.exists("bin")) {dir.create("bin")}
...@@ -49,7 +50,7 @@ if(!file.exists(hu12_points_path)) { ...@@ -49,7 +50,7 @@ if(!file.exists(hu12_points_path)) {
if(is.null(sbtools::current_session())) if(is.null(sbtools::current_session()))
sb <- authenticate_sb() sb <- authenticate_sb()
sbtools::item_file_download("60cb5edfd34e86b938a373f4", names = "102020wbd_outlets.gpkg", sbtools::item_file_download("63cb38b2d34e06fef14f40ad", names = "102020wbd_outlets.gpkg",
destinations = hu12_points_path, session = sb) destinations = hu12_points_path, session = sb)
} }
...@@ -68,11 +69,6 @@ if(!file.exists(SWIM_points_path)) { ...@@ -68,11 +69,6 @@ if(!file.exists(SWIM_points_path)) {
item <- retrieve_sb("5ebe92af82ce476925e44b8f", data_dir) item <- retrieve_sb("5ebe92af82ce476925e44b8f", data_dir)
g3gf <- "gages3GFinfo.dbf"
sbtools::item_file_download("5dcd5f96e4b069579760aedb", names = g3gf,
destinations = file.path(data_dir, g3gf),
overwrite_file = TRUE)
} }
out_list <- c(out_list, list(SWIM_points_path = SWIM_points_path)) out_list <- c(out_list, list(SWIM_points_path = SWIM_points_path))
...@@ -457,16 +453,17 @@ get_sbfile <- function(f, itm) { ...@@ -457,16 +453,17 @@ get_sbfile <- function(f, itm) {
sbtools::item_file_download(itm, names = basename(f), sbtools::item_file_download(itm, names = basename(f),
destinations = f) destinations = f)
#zip::unzip(f)
} }
return(o) return(o)
} }
out <- list(aster_dem = get_sbfile(file.path(merit_dir, "dem.zip"), "5fbbc6b6d34eb413d5e21378"), out <- list(aster_dem = get_sbfile(file.path(merit_dir, "dem.zip"), "5fbbc6b6d34eb413d5e21378"),
merit_dem = get_sbfile(file.path(merit_dir, "ak_merit_dem.zip"), "5fc51e65d34e4b9faad8877b"), merit_dem = get_sbfile(file.path(merit_dir,
merit_fdr = get_sbfile(file.path(merit_dir, "ak_merit_fdr.zip"), "5fc51e65d34e4b9faad8877b"), "ak_merit_dem.zip"), "5fc51e65d34e4b9faad8877b"),
merit_fac = get_sbfile(file.path(merit_dir, "ak_merit_fac.zip"), "5fc51e65d34e4b9faad8877b")) merit_fdr = get_sbfile(file.path(merit_dir,
"ak_merit_fdr.zip"), "5fc51e65d34e4b9faad8877b"),
merit_fac = get_sbfile(file.path(merit_dir,
"ak_merit_fac.zip"), "5fc51e65d34e4b9faad8877b"))
out_list <- c(out_list, out) out_list <- c(out_list, out)
``` ```
...@@ -511,30 +508,6 @@ if(!file.exists(file.path(islands_dir, "hi.gpkg"))) { ...@@ -511,30 +508,6 @@ if(!file.exists(file.path(islands_dir, "hi.gpkg"))) {
out_list <- c(out_list, out_hi) out_list <- c(out_list, out_hi)
``` ```
```{r e2nhd}
zip_file <- "e2nhdplusv2_us_csv.zip"
out_csv <- "e2nhdplusv2_us.csv"
out_zip <- file.path(data_dir, out_csv)
out <- list(e2nhd_network = file.path(data_dir, out_csv))
if(!file.exists(out$e2nhd_network)) {
if(is.null(sbtools::current_session()))
authenticate_sb()
sbtools::item_file_download("5d16509ee4b0941bde5d8ffe",
names = zip_file,
destinations = file.path(data_dir, zip_file))
zip::unzip(file.path(data_dir, zip_file), exdir = data_dir)
}
out_list <- c(out_list, out)
```
```{r nwm_topology} ```{r nwm_topology}
nwm_targz_url <- "https://www.nohrsc.noaa.gov/pub/staff/keicher/NWM_live/NWM_parameters/NWM_parameter_files_v2.1.tar.gz" nwm_targz_url <- "https://www.nohrsc.noaa.gov/pub/staff/keicher/NWM_live/NWM_parameters/NWM_parameter_files_v2.1.tar.gz"
...@@ -580,7 +553,7 @@ if(!file.exists(out$new_nhdp_atts)) { ...@@ -580,7 +553,7 @@ if(!file.exists(out$new_nhdp_atts)) {
if(is.null(sbtools::current_session())) if(is.null(sbtools::current_session()))
authenticate_sb() authenticate_sb()
sbtools::item_file_download("60c92503d34e86b9389df1c9", sbtools::item_file_download("63cb311ed34e06fef14f40a3",
names = sb_f, names = sb_f,
destinations = out$new_nhdp_atts) destinations = out$new_nhdp_atts)
} }
...@@ -588,22 +561,6 @@ if(!file.exists(out$new_nhdp_atts)) { ...@@ -588,22 +561,6 @@ if(!file.exists(out$new_nhdp_atts)) {
out_list <- c(out_list, out) out_list <- c(out_list, out)
``` ```
```{r nwm_nhdplus_attributes}
out <- list(new_nwm_nhdp_atts = file.path("cache", (sb_f <- "nwm_enhd_nhdplusatts.csv")))
if(!file.exists(out$new_nwm_nhdp_atts)) {
if(is.null(sbtools::current_session()))
authenticate_sb()
sbtools::item_file_download("60c92503d34e86b9389df1c9",
names = sb_f,
destinations = out$new_nwm_nhdp_atts)
}
out_list <- c(out_list, out)
```
```{r GFv1.1} ```{r GFv1.1}
GFv11_dir <- file.path(data_dir, "GFv11") GFv11_dir <- file.path(data_dir, "GFv11")
out <- list(GFv11_gages_lyr = file.path(data_dir, "GFv11/GFv11_gages.rds"), out <- list(GFv11_gages_lyr = file.path(data_dir, "GFv11/GFv11_gages.rds"),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment