Calculation of gridded lapse rates
lapse_rate.Rd
This function computes lapse rates (a linear relationship of a climate variable to elevation) across user-provided rasters.
Lapse rates are calculated using simple linear regression (without the intercept) using the focal cell and its eight neighbors as observations.
These gridded lapse rates are used in downscale()
and downscale_core()
for elevation adjustment of climate values during downscaling to user-specified locations.
The method is illustrated in the vignette vignette("lapse_rates")
Arguments
- reference
a
SpatRaster
stack. climate rasters to compute lapse rates for. Build with this package functions.- dem
SpatRaster
. A digital elevation model raster. Only needed ifnormal
is aSpatRaster
. Defaults toNULL
.- NA_replace
logical. Should NA lapse rate results be replaced by zeros. Default to TRUE.
- nthread
integer. Number of parallel threads to use to compute lapse rates.
- rasterize
logical. Return an object of the same class category as reference with the same extent? Default to
TRUE
.