irradiance: Produce a model of irradiance for an entire study area or...

Description Usage Arguments Details Value

View source: R/light.r

Description

Produce a model of irradiance for an entire study area or selected control points

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
irradiance(
  dem,
  output_points,
  times,
  timezone,
  use_existing = FALSE,
  dem_name = "dem",
  slope_name = "slope",
  aspect_name = "aspect",
  lon_name = "longitude",
  horizon_pars = list(step = 30, bufferzone = 200, maxdistance = 5000, horBaseName =
    "horizonAngle"),
  newSession = FALSE,
  gisBase
)

Arguments

dem

A sp::SpatialGridDataFrame or raster::RasterLayer object giving the digital elevation model of the study area.

output_points

A set out output points; either a sp::SpatialPoints object or a raster mask.

times

A vector of POSIXct objects giving the dates and times at which to compute irradiance. These should be given in local (to the DEM) time

timezone

An integer giving the offset in hours from UTC that applies to the DEM; see the manual for r.sun for details

use_existing

logical, if TRUE then existing slope, aspect, longitute, and horizon rasters will be used, if FALSE then they will be recomputed

dem_name

character; this parameter (and similar name parameters) tell GRASS what names to use for the rasters needed for the analysis; they must exist in the GRASS location/mapset if use_existing == TRUE.

horizon_pars

List of arguments for GRASS74's r.horizon; see the GRASS GIS help files ] if you wish to change the defaults.

newSession

Boolean, if TRUE a new grass session will be started even if one already exists

gisBase

character; the location of the GRASS installation (see WatershedTools::GrassSession)

Details

Requires an existing installation of GRASS7, as well as the rgrass7 package. It is first necessary to run rgrass7::initGRASS. Recommended settings for initGRASS include home = tempdir() and SG = SpatialGrid(dem_gridded). To produce the gridded DEM from a raster, use: dem_gridded <- SpatialPoints(dem) gridded(dem_gridded) <- TRUE

Note that running the light model can be extremely slow for large study areas and/or high-resolution DEMs and/or long time series.

It is strongly recommended to use the output_points argument to set a list of locations at which to compute the output, otherwise memory usage can be extreme. For rasters, output will be returned for all non-NA cells.

Value

A matrix, one row per output point, one column per date/time for computation. Column names are the integer values of the date/time, rownames are the coordinates of the point


mtalluto/NSmetabolism documentation built on May 3, 2021, 7:51 p.m.