solarpos2: Calculate solar position(s) for location and time

Description Usage Arguments Value Examples

View source: R/solarpos2.R

Description

This is a wrapper function around maptools::solarpos, adapted for accepting location as a Spatial* layer or a Raster. The function calculates layer centroid, transforms it to lon-lat, then calls maptools::solarpos to calculate solar position(s) for that point at the given time(s)

Usage

1
solarpos2(location, time)

Arguments

location

A Spatial* or a Raster object

time

A SpatialLines* or a SpatialPolygons* object

Value

A matrix with two columns representing sun position(s); first column is the solar azimuth (in decimal degrees from North), second column is sun elevation (in decimal degrees); rows represent different times corresponding to time

Examples

1
2
3
time = as.POSIXct("2004-12-24 13:30:00", tz = "Asia/Jerusalem")
proj4string(build) = CRS("+init=epsg:32636")
solarpos2(build, time)

shadow documentation built on March 15, 2021, 1:07 a.m.

Related to solarpos2 in shadow...