solarindex: Calculates the solar index

View source: R/solartools.R

solarindexR Documentation

Calculates the solar index

Description

solarindex is used to calculate the proportion of direct beam radiation incident on an inclined surface at a specified time and location.

Usage

solarindex(
  slope = NA,
  aspect,
  localtime,
  lat = NA,
  long,
  julian,
  dtm = array(0, dim = c(1, 1)),
  reso = 1,
  merid = round(long/15, 0) * 15,
  dst = 0,
  shadow = TRUE
)

Arguments

slope

a single value, raster object, two-dimensional array or matrix of slopes (º). If an array or matrix, then orientated as if derived using is_raster(). I.e. ⁠[1, 1]⁠ is the NW corner.

aspect

a single value, raster object, two-dimensional array or matrix of aspects (º). If an array or matrix, then orientated as if derived using is_raster(). I.e. ⁠[1, 1]⁠ is the NW corner.

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 julday().

dtm

an optional raster object, two-dimensional array or matrix of elevations (m). If not a raster, orientated as if derived from a raster using is_raster(). I.e. ⁠[1, 1]⁠ is the NW corner.

reso

a single numeric value representing the spatial resolution of dtm (m).

merid

an optional numeric value representing the longitude (decimal degrees) of the local time zone meridian (0 for GMT). Default is round(long / 15, 0) * 15

dst

an optional numeric value representing the time difference from the timezone meridian (hours, e.g. +1 for BST if merid = 0).

shadow

an optional logical value indicating whether topographic shading should be considered (TRUE = Yes, FALSE = No).

Details

If slope is unspecified, and dtm is a raster, slope and aspect are calculated from the raster. If slope is unspecified, and dtm is not a raster, 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 projectRaster() to convert the projection to a Universal Transverse Mercator type projection system. If dtm is a raster object, a raster object is returned.

Value

If shadow is TRUE, a raster 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.

See Also

the raster package function terrain() can be used to derive slopes and aspects from dtm (see example).

Examples

library(raster)
jd <- julday (2010, 6, 21) # Julian day
# slope, aspect, lat & long calculated from raster
si1 <- solarindex(localtime = 8, julian = jd, dtm = dtm1m)
si2 <- solarindex(localtime = 8, julian = jd, dtm = 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(dtm1m)
solarindex(0, 0, 8, lat = ll$lat, long = ll$long, jd)

ilyamaclean/microclima documentation built on Oct. 31, 2023, 11:41 p.m.