invls | R Documentation |
invls
is used to calculate an inverse distance2 weighted ratio of land to sea in a specified upwind direction.
invls(landsea, e, direction)
landsea |
A SpatRast object with NAs (representing sea) or any non-NA value (representing land). The object should have a larger extent than that for which land-sea ratio values are needed, as the calculation requires land / sea coverage to be assessed upwind outside the target area. |
e |
an terra::ext object indicating the region for which land-sea ratios are required. |
direction |
an optional single numeric value specifying the direction (decimal degrees) from which the wind is blowing. |
This function calculates a coefficient of the ratio of land to
sea pixels in a specified upwind direction, across all elements of a
SpatRaster object, weighted using an inverse distance squared function,
such that nearby pixels have a greater influence on the coefficient.
It returns a SpatRaster object representing values ranging between zero
(all upwind pixels sea) to one (all upwind pixels land). Upwind
direction is randomly varied by ± jitter.amount
degrees.
a SpatRaster object with distance-weighted proportions of upwind land pixels
library(terra)
ls1 <- invls(rast(dtm100m), ext(rast(dtm1m)), 180)
ls2 <- invls(rast(dtm100m), ext(rast(dtm1m)), 270)
par(mfrow=c(2,1))
plot(ls1, main = "Land to sea weighting, southerly wind")
plot(ls2, main = "Land to sea weighting, westerly wind")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.