
Scan along an axis, keeping it (temporal recursions).
scan_over.RdThe length-preserving sibling of reduce_over(): carry state
sequentially along over while emitting a same-length series
(Kalman smoothers, EWMA, IIR filters, cumulative custom ops). The
output grid is the input grid unchanged; only the dtype may differ.
Arguments
- x
A
LazyRaster, a list ofLazyRasters on the same graph and grid (multi-input scan), or aLazyDataset.- fn
Scan body
fn(xs, margin).- over
Single dim name to scan along (default
"t").- direction
"forward","backward", or"bidir"(the body encapsulates direction; this is declarative metadata).- dtype
Optional output dtype override (default: input dtype).
- bands
LazyDatasetonly: bands to scan (default: all).
Details
fn is the scan body fn(xs, margin) -> y, written in the
g_* vocabulary and typically built around g_scan(): xs is the
LIST of parent chunk values (pass a list of LazyRasters on the same
grid to scan several cubes in lockstep), margin is the scanned
axis position, and y has the shape of xs[[1]]. Like a custom
reducer, a scan holds the full over axis per spatial chunk, so it
is supported over "t"/"band" only.
Over a LazyDataset, each band's slices are stacked along "t" and
scanned independently (bands restricts which).