Skip to content

Commit

Permalink
add local option
Browse files Browse the repository at this point in the history
  • Loading branch information
kdaust committed Oct 17, 2024
1 parent 1d0b335 commit 8489b00
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion R/append_clim_vars.R
Original file line number Diff line number Diff line change
Expand Up @@ -717,5 +717,5 @@ append_clim_vars <- function(dt, vars) {
}

# Reorder to match vars
setcolorder(dt, c(names(dt)[names(dt) %in% c("id", "DATASET", "GCM", "SSP", "RUN", "PERIOD")], vars))
setcolorder(dt, c(names(dt)[names(dt) %in% c("id", "DATASET", "GCM", "SSP", "RUN", "PERIOD")], unique(vars)))
}
7 changes: 5 additions & 2 deletions R/downscale.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
#' @template max_run
#' @template run_nm
#' @param cache logical. Cache data locally? Default `TRUE`
#' @param local logical. Is the postgres database local? Default `FALSE`
#' @param ... other arguments passed to [`downscale_core()`]. Namely: `return_refperiod`,
#' `vars`, `out_spatial` and `plot`

Expand Down Expand Up @@ -110,7 +111,9 @@ downscale <- function(xyz, which_refmap = "auto",
gcm_periods = NULL, gcm_ssp_years = NULL,
gcm_hist_years = NULL, max_run = 0L,
run_nm = NULL,
cache = TRUE, ...) {
cache = TRUE,
local = FALSE,
...) {
message("Welcome to climr!")

## checks
Expand All @@ -123,7 +126,7 @@ downscale <- function(xyz, which_refmap = "auto",
expectedCols <- c("lon", "lat", "elev", "id")
xyz <- .checkXYZ(copy(xyz), expectedCols)

dbCon <- data_connect()
dbCon <- data_connect(local = local)
thebb <- get_bb(xyz) ## get bounding box based on input points

rmCols <- setdiff(names(xyz), expectedCols)
Expand Down

0 comments on commit 8489b00

Please sign in to comment.