R Library to access SolarDB - a time series database for solar radiation and meteorological data from the Indian Ocean Solar Network (IOSnet).
This package provides functions to query and analyze data from multiple monitoring stations across South West Indian Ocean (SWIO), including:
🌞 Solar radiation measurements:
- GHI (Global Horizontal Irradiance)
- DHI (Diffuse Horizontal Irradiance)
- DNI (Direct Normal Irradiance)
🌡️ Meteorological data:
- TA (Temperature)
- RH (Relative Humidity)
- PA (atmospheric pressure)
- WS & WD (Wind speed & direction)
For more information visit https://galilee.univ-reunion.fr 🔍
Please install first the devtools library :
install.packages("devtools")Then install package rSolarDB from Github :
devtools::install_github("LE2P/rSolarDB")You will also need a token to allow access data, please use the register method at https://solardb.univ-reunion.fr to register and obtain a token by email.
OPTIONAL : You can first configure the ~/.Renviron file in your home directory
to allow rSolarDB package to know your authentication token. If set, the package
will automatically launch login() on package load.
solardb_token=YOURTOKENHEREsdb_login()
# OR without configure .Renviron
sdb_login(token="PUTYOURTOKENHERE")sdb_status()sdb_logout()sdb_sites()sdb_types()sdb_sensors()
sdb_sensors(sites="leportbarbusse")Get raw data from SolarDB (date store into string):
# Last 7 days on Piton des Neiges and Saint Louis Jean Joly
d <- sdb_data(sites = "saintlouisjeanjoly,pitondesneiges", start = "-7d", type = "GHI")
d$saintlouisjeanjoly$GHI_pr01_Avg$values |> plot(type='l')
d$pitondesneiges$GHI_qu01_Avg$values |> lines(type='l', col=2)Get data from SolarDB using time series library Xts :
d <- sdb_data(sites = "pitondesneiges", start = "-7d", type = "GHI,DHI", format = "xts")
plot(d$pitondesneiges$GHI_qu01_Avg)
lines(d$pitondesneiges$DHI_qu01_Avg, col = '2')Plot Xts data using dygraph :
library(dygraphs)
dd <- cbind(d$pitondesneiges$DHI_qu01_Avg, d$pitondesneiges$GHI_qu01_Avg)
dygraph(dd) |> dyRangeSelector()Get data into data.table format :
iosnet <- c("amitie", "anseboileau", "antananarivo", "diego", "hahaya", "ouani", "reservetortues", "vacoas")
d <- sdb_data(sites = iosnet, types = "GHI,DHI", format="data.table")
dsdb_campaigns()
sdb_campaigns(territory = "Mauritius")sdb_measures()
sdb_measures(type="DHI")
sdb_measures(type="DHI", nested=TRUE)sdb_instruments()sdb_models()
sdb_models(type = "Meteorological")Shiny app to plot a calendar with count of missing data for each day. To launch app :
sdb_shiny_missings()The following functions are deprecated and will be removed in future versions:
sites()-> usesdb_sites()insteadtypes()-> usesdb_types()insteadsensors()-> usesdb_sensors()insteadgetData()-> usesdb_data()insteadgetXtsData()-> usesdb_data(format = "xts")insteadgetDtData()-> usesdb_data(format = "data.table")insteadgetDataCountByDay()-> usesdb_daily_counts()insteadgetBounds()-> usesdb_bounds()insteadregister()-> usesdb_register()insteadlogin()-> usesdb_login()insteadlogout()-> usesdb_logout()insteadinstruments()-> usesdb_instruments()insteadmeasures()-> usesdb_measures()insteadmodels()-> usesdb_models()insteadmissings()-> usesdb_shiny_missings()instead
All deprecated functions will display a warning message when used. Please update your code to use the new function names with the sdb_ prefix.