I have several locations in longitude and latitude coordinates and I need to get an estimate of solar radiation for each location.
I found data from NASA that has exactly this information in a 1 degree x 1 degree resolution.
nasafile <- 'http://eosweb.larc.nasa.gov/sse/global/text/global_radiation'
nasa <- read.table(file=nasafile, skip=13, header=TRUE)
head(nasa)
Lat Lon Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec Ann
1 -90 -180 9.63 5.28 0.75 0 0 0 0 0 0.1 3.24 8.28 10.97 3.19
2 -90 -179 9.63 5.28 0.75 0 0 0 0 0 0.1 3.24 8.28 10.97 3.19
3 -90 -178 9.63 5.28 0.75 0 0 0 0 0 0.1 3.24 8.28 10.97 3.19
4 -90 -177 9.63 5.28 0.75 0 0 0 0 0 0.1 3.24 8.28 10.97 3.19
5 -90 -176 9.63 5.28 0.75 0 0 0 0 0 0.1 3.24 8.28 10.97 3.19
6 -90 -175 9.63 5.28 0.75 0 0 0 0 0 0.1 3.24 8.28 10.97 3.19
As you can see, it has monthly data as well as an mean annual average for a paticular lat/lon coordinate in by 1 degrees.
If I convert this to a SpatialPixelsDataFrame
object:
proj <- CRS('+proj=latlon +ellps=WGS84')
coords <- nasa[,2:1]
data <- nasa[,3:15]
nasaSP <- SpatialPixelsDataFrame(points=coords, data=data, proj4string=proj)
I would like to know how to extract the annual value for a particular latitude and longitude coordinate.
I have no experience in geographic data analysis and I have been following this post: https://www.r-bloggers.com/maps-of-solar-radiation/ , but the point of it was to get a map and I just need to extract particular values and don't know how to do it.