kernelscalingdetails: Determines the upscaling factor, the realized tilesize, and...

View source: R/kernelscalingedetails.R

kernelscalingdetailsR Documentation

Determines the upscaling factor, the realized tilesize, and the required buffer used by gaussiansmooth and kernelsmooth when coarsening grids to increase efficiency

Description

This is used internally in kernelsmooth and gaussiansmooth to determine the upscaling factor, realized tilesize, and buffer. It is provided to users as it is necessary to anticipate the realized tilesize correctly to use the tiles arguments to the character methods of the smoothing functions (in gridio).

Usage

kernelscalingdetails(max.r, cellsize, tilesize = 2000, kernel.dim = 21, method = 3)

Arguments

max.r

radius of the kernel in the units of the projection (mapunits) it should be set to the same value as in the call to the smoothing function (gaussiansmooth, kernelsmooth. Note for gaussiansmooth codemax.r defaults to 3 times the sd.

cellsize

cellsize of the grid being smoothed

tilesize

the target tilesize as specified in calls to the smoothing functions.

kernel.dim

the target kernel dimension (in the coarse grid) as specified in the calls to the smoothing funcitons.

method

The method used when calling gaussiansmooth.character (in gridio) in all other cases just leave at the default.

Details

If you want to run on a subset of tiles and are using gaussiansmooth.character or kernelsmooth.character in the gridio package then use this function to precalculate the tilesize so you can figure out which tiles to run on. The tilesize will depend on the target tilesize, the cellsize, and max.r. Which in practice means you'll have a different tilesize for each kernel bandwidth.

Value

factor

The factor used when changing the resolution of a grid. This is the ratio of the dimension of a coarse grid cell to that of a fine grid cell. Eg with 30 metercells and factor of 4 the coarse representation will have 120 m cells

tilesize

This is the realized tilesize used by the smoothing functions (when reading from disk in tiles). Since the realized tilesize is a multiple of the factor the user requested tilesize can't usually be met and instead the closes possible multiple of factor is used.

Author(s)

Ethan Plunkett

See Also

gaussiansmooth,kernelsmooth


ethanplunkett/gridkernel documentation built on March 2, 2024, 9:06 p.m.