Skip to content

Commit

Permalink
Merge branch 'dev' of github.com:EvolEcolGroup/pastclim into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
dramanica committed Oct 26, 2024
2 parents 94b4e76 + 79a372d commit 644b479
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# pastclim dev
* Add delta downscaling functions
* Fix chelsa paths to match new URLs

# pastclim 2.1.0
* Add all CHELSA present and future datasets (including the use of virtual rasters to avoid downloading all data)
* Add paleoclim at multiple resolutions
Expand Down
5 changes: 3 additions & 2 deletions R/filenames_chelsa_future.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,15 @@ filenames_chelsa_future <- function(dataset, bio_var){
}
time_steps <- c("2011-2040","2041-2070","2071-2100")
time_steps_underscore <- c("2011_2040","2041_2070","2071_2100")
chelsa_root <- "https://os.zhdk.cloud.switch.ch/chelsav2/GLOBAL/climatologies/"
# compose download paths
if (var_prefix=="bio"){
chelsa_files <- paste0("https://os.zhdk.cloud.switch.ch/envicloud/chelsa/chelsa_V2/GLOBAL/climatologies/",
chelsa_files <- paste0(chelsa_root,
time_steps,"/",dataset_parsed[3],"/",dataset_parsed[4],"/",
var_prefix,"/CHELSA_",var_index,"_",time_steps,"_",
tolower(dataset_parsed[3]),"_",dataset_parsed[4],"_V.2.1.tif")
} else {
chelsa_files <- paste0("https://os.zhdk.cloud.switch.ch/envicloud/chelsa/chelsa_V2/GLOBAL/climatologies/",
chelsa_files <- paste0(chelsa_root,
time_steps,"/",dataset_parsed[3],"/",dataset_parsed[4],"/",
var_prefix,"/CHELSA_",tolower(dataset_parsed[3]),
"_r1i1p1f1_w5e5_",dataset_parsed[4], "_",var_index,
Expand Down
5 changes: 3 additions & 2 deletions R/filenames_chelsa_present.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ filenames_chelsa_present <- function(dataset, bio_var){
var_index <- paste0(var_prefix,"_",var_index)
}
# compose download paths
paste0("https://os.zhdk.cloud.switch.ch/envicloud/chelsa/chelsa_V2/GLOBAL/climatologies/1981-2010/",
var_prefix,"/CHELSA_",var_index,"_1981-2010_V.2.1.tif")
chelsa_root <- "https://os.zhdk.cloud.switch.ch/chelsav2/GLOBAL/climatologies/1981-2010/"
# chelsa_root <- "https://os.zhdk.cloud.switch.ch/envicloud/chelsa/chelsa_V2/GLOBAL/climatologies/1981-2010/"
paste0(chelsa_root, var_prefix,"/CHELSA_",var_index,"_1981-2010_V.2.1.tif")
}
3 changes: 2 additions & 1 deletion R/filenames_chelsa_trace21k.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ filenames_chelsa_trace21k<- function(dataset, bio_var){
as.numeric(substr(bio_var,nchar(bio_var)-1,nchar(bio_var))))
}
# create file names for a given variable
chelsa_trace_root <- "https://os.zhdk.cloud.switch.ch/envicloud/chelsa/chelsa_V1/chelsa_trace"
#chelsa_trace_root <- "https://os.zhdk.cloud.switch.ch/envicloud/chelsa/chelsa_V1/chelsa_trace"
chelsa_trace_root <- "https://os.zhdk.cloud.switch.ch/chelsav1/chelsa_trace"
file.path(chelsa_trace_root, var_prefix, paste0("CHELSA_TraCE21k_",var_index,"_",yr_id,"_V",version,".tif"))
}

0 comments on commit 644b479

Please sign in to comment.