User guide
This guide explains how APbase turns irregular field data into validated maps.
APbase is available as the Python package apbase and the Rust crate
apbase; each example has a tab for each language. Start with
Installation and Quickstart to install it and create your
first map.
For normal map generation, start with Map or create_map, which run the
full pipeline described in Map and grid generation. Use the lower-level
components only when you need to inspect or control one stage.
For service, worker, container, and cloud deployment guidance, see Production and cloud deployment.
Reading the parameters in Rust
The parameter lists in this guide use the Python names and types. The Rust crate keeps the same names and defaults, with these conventions:
- Required settings are constructor arguments (
MapOptions::new(resolution)); optional ones are fields of a<Name>Optionsstruct that implementsDefault, so you set only what you change:IDWOptions { power: 3.0, ..Default::default() }. - Estimators follow
new(options)? -> fit(&x, &y, &z)? -> interpolate(&targets)?. - Fitted values are read through getter methods, not attributes:
kriging.model_params()?.range,ck.model_values()?. NonebecomesOption:radius: Some(50.0),seed: Some(42),filter_kwargs: Some(SpatialFilterOptions { .. }).- String choices become enums, such as
FilterLevel::LightorCoKrigingMethod::Icm; they also parse from the Python strings ("icm".parse()?). array_likeis any slice,Vec, array, orndarrayarray of a numeric type;targetsis an(n, 2)ndarrayarray, a slice orVecof[x, y]pairs, a slice orVecof pointgeos::Geometryvalues, or a fittedGrid.- Dictionaries of variables are
IndexMap<String, (Array1<f64>, Array1<f64>, Array1<f64>)>, and results by method areIndexMaps in a stable order (cv.by_method["icm"].rmse). The cokriging examples need theindexmapcrate, and some examples usendarraytypes directly. - Every fallible call returns
Result<T, ApbaseError>.e.is(ErrorKind::InterpolationError)is true for that kind and for every more specific kind under it, such asKrigingInvalidRadiusError.
Pages in this guide
- Map and grid generation: the automatic
Mappipeline, its result, and manual target grids. - Spatial filtering: removing invalid rows and spatial outliers.
- Variogram: fitting and inspecting the variogram.
- Inverse distance weighting (IDW): inverse distance weighting.
- Ordinary kriging: local ordinary kriging.
- Cross-validation: the IDW-vs-kriging comparison behind
Map. - Cokriging: estimating with secondary variables (advanced).
For the mathematics behind the automatic IDW-vs-kriging choice, see Methodology. For public signatures, see API Reference.