pcad | R Documentation |
pcad
calculates the expected temperature differences resulting from cold air
drainage.
pcad(dem, basins, fa, tc, h, p = 101300, out = "cadp")
dem |
a SpatRaster object of elevation (m). |
basins |
a SpatRaster object, two-dimensional array or matrix with basins numbered as integers as returned by |
fa |
a SpatRaster object of accumulated flow, as returned by |
tc |
a single numeric value, raster object, two-dimensional array or matrix of values with the dimensions as |
h |
a single numeric value, raster object, two-dimensional array or matrix of values with the dimensions as |
p |
an optional single numeric value, raster object, two-dimensional array or matrix of values with the dimensions as |
out |
specifies the type of output to provide (see details). Possible values are "cadp", "tempdif" and "pflow". |
To derive expected temperature differences, pcad
calculates the
difference difference in elevation between each point and the highest in the
basin and multiplies this by the lapse rate. Accumulated flow is calculated
using flowacc()
, logarithmically transformed and expressed as proportion of
the maximum in each basin as an indication of each locations potential to
experience cold air drainage. Cold air flow is possible over shallow
boundaries, basins
is best derived using basinmerge()
.
Warning: function is quite slow on large datasets.
a raster object:
out = "tempdif"
the expected temperature difference (ºC).
out = "pflow"
the accumulated flow logairthmically transformed expressed as a proportion of the maximum in each basin.
out = "cadp"
(the default)the expected temperature difference x the proportion of accumulated flow.
library(terra)
basins <- basindelin(rast(dtm100m), boundary = 2)
h <- humidityconvert(50, intype = "relative", 20)$specific
fa <- flowacc(rast(dtm100m), basins)
cp1 <- pcad(rast(dtm100m), basins, fa, 20, h)
cp2 <- pcad(rast(dtm100m), basins, fa, 20, h, out = "tempdif")
cp3 <- pcad(rast(dtm100m), basins, fa, 20, h, out = "pflow")
par(mfrow=c(1, 3))
plot(cp3, main = "Accumulated flow proportion")
plot(cp2, main = "Expected temperature difference")
plot(cp1, main = "Cold air drainage potential")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.