
Focal (stencil) op.
focal.Rdfn receives a LIST of (2r+1)^2 shifted arrays, row-major over
(dy, dx) offsets, and returns one array: the whole neighbourhood is
processed vectorised across every pixel at once. Write fn with
plain arithmetic and the g_* vocabulary (g_ifelse(), g_cast(),
...). Example, a 3x3 sum: function(sh) Reduce("+", sh).
Details
Cells beyond the raster edge are NaN (nodata): v1 supports only this
boundary = "nodata" policy; reflect/wrap are not implemented.
Over a LazyDataset, the stencil is applied to every value band per slice;
bands restricts which bands.