A solar data animation is supplied to assess quality, spatial and time series dimensions:
- The quality dimension is a function of the availability of different sunlight components: Global Horizontal Irradiance (GHI), Direct Normal Irradiance (DNI), and Diffuse Horizontal Irradiance (DHI).
- The spatial dimension is a function of sunlight availability across the x/y plane (e.g. longitude/latitude). Meanwhile, solar production for any location is also a function of whether the solar collection plane is a fixed surface, has single axis tracking along the North/South meridian, or dual axis tracking in all directions to ensure the collection plane is perpendicular to the Sun at all times.
- Finally, the time series dimension defines the time granularity of the sunlight profile, be it monthly, daily, hourly, or smaller.
The ability to quickly decipher quality, spatial and time series trends is essential. For example, solar data is used to anticipate solar energy production, grid integration, and supply imbalances. Trend analysis is challenged since solar related data for commercial applications is getting larger and larger, the demand for results is getting faster and faster, and the ambitions to exploit solar opportunities are becoming greater and greater.
The need to assess trends by dimension should not be delegated to a “black box,” especially when hundreds of millions are being bet on the solar resource. The ability to achieve control and to integrate solar data across the value chain is possible with data science tools like R. Within R, there are two closely related, but distinct, products to visualize data with multiple dimensions: lattice graphics and data animations.
Lattice graphics are a core capability in R that is bundled into the grid package. One of its features is to provide multi-plot layouts in a lattice or matrix format. The dimensions of the matrix plot must be configured to correspond to the dimensions in the solar data to allow trends to be visible. Data animations in R are supported by the package extension animation, working in combination with external command line tools like ImageMagick. Data animations integrate all frames across a lattice into a single image file, easily capturing the dimensionality in solar data.
To illustrate the point, the following plot is created to depict annual irradiance across the globe. Satellite data observations are averaged for each pixel, using daily data over 22 years.
The units of measure is kW/m^2/day. The image supports a quick “eye ball” exercise in spatial analysis, but the analysis is incomplete since the long-term average masks significant variability by month and by location.
A series of plots arranged in a matrix, where each image depicts the solar resource by location and by month, would clearly reveal variability by time. The problem with muti-plot layouts is that eye quickly tires trying to decipher trends across multiple images and dimensions.
A solar data animation is a better approach. The animation below easily illustrates the variability by location and time that is missing in the simple plot of mean insolation:
Click to enlarge
By controlling the loop rate of the animation, variability can be studied carefully and according to the preference of each user.
The data and R source code that generated these plots is provided below. Ignore all the comments and you see that animations can be created with just a few lines of code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# Header ---- # # Name: SolarAnimate.R # Title: Solar Insolation Maps # Version: 1.0 # Date: 2013-Oct-27 # Author: bxhorn # License: GPL (>=2) # # Description: The Atmospheric Science Data Center (ASDC) at # NASA Langely Research offers several sources of solar data. # R code loads a text file from ASDC with average daily GHI # (kw/m^2/day). Daily data is converted to monthly averages by # location over an averaging period of 22-years (July 1983 to # June 2005). The spatial resolution of the data is low at # 1-degree longitude by 1-degree latitude, or roughly 55 # miles by 60 miles for GCC countries at 25-degrees latitude. # Low time and spatial resolution is chosen by design to minimize # code run-time and to facilitate delivery of animated global # scale maps by month. # # Details: Change file path references for local implementaion # # Dev.Notes: NA # References: https://eosweb.larc.nasa.gov/sse/ # Source data file: global_radiation # 0.Initialize Code ----- # Load libraries and DLLs library(animation) library(sp) library(maps) library(mapdata) library(maptools) library(RColorBrewer) # Configure devices and workspace options(prompt = "R> ", width = 125, digits = 6, scipen = 3) # 1.Mannually download NASA solar data and read into R ---- nasafile <- "/Users/bjh/Desktop/Website/global_radiation" nasa <- read.table(file = nasafile, header = TRUE, skip = 13) # 2.Set up coordinate system, map objects and palette ---- # Spatial data object definition proj <- CRS('+proj=latlon +ellps = WGS84') coords = nasa[, 2:1] datos = nasa[, 3:15] nasaSP <- SpatialPixelsDataFrame(points = coords, data = datos, proj4string = proj) # Map definition world <- map("world", plot = FALSE) llCRS <- CRS("+proj = latlong +ellps = WGS84") world_sp <- map2SpatialLines(world, proj4string = llCRS) map_sp <- list('sp.lines', world_sp) # Color palette and annual average plot color_sp=colorRampPalette(c("snow1", "thistle1", "plum2", "red4")) spplot(nasaSP["Ann"], col.regions = color_sp, sp.layout = map_sp, main="Average Annual Global Horizontal Irradiance", sub = "Atmospheric Science Data Center (ASDC) at NASA Langely Research") # 3.Create animation of monthly maps ---- # Change working directory to picture directory home <- getwd() setwd("/Users/bjh/Desktop/Website/R-Proj/Solar1/pics") # Create world map by month png(file = "solarmap%03d.png", width = 900, height = 450) for (i in 1:length(month.abb)){ print(spplot(nasaSP[month.abb[i]], col.regions = color_sp, sp.layout = mapa_sp, main="Average Annual Global Horizontal Irradiance", sub = "Atmospheric Science Data Center (ASDC) at NASA Langely Research")) } dev.off() setwd("home") # Create animation .gif file # Launch external ImageMagick application system("convert - delay 120 *.png solar.gif") [/code] |