horizonangle: Calculates the tangent of the horizon angle

View source: R/solartools.R

horizonangleR Documentation

Calculates the tangent of the horizon angle

Description

horizonangle is used to calculate the tangent of the angle to the horizon in a specified direction.

Usage

horizonangle(dtm, azimuth, reso = 1)

Arguments

dtm

a 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.

azimuth

a numeric value representing the direction of the horizon as, for example, returned by solazi() (º from north).

reso

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

Details

To enable calculation of horizon angles near the edge of dtm a 100 pixel buffer is of zeros is placed around it. NAs in dtm are converted to zeros. 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

a raster object or two-dimensional array of numeric values representing the tangent of the angle to the horizon in a specified direction.

Examples

library(raster)
ha <- horizonangle(dtm1m, 0)
plot(ha, main = "Tangent of angle to horizon")

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