cdsDownload: Download of the climate data.

View source: R/cdsDownload.R

cdsDownloadR Documentation

Download of the climate data.

Description

Create a .nc file, containing the mean temperature and precipitation records of a defined location, downloaded from the ECMFWR "ERA-5 Land monthly averaged data", via the Copernicus CDS API. Before using, the registration to the Copernicus CDS site is required (https://cds.climate.copernicus.eu/#!/home) as well as the acceptance of the terms and conditions here: https://cds.climate.copernicus.eu/cdsapp/#!/terms/licence-to-use-copernicus-products.

Usage

cdsDownload(U_ID, API_Key, lat, lon, sPath = getwd(), site_id = "")

Arguments

U_ID

The user ID for the authentication in the Copernicus CDS service (string)

API_Key

The key needed to make an API request (string)

lat

The latitude of the site of interest, expressed in decimals with a single decimal digit. For southing latitude values use a negative number (integer)

lon

The longitude of the site of interest, expressed in decimals with a single decimal digit. For westing longitude values, use a negative number (integer)

sPath

The path of the directory where the file is going to be saved (string)

site_id

Set as empty, it is a string where it is possible to insert the study area id, which will be reported in the file name

Examples

## Not run: 
user_id <- "39434" #example not working user id
user_key <- "0683788m-2136-2716-61g9-g4b97f8e4l1b" #example not working key
N <- 44.3
E <- 11.2
cdsDownload(U_ID = user_id, API_Key = user_key, lat = N, lon = E, sPath = dir, site_id = "")

## End(Not run)

uchiavetta/foreMast documentation built on July 21, 2023, 3:19 p.m.