We’re happy to announce a new release of our ecmwfr
R package, version 1.3.0. This new release comes with some exciting features!
CAMS support
First of all we’ve added support for the ECMWF Atmosphere Data Store (ADS), as provided by the Copernicus Atmosphere Monitoring Service (CAMS) in addition to the current line-up which covers the WebAPI and Climate Data Store (CDS). Although you will need to create a new key in your keyring for the service, the general workflow does not differ from CDS one.
# load the library
library(ecmwfr)
# set your ADS key
wf_set_key(user = "1111",
key = "asfasdf-128242349-asdfasdf-asdfad",
service = "ads")
# format a data query
request <- list(
date = "2019-06-15/2019-06-20",
format = "netcdf",
variable = "dust_aerosol_optical_depth_550nm",
time = "00:00",
dataset_short_name = "cams-global-reanalysis-eac4",
target = "download.nc"
)
# download the data
file <- wf_request(user = "1111",
request = request)
# read in the netcdf and go to work
r <- raster::brick(file)
Below a quick graph of a dust storm blowing over the Atlantic from the Sahara, all the way to the Caribbean (June 15 to 20th 2019). Data was provided by CAMS with all processing done in R (without leaving the environment), as per example above.
Linux keyring management
Second important addition is the long overdue integration of a file based keyring for linux systems. The previous version only supported using environmental variables, which would be lost upon closing an R session. This would lead to repeated input of server credentials at the start of each session. This is especially annoying when running batch processing on a regular basis. This has been solved by using encrypted file based keyring support.
For this option to work linux users must set an environmental option in order to activate the file based keyring.
options(keyring_backend="file")
You will be asked to provide a password to encrypt the keyring with. Upon the start of each session you will be asked to provide this password, unlocking all ecmwfr
credentials for this session. Should you ever forget the password just delete the file at:
~/.config/r-keyring/ecmwfr.keyring
and re-enter all your credentials.
Installation
To install the new release update your current package or use the following command. Please beware that it might take some time for the package to propagate through all CRAN servers.
install.packages("ecmwfr")
library("ecmwfr")