Bins particles into a 3D grid: longitude, latitude, and time. Supports two methods: "simple" (bin-and-sum) and "kernel" (Gaussian smoothing).
Usage
obs_grid_cube(
x,
lon_min,
lat_min,
lon_max,
lat_max,
res = 0.1,
nt = 240L,
t0 = 0,
dt = 60,
method = c("simple", "kernel"),
bandwidth = res,
use_haversine = FALSE,
n_threads = 1L,
npar = 1L
)Arguments
- x
A
data.tableordata.framewith columnslat,lon,time(minutes), andfoot.- lon_min, lat_min, lon_max, lat_max
Grid extent (degrees).
- res
Spatial resolution (degrees).
- nt
Number of time layers in the output cube.
- t0
Reference time for the first layer (minutes). Default
0.- dt
Time step per layer (minutes). Default
60(1 hour).- method
Character. Either
"simple"for bin-and-sum or"kernel"for Gaussian smoothing. Default"simple".- bandwidth
Kernel standard deviation for
method = "kernel". In degrees ifuse_haversine = FALSE, or metres ifTRUE. Default equalsres.- use_haversine
Logical. If
TRUE, uses great-circle distances andbandwidthin metres for kernel smoothing.- n_threads
Number of OpenMP threads.
- npar
Normalization factor (total particles released).
