Skip to contents

This function processes CHELSA climate data, with an option to download them first. It processes each variable to the European scale and reference grid, and outputs in TIFF and NetCDF (NC) formats. It also saves grouped data for each of the 46 climate scenarios.

Usage

CHELSA_Process(
  FromHPC = TRUE,
  EnvFile = ".env",
  NCores = 8,
  Download = FALSE,
  Overwrite = FALSE,
  Download_Attempts = 10,
  Sleep = 5,
  OtherVars = "",
  BaseURL = paste0("https://os.zhdk.cloud.switch.ch/envicloud/",
    "chelsa/chelsa_V2/GLOBAL/"),
  Download_NCores = 4,
  CompressLevel = 5,
  OverwriteProcessed = FALSE
)

Arguments

FromHPC

Logical indicating whether the work is being done from HPC, to adjust file paths accordingly. Default: TRUE.

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. Defaults to 8.

Download

Logical, whether to download the CHELSA files. Defaults to FALSE.

Overwrite

Logical, whether to re-download files that already exist. Defaults to FALSE.

Download_Attempts

Integer. The maximum number of download attempts. Defaults to 10.

Sleep

Integer. Time in seconds to wait after each download attempt. Defaults to 5.

OtherVars

Character. First letters of variables other than bioclimatic variables to be processed. Defaults to "npp", which means processing bioclimatic variables (bio1-19) and Net Primary Productivity will be processed. If OtherVars is set to "", only bioclimatic variables will be processed. See CHELSA_Vars for a detailed information on CHELSA climate variables.

BaseURL

String, the base URL for downloading CHELSA climate data.

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; the level of compression to use when saving NetCDF files. Default is 5.

OverwriteProcessed

Logical; whether to overwrite already processed files. Default is FALSE.

Author

Ahmed El-Gabbas