Skip to contents

Discovery & sources

Turn a STAC search into grid-pinned lazy rasters. Entry point for remote (Planetary Computer / element84) collections.

stac_query()
Query a STAC API and return the item collection.
stac_sign_mpc()
Sign Planetary Computer STAC items, caching the token per collection.
stac_sources()
Rectangularise STAC items into a source table.
stac_filter_assets()
Keep only the named assets in a STAC item collection (or sources table).
stac_filter_cloud()
Filter a source table by maximum cloud cover.
stac_filter_coverage()
Drop STAC items (or sources) that barely overlap an area of interest.
stac_filter_orbit()
Filter STAC items by orbit state (Sentinel-1 ascending / descending).
stac_drop_duplicates()
Drop duplicate acquisitions (identical footprint and datetime).
stac_rename_assets()
Rename assets to a common band schema.
stac_merge()
Concatenate source tables into one harmonised collection.
stac_time_slices()
Group acquisitions into time slices.
stac_gti_index()
Write a source table as a GTI index for one asset.
lazy_stac_stack()
Lazy time-sliced stack of one STAC asset on a target grid.
lazy_source()
Build a LazyRaster from a GDAL source.

Datasets

The named multi-band, multi-time object; verbs apply across every band. Build from a STAC table or from rasters, then select, stack, and collapse.

lazy_dataset()
Build a lazy dataset from a STAC source table or raster file(s).
as_dataset()
Assemble a lazy dataset from existing rasters.
LazyDataset()
A named, multi-band, multi-time lazy dataset.
stack_bands()
Collapse a dataset's bands into a single stacked raster.
band_sel()
Select bands of a stacked raster by label.
time_sel()
Select time slices of a stacked raster by label.

Masking & cloud removal

Mask value bands from a QA band or from a pre-trained cloud model. The ocm_* functions run the OmniCloudMask segmentation model natively (no Python) to derive cloud/shadow masks from red, green, and NIR bands.

mask()
Mask a dataset from a QA band.
qa_bits()
Build a QA-bitmask predicate.
ocm_model() ocm_predict() ocm_mask()
Cloud and shadow masking with OmniCloudMask
ocm_fetch_weights() ocm_load_weights()
OmniCloudMask model weights
shrink_footprint()
Shrink the valid-data footprint by a pixel margin.

Time series & compositing

Collapse or smooth the time axis: calendar grouping, multivariate composites, gap filling, and per-pixel smoothers.

group_by_time()
Group a dataset's time slices into calendar periods.
geomedian()
Geometric median reducer over time (multivariate).
medoid()
Medoid reducer over time (multivariate).
fill_gaps()
Fill nodata gaps along the time axis.
hampel_smooth()
Hampel filter a stack over its time axis.
kalman_smooth()
Smooth a stack with a local-linear-trend Kalman smoother.
kalman_llt()
Kalman local-linear-trend smoother body for scan_over().

Geo-embeddings & model weights

Special operations for published geo-embedding products: the quantiser decodes (fused onto multi-band reads via lazy_map) and safetensors weight IO.

dequantize_aef()
Dequantize Alpha Earth (AEF) embedding codes.
dequantize_esd()
Dequantize Embedded Seamless Data (ESD) FSQ codes.
safetensors_read()
Read tensors from a safetensors file.
safetensors_ls()
List tensor names, dtypes, and shapes without reading data.

Raster & dataset algebra

Lazily build and transform rasters and datasets. Every verb adds IR nodes and returns a new lazy object; nothing reads or computes until collect().

lazy_map()
Elementwise map over one or more aligned rasters.
lazy_stack()
Stack aligned rasters along a new outer dim (default time).
focal()
Focal (stencil) op.
focal_kernel()
Linear focal op with an explicit kernel (differentiable).
bilateral_focal()
A bilateral (edge-preserving) focal body for focal().
reduce_over()
Reduction over named dims.
band_project()
A band reducer for a linear combination of bands.
mlp_project()
An MLP band reducer (predict a trained network across the raster).
scan_over()
Scan along an axis, keeping it (temporal recursions).
lazy_patch()
Whole-window model op (advanced): apply fn to the raw padded chunk.
align()
Lazily resample/reproject onto a target grid.

Execution

Plan, distribute across daemons, and write the result.

collect()
Materialise a LazyRaster (or inspect its plan).
write_tif()
Execute a lazy raster and stream it to a GeoTIFF.
materialise()
Materialise a lazy object locally and stay lazy.
as_terra()
Convert a collected result to a terra SpatRaster.
garry_daemons()
Set up split mirai daemon pools for distributed execution.
garry_daemons_set()
Are the garry daemon pools running?
garry_pool_hygiene()
Reclaim daemon memory across the pools.
garry_gdal_config()
Apply garry's default GDAL configuration for remote COG reads.
garry_opt()
Read a garry policy option.
garry_options()
List every garry option: default, current value, tier, description.

Diagnostics & visualisation

Inspect data and understand what an execution did: quick plots, pipeline drawings, and run reports.

preview()
Preview a lazy object, a collected array, or a raster file.
draw()
Draw the pipeline of a lazy object.
plan_view()
Interactive Plan viewer.
garry_last_route()
Which execution route did the last collect() take?
garry_task_report()
Summarise a garry.task_log CSV.
garry_explain_placement()
Explain the scheduler's placement decisions for a computation.

Grids & spatial helpers

Define and interrogate the analysis grid; dtype rules.

grid_spec()
Convenience constructor: derive the transform from extent + dims (or res).
grid_from_bbox()
Build an analysis grid from a lon/lat bounding box.
grid_from_src()
Build an analysis grid from a raster or vector source.
gdal_grid_spec()
Inspect a GDAL source and build its GridSpec (plus read metadata).
xmin() ymin() xmax() ymax() res()
Grid extent and resolution accessors.
grid_equal()
Structural equality of two grids (geometry only, not dtype).
grid_diff()
Describe how two grids differ.
crs_equal()
Are two CRS strings the same reference system?
dtype_valid()
Is dtype a member of garry's dtype vocabulary?
dtype_promote()
Promote two dtypes for a binary operation.
snap_to_blocks()
Snap requested chunk size to a multiple of native block size.
output_grid()
Compute the output grid given this node and its parents' grids.

anvl compute vocabulary

The g_* traced-array ops for writing map/focal/reducer functions. These run fused inside an XLA stage under both the pure-R reference implementation and PJRT.

g_ifelse()
Elementwise select: yes where cond, else no.
g_is_nodata()
Is a value nodata? NaN is the nodata sentinel.
g_cast()
Cast to a garry dtype.
g_fill()
Construct a constant-filled AnvlArray on the device.
g_pad()
Pad a matrix by h cells on every side with value.
g_pad_rb()
Pad the bottom/right edges of the last two dims.
g_shift_slice()
Shifted slice of a padded matrix (the stencil building block).
g_stack()
Stack same-shaped arrays along a new leading axis.
g_index_scalar()
Extract element i of a 1-D array as a scalar (static index).
g_scan()
Scan: carry state along dim 1, emitting per-step outputs.
g_slice_t()
Static range slice along dim 1 (the scanned axis).
g_concat_t()
Concatenate along dim 1 (the scanned axis).
g_rep_t()
Replicate a (y, x) plane along a new leading axis.
g_expand()
Insert a broadcast axis at an arbitrary position.
g_squeeze1()
Drop a leading unit axis.
g_transpose()
Transpose an array (general permutation).
g_bitand() g_bitor() g_bitxor() g_bitnot() g_shiftl() g_shiftr()
Bitwise operations on integral arrays.
g_sum() g_mean() g_min() g_max() g_median() g_count()
Reductions over array margins.
g_erf()
Error function (exact GELU building block).
g_conv2d()
2D convolution over a (C, H, W) chunk.
g_upsample2x()
Nearest-neighbour 2x upsample of a (C, H, W) chunk.
g_broadcast_arrays()
Broadcast arrays to a common shape (compute vocabulary).
g_upload()
Upload an R array to an AnvlArray of the given garry dtype.
g_download()
Download an AnvlArray (or a nested list of them) to R arrays.
lazy_value_and_grad()
Value and gradient of a scalar LazyRaster loss wrt a focal kernel.

GDAL adapter (low-level IO)

Direct windowed read/write, warp, staging, and GTI index construction. Used by the cube layer; exposed for bespoke IO.

gdal_read_window()
Read a window from a GDAL source as a garry-oriented matrix.
gdal_write_window()
Write a garry-oriented matrix into an open output dataset.
gdal_create_output()
Create an output raster for a grid.
gdal_warp_vrt()
Build a warped VRT of a source onto an exact target grid.
stage_raw_cube()
Stage a GDAL raster as a raw-BSQ cube (.bin + sibling .vrt).
gti_index_create()
Create a GTI tile index layer from a source table.
gti_open_options()
Build GTI open options pinning a target grid and slice filter.

IR & planner (extension API)

The intermediate representation and planner. Needed only to build on the IR directly (custom nodes, alternate executors) – not for normal use.

LazyRaster()
Lazy raster array (single band stack).
GridSpec()
Spatial grid specification.
Graph()
Compute graph.
ChunkGrid()
A chunk partition of a GridSpec.
Stage()
One schedulable unit of a Plan.
Plan()
A physical execution plan: stages in dependency order.
Node()
Abstract IR node.
SourceNode()
A GDAL-readable source: path + band + optional nodata sentinel.
MapNode()
Elementwise map. fn is an R function over scalars/arrays; it will be composed with neighbouring fusable nodes and wrapped in anvl::jit() at plan time. Created by lazy_map().
FocalNode()
Focal (stencil) op. radius is the halo in pixels; boundary is one of "constant", "reflect", "nearest", "wrap", "none". Created by focal().
ReduceNode()
Reduction over named dims. Barrier: forces materialisation of its inputs.
ScanNode()
Scan along a named dim, preserving it. Barrier over over.
WarpNode()
Lazy resample/reproject to a target grid. Created by align(). Barrier. At execution time this materialises as a gdalraster VRT warp.
StackNode()
Combine inputs along a named dim (e.g. time). Created by lazy_stack().
FusedNode()
Output of the composition pass. Holds a composed R function assembled from its members; ready for anvl::jit() at execution time.
PatchNode()
Whole-window model op: fn over the raw padded chunk. Halo-consuming.
graph_new()
Create an empty graph.
graph_add()
Add a node. ctor is an S7 node constructor; ... are its properties (the id property is assigned here and passed automatically).
graph_get()
Look up a node by id.
graph_ids()
All node ids in the graph, in ascending id order.
graph_toposort()
Topological sort of all node ids. Errors on cycles.
graph_replace()
Replace a node in place (for rewrite passes).
graph_import()
Import the subgraph reachable from root_id in src into dst.
plan_lazy()
Plan a LazyRaster: run all planner passes and export a Plan.
plan_dot()
Render a Plan as DOT (Graphviz) text.
execute_plan()
Execute a Plan on the anvl backend (single process).
execute_plan_mirai()
Execute a Plan across mirai daemons.
fusable()
Can this node be composed with fusable neighbours into a single kernel?
is_barrier()
Does this node force a stage boundary?
required_halo()
Halo radius required by this node from its inputs.
chunk_iter()
Enumerate chunks.
chunk_window_with_halo()
Expand a chunk window by the ChunkGrid's halo, clipped to the grid.
cross_grid_window()
Map an output-chunk window on out_grid to the minimal input window required on in_grid.