<p><div><div><div><div data-width="100" data-show-faces="false" data-send="true" data-layout="button_count" data-height="21" data-href="https://www.r-bloggers.com/camsrad-satellite-based-time-series-of-solar-irradiation/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://ropensci.org/blog/blog/2017/03/21/camsrad"> rOpenSci Blog</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p><a target="_blank" rel="nofollow" href="https://github.com/ropenscilabs/camsRad"><code>camsRad</code></a> is a lightweight R client for the <a target="_blank" rel="nofollow" href="http://www.soda-pro.com/web-services/radiation/cams-radiation-service">CAMS Radiation Service</a>, that provides satellite-based time series of solar irradiation for the actual weather conditions as well as for clear-sky conditions. Satellite-based solar irradiation data have been around roughly as long our modern era satellites. But the price tag has been very high, in the range of several thousand euros per site. This has damped research and development of downstream applications. With CAMS Radiation Service coming online in 2016, this changed as the services are provided under the (not yet fully implemented) European Union stand point that data and services produced with public funding shall be provided on free and open grounds. The service is part of <a target="_blank" rel="nofollow" href="http://www.copernicus.eu/">Copernicus</a>, a European Union programme aimed at developing information services based on satellite earth observation and in situ data. All Copernicus information services are free and openly accessible.</p>
<h2>Satellite-based solar irradiation data</h2>
<p>The main groups of users are planners and managers of solar energy systems; architects and building engineers; researchers in renewable energies and building engineering. Surface solar irradiation is relatively cumbersome and expensive to retrieve by ground observation. Therefore, a satellite-based modelling approach can in many cases be a more feasible option. These approaches build-upon the principle that pixels in satellite images of clouds (target 2 in figure below) appear brighter/whiter than pixels of ground (target 1). For more thorough description on underlying theory and technical details, head to the <a target="_blank" rel="nofollow" href="http://www.soda-pro.com/web-services/radiation/cams-radiation-service/info">user guide and articles</a>. CAMS Radiation Service is jointly developed and provided by DLR, Armines and Transvalor.</p>
<figure>
<img src="https://i1.wp.com/ropensci.org/assets/blog-images/2017-03-21-camsRad/sat_solar_radiation_illustration.png?w=456" data-recalc-dims="1">
<figcaption>Illustration on using satellite images to determine level of cloudiness. Source: <a target="_blank" rel="nofollow" href="https://atmosphere.copernicus.eu/sites/default/files/repository/MACCIII_RAD_DEL_D57.5_final_0.pdf">MACC-III Deliverable D57.5</a>  <a target="_blank" rel="nofollow" href="https://rokka.shinyapps.io/shinyweatherdata">Check out the Shiny app</a></figcaption>
</figure>
<h2>The camsRad package</h2>
<p>In a perfect world, this package would be unnecessary. Accessing data and web services should be easy, a procedure so standardized that anyone with a bit of programming experience should be able to achieve this with a few lines of code. I´ve worked with quite a few web API, but still haven´t encountered two of the same kind. It always requires time and effort familiarizing yourself with the concept of communication, formatting etc. That there exist numerous ways of disseminating data can be seen at the <a target="_blank" rel="nofollow" href="https://ropensci.org/packages">rOpenSci packages listing</a>, where roughly half of the listed packages are categorized as data access packages.</p>
<p>The CAMS Radiation Service uses a so-called <a target="_blank" rel="nofollow" href="http://www.opengeospatial.org/standards/wps">Web Process Service (WPS)</a> interface. WPS provides standardizing for geospatial processing services. It requires you to make a <code>POST</code> requests carrying a XML formatted payload that specifies how the service is invoked. As I wanted to have a thorough and reliable R-client and though other users could have use of it, I decided to make it a public R-package and submit it to the rOpenSci for review. I think I´m a quite typical aspiring R developer, mostly self-learned programmer with a non-computer science degree. Another, a bit selfish, motive for submitting was that I thought it would be a good learning ground to adopt a more formal R-development style. And yes, I learned a lot! A big thank you to reviewer <a target="_blank" rel="nofollow" href="https://github.com/jhollist">Jeffrey Hollister</a> and editor <a target="_blank" rel="nofollow" href="https://github.com/sckott">Scott Chamberlain</a>. The biggest change after the review, was getting rid of package dependencies to get a more lightweight package and to decrease the risk of breakage when upstream packages get updated.</p>
<p>The core of the camsRad package is the <a target="_blank" rel="nofollow" href="https://github.com/ropenscilabs/camsRad/blob/master/R/cams_api.R"><code>cams_api</code></a> function which interfaces the WPS of the CAMS Radiation Service. It can be of interest for anyone wanting to call CAMS Radiation Service from other languages than R, or for those that want to invoke other WPS based web services from R. The two convenience functions <code>cams_get_radiation</code> and <code>cams_get_mcclear</code> are for those of you that just want to get the data into a R data frame with a little hassle as possible. Check the <a target="_blank" rel="nofollow" href="https://cran.r-project.org/web/packages/camsRad/vignettes/CAMS_solar_data.html">vignette</a> and <a target="_blank" rel="nofollow" href="https://github.com/ropenscilabs/camsRad/blob/master/README.md">readme file</a> for further instructions and examples.</p>
<h2>My use cases</h2>
<p><a target="_blank" rel="nofollow" href="https://rokka.shinyapps.io/shinyweatherdata">Shiny Weather Data</a> is a web service making different sources of European gridded climate data available in hourly time series formats used by common building performance modeling tools. This web service has been around for a while and has a steadily growing user group of professional building modelers as well as students and researchers.</p>
<p><a target="_blank" rel="nofollow" href="https://rokka.shinyapps.io/shinyweatherdata"><br>
<img src="https://i2.wp.com/ropensci.org/assets/blog-images/2017-03-21-camsRad/screenshot_ShinyWeatherData.png?w=456" data-recalc-dims="1"><br>
</a></p>
<hr>
<p><a target="_blank" rel="nofollow" href="https://rokka.shinyapps.io/smartep">Smart Energy Modeler</a> demonstrates how modeled climate data can be used to calibrate simple building models with utility bill data. This is a dissemination from my research as a PhD Candidate at Mälardalen University, Sweden. It´s in an early stage of development, but a nice showcase of how access to open climate data enables data-driven application that solves real world-problems.</p>
<p><a target="_blank" rel="nofollow" href="https://rokka.shinyapps.io/smartep"><br>
<img src="https://i2.wp.com/ropensci.org/assets/blog-images/2017-03-21-camsRad/screenshot_SmartEnergyModeler.png?w=456" data-recalc-dims="1"><br>
</a></p>
<h2>Future development</h2>
<p>The CAMS Radiation Service relies on images from the Metosat satellite which is located at the at the prime meridian of 0° longitude (covering Europe, Africa and Middle East). I´ve started a <a target="_blank" rel="nofollow" href="https://github.com/ropenscilabs/camsRad/issues/2">GitHub issue</a> about alternative data sources. So, please, let me know if you know any sources of open and free, high resolution solar radiation data based on images from satellites above America and Asia.</p>
<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="http://ropensci.org/blog/blog/2017/03/21/camsrad"> rOpenSci Blog</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a title="The R Project for Statistical Computing" rel="nofollow" href="https://www.r-project.org/">R</a> news and <a title="R tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/tutorial">tutorials</a> on topics such as: <a title="Data science" rel="nofollow" href="https://www.r-bloggers.com/search/data%20science">Data science</a>, <a title="Big Data" rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data">Big Data, <a title="R jobs" rel="nofollow" href="https://www.r-users.com/">R jobs</a>, visualization (<a title="ggplot and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2">ggplot2</a>, <a title="Boxplots using lattice and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/boxplot">Boxplots</a>, <a title="Maps and gis" rel="nofollow" href="https://www.r-bloggers.com/search/map">maps</a>, <a title="Animation in R" rel="nofollow" href="https://www.r-bloggers.com/search/animation">animation</a>), programming (<a title="RStudio IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/RStudio">RStudio</a>, <a title="Sweave and literate programming" rel="nofollow" href="https://www.r-bloggers.com/search/sweave">Sweave</a>, <a title="LaTeX in R" rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX">LaTeX</a>, <a title="SQL and databases" rel="nofollow" href="https://www.r-bloggers.com/search/SQL">SQL</a>, <a title="Eclipse IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/eclipse">Eclipse</a>, <a title="git and github, Version Control System" rel="nofollow" href="https://www.r-bloggers.com/search/git">git</a>, <a title="Large data in R using Hadoop" rel="nofollow" href="https://www.r-bloggers.com/search/hadoop">hadoop</a>, <a title="Web Scraping of google, facebook, yahoo, twitter and more using R" rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping">Web Scraping</a>) statistics (<a title="Regressions and ANOVA analysis tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/regression">regression</a>, <a title="principal component analysis tutorial" rel="nofollow" href="https://www.r-bloggers.com/search/PCA">PCA</a>, <a title="Time series" rel="nofollow" href="https://www.r-bloggers.com/search/time+series">time series</a>, <a title="finance trading" rel="nofollow" href="https://www.r-bloggers.com/search/trading">trading</a>) and more...
<img height="1" alt="" width="1" src="http://feeds.feedburner.com/~r/RBloggers/~4/aKQk6E1EOIc"></a></div>