wind.shelter
is a function to be used with focal.function()
to calculate a topographic wind shelter index from a digital elevation model, which is a proxy for snow accumulation on the lee side of topographic obstacles. wind.shelter.prep
performs some preparatory calculations to speed up repeated calls to wind.shelter
.
wind.shelter(x, prob = NULL, control)wind.shelter.prep(radius, direction, tolerance, cellsize = 90)
The function wind.shelter
returns the wind shelter index as described above if a numeric matrix x
is provided. If it is missing, it returns the character string "windshelter"
.
wind.shelter.prep
returns a list with components mask
and dist
. Both are square matrices with 2*(ceiling(radius)+1)
columns and rows:
indicates which grid cell in the moving window is within the specified circle segment (value FALSE
) or not (TRUE
)
the precomputed distances of a grid cell to the center of the moving window, in map units
square matrix of elevation data
numeric: quantile of slope values to be used in computing the wind shelter index; if NULL
, use max
(equivalent to prob=1
)
required argument: the result of a call to wind.shelter.prep
radius (>1) of circle segment to be used (number of grid cells, not necessarily an integer)
wind direction: direction from which the wind originates; North = 0 = 2*pi
, clockwise angles.
directional tolerance
grid cellsize
Alexander Brenning
wind.shelter
implements a wind shelter index used by Plattner et al. (2004) for modeling snow accumulation patterns on a glacier in the Austrian Alps. It is a modified version of the algorithm of Winstral et al. (2002). The wind shelter index of Plattner et al. (2004) is defined as:
Shelter index(S) = arctan( max( (z(x0)-z(x)) / |x0-x| : x in S ) ),
where S = S(x0,a,da,d)
is the set of grid nodes within a distance <=d
from x0
, only considering grid nodes in directions between a-da
and a+da
from x0
.
The present implementation generalizes this index by replacing max
by the quantile
function; the max
function is used if prob=NULL
, and the same result is obtained for prob=1
using the quantile
function.
Plattner, C., Braun, L.N., Brenning, A. (2004): Spatial variability of snow accumulation on Vernagtferner, Austrian Alps, in winter 2003/2004. Zeitschrift fuer Gletscherkunde und Glazialgeologie, 39: 43-57.
Winstral, A., Elder, K., Davis, R.E. (2002): Spatial snow modeling of wind-redistributed snow using terrain-based parameters. Journal of Hydrometeorology, 3: 524-538.
focal.function()
, quantile()
# Settings used by Plattner et al. (2004):
ctrl = wind.shelter.prep(6,-pi/4,pi/12,10)
if (FALSE) focal.function("dem.asc",fun=wind.shelter,control=ctrl,
radius=6,search.mode="circle")
Run the code above in your browser using DataLab