solarindex | R Documentation |
solarindex
is used to calculate the proportion of direct beam radiation incident on an inclined surface at a specified time and location.
solarindex(
slope = NA,
aspect = NA,
localtime,
lat = NA,
long = 0,
julian,
dtm = array(0, dim = c(1, 1)),
reso = 1,
merid = round(long/15, 0) * 15,
dst = 0,
shadow = TRUE
)
slope |
a single value, SpatRaster object, two-dimensional array or matrix of slopes (º). If an array or matrix, then orientated as if derived using |
aspect |
a single value, SpatRaster object, two-dimensional array or matrix of aspects (º). If an array or matrix, then orientated as if derived using |
localtime |
a single numeric value representing local time (decimal hour, 24 hour clock). |
lat |
a single numeric value representing the mean latitude of the location for which the solar index is required (decimal degrees, -ve south of the equator). |
long |
a single numeric value representing the mean longitude of the location for which the solar index is required (decimal degrees, -ve west of Greenwich meridian). |
julian |
a single integer representing the Julian day as returned by |
dtm |
an optional SpatRaster object, two-dimensional array or matrix of elevations (m). If not a SpatRaster, orientated as if derived from a raster using |
reso |
a single numeric value representing the spatial resolution of |
merid |
an optional numeric value representing the longitude (decimal degrees) of the local time zone meridian (0 for GMT). Default is |
dst |
an optional numeric value representing the time difference from the timezone meridian (hours, e.g. +1 for BST if |
shadow |
an optional logical value indicating whether topographic shading should be considered (TRUE = Yes, FALSE = No). |
If slope
is unspecified, and dtm
is a SpatRaster, slope
and aspect
are calculated from
the raster. If slope
is unspecified, and dtm
is not a SpatRaster, the slope and aspect
are set to zero. If lat
is unspecified, and dtm
is a raster with a coordinate reference
system defined, lat
and long
are calculated from the raster. If lat
is unspecified,
and dtm
is not a raster, or a raster without a coordinate reference system defined, an
error is returned. If dtm
is specified, then the projection system used must be such that
units of x, y and z are identical. Use terra::project()
to convert the projection to a
Universal Transverse Mercator type projection system. If dtm
is a raster object, a raster
object is returned.
If shadow is TRUE
, a SpatRaster object or a two-dimensional array of numeric values representing the proportion of direct beam radiation incident on an inclined surface, accounting for topographic shading.
If shadow is FALSE
, a raster object or a two-dimensional array of numeric values representing the proportion of direct beam radiation incident on an inclined surface, not accounting for topographic shading.
If no dtm
is provided, a vector, array or single numeric value of the proportion of direct beam radiation incident on the inclined surfaces specified by slope
and aspect
, and topographic shading is ignored.
library(terra)
jd <- julday (2010, 6, 21) # Julian day
# slope, aspect, lat & long calculated from raster
si1 <- solarindex(localtime = 8, julian = jd, dtm = rast(dtm1m))
si2 <- solarindex(localtime = 8, julian = jd, dtm = rast(dtm1m), shadow = FALSE)
par(mfrow = c(2, 1))
plot(si1, main = "Solar index with topographic shadowing")
plot(si2, main = "Solar index without topographic shadowing")
ll <- latlongfromraster(rast(dtm1m))
solarindex(0, 0, 8, lat = ll$lat, long = ll$long, jd)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.