Create a focal ("moving window") weight matrix for use in
terra::focal().
mw_create(r, radius)SpatRaster.
radius of the circle (in units of the crs).
Martin Haringa
mw_create() is a modified version of
terra::focalMat(). While terra::focalMat() creates a matrix
where the border is the distance from the center of the focal cell,
mw_create() creates a matrix where the border of the moving window
is the distance from the edge of the focal cell.