Process CHELSA Climate Data for the IAS-pDT
Source: R/DWF_CHELSA_Process.R
, R/DWF_CHELSA_Prepare.R
, R/DWF_CHELSA_Project.R
CHELSA_data.Rd
Downloads, processes, and projects CHELSA
climate data at the European scale for the Invasive Alien Species prototype
Digital Twin (IAS-pDT
). Supports multiple climate scenarios, outputting
data in TIFF and NetCDF formats. Orchestrated by CHELSA_Process()
, with
helper functions CHELSA_Prepare()
and CHELSA_Project()
.
Usage
CHELSA_Process(
EnvFile = ".env",
NCores = 8L,
Download = FALSE,
Overwrite = FALSE,
Download_Attempts = 10L,
Sleep = 5L,
OtherVars = "npp",
Download_NCores = 4,
CompressLevel = 5,
OverwriteProcessed = FALSE
)
CHELSA_Prepare(
EnvFile = ".env",
Download = FALSE,
NCores = 8L,
Overwrite = FALSE,
Download_Attempts = 10L,
Sleep = 5L,
OtherVars = "npp"
)
CHELSA_Project(Metadata = NULL, EnvFile = ".env", CompressLevel = 5)
Arguments
- EnvFile
Character. Path to the environment file containing paths to data sources. Defaults to
.env
.- NCores
Integer. Number of CPU cores to use for parallel processing. Default: 8.
- Download
Logical. If
TRUE
, downloads CHELSA files. Default:FALSE
.- Overwrite
Logical. If
TRUE
, re-downloads existing files. Default:FALSE
.- Download_Attempts
Integer. Maximum download retries. Default:
10
.- Sleep
Integer. Seconds to wait between download attempts. Default:
5
.- OtherVars
Character. Additional variables to process (e.g.,
"npp"
for Net Primary Productivity alongside 19 bioclimatic variables bio1-bio19). Use""
for bioclimatic only. See CHELSA_Vars for details. Default:"npp"
.- Download_NCores
Integer. Number of CPU cores to use for parallel downloading of CHELSA data. Only valid if Download =
TRUE
. Defaults to 4.- CompressLevel
Integer. NetCDF compression level (1 = least, 9 = most). Default:
5
.- OverwriteProcessed
Logical. If
TRUE
, overwrites processed files. Default:FALSE
.- Metadata
Tibble. Single-row metadata for input files, prepared by
CHELSA_Prepare()
Note
CHELSA_Prepare()
andCHELSA_Project()
are internal helpers, not for direct use.Processes 19 bioclimatic variables (bio1–bio19) plus optional variables (e.g., NPP) for 46 scenarios (1 current, 45 future).
Time-intensive; depends on file size and compute resources.
Functions details
CHELSA_Process()
: Main function; optionally downloads CHELSA data, processes it to the European scale and reference grid, and saves TIFF and NetCDF outputs for 46 climate scenarios.CHELSA_Prepare()
: Extracts metadata from local URL text files and manages optional downloads.CHELSA_Project()
: Projects data to the IAS-pDT reference grid with optional transformations.