Learn R Programming

envirem (version 2.3)

ETsolradRasters: Extraterrestrial Solar Radiation

Description

Generate monthly extraterrestrial solar radiation rasters.

Usage

ETsolradRasters(rasterTemplate, year, outputDir = NULL, ...)

Value

If outputDir = NULL, a RasterStack is returned. Otherwise, rasters are written to disk in the designated directory, and nothing is returned. Naming of the layers uses the tag specified via assignNames.

Arguments

rasterTemplate

any rasterLayer that can be used to extract extent, resolution, projection, etc.

year

The year solar radiation should be calculated for. See details.

outputDir

destination directory for rasters, can be NULL

...

additional arguments passed to writeRaster

Author

Pascal Title

Details

Given the latitude values of the cells found in the raster template and the year, monthly extraterrestrial solar radiation can be calculated, using the palinsol R package. year = 0 corresponds to 1950. Although the year can take on any value, it should match the time period of the other rasters that will be used for generating ENVIREM variables. Suggestions would be year = 40 for the present, year = -6000 for the mid Holocene, and year = -21500 for the LGM.

If you are having problems with this function and the rasterTemplate is not in long/lat, try with an unprojected long/lat raster.

References

J. Laskar et al., A long-term numerical solution for the insolation quantities of the Earth, Astron. Astroph., 428, 261-285 2004.

Examples

Run this code
# \donttest{
# Find example rasters
rasterFiles <- list.files(system.file('extdata', package='envirem'), full.names=TRUE)
env <- stack(rasterFiles)

# set aside a template raster
template <- env[[1]]

# generate solar radiation for the present
solrad <- ETsolradRasters(template, year = 40, outputDir = NULL)

# }

Run the code above in your browser using DataLab