Skip to contents

Project Status: Active – The project has reached a stable, usable state and is being actively developed. Travis-CI Build Status

camsRad is a R client for CAMS Radiation Service. CAMS Radiation Service provides time series of global, direct, and diffuse irradiations on horizontal surface, and direct irradiation on normal plane for the actual weather conditions as well as for clear-sky conditions. The geographical coverage is the field-of-view of the Meteosat satellite, roughly speaking Europe, Africa, Atlantic Ocean, Middle East (-66° to 66° in both latitudes and longitudes). The time coverage of data is from 2004-02-01 up to 2 days ago. Data are available with a time step ranging from 15 min to 1 month. Target audience are researchers, developers and consultants in need of high resolution solar radiations time series.

Quick start


Dev version from GitHub.

# CRAN version

# Or Github version
if (!require('devtools')) install.packages('devtools')


To access the CAMS Radiation Service you need to register at The email you use at the registration step will be used for authentication, and need to be set with cams_set_user().

# Authentication
cams_set_user("") # An email registered at

Example 1

Get hourly CAMS solar data into a R data frame. For the location 60° latitude and 15° longitude, and for period 2016-01-01 to 2016-01-15.

df <- cams_get_radiation(
  lat=60, lng=15, 

Example 2

Retrieve daily CAMS solar data in netCDF format. You need to have the ncdf4 package installed.


filename <- paste0(tempfile(), ".nc")

r <- cams_api(
  60, 15, "2016-06-01", "2016-06-10", 
  time_step = "P01D",

# Access the on disk stored ncdf4 file 
nc <- nc_open(filename)

# list names of available variables

# create data.frame with timestamp and global horizontal irradiation and plot it
df <- data.frame(
  timestamp = as.POSIXct(nc$dim$time$vals, "UTC", origin="1970-01-01"),
  GHI = ncvar_get(nc, "GHI"))

plot(df, type="l")



doesn´t knit. add following to the .md file