Skip to main content

Documentation Python Versions License: GPL v3 pre-commit PyPI version codecov

Current release info

Name Downloads Version Platforms
Conda Recipe Conda Downloads Downloads PyPI - Downloads Conda Version PyPI version Conda Platforms

geostatista

geostatista is the geostatistics tier of the serapeum stack: variograms, kriging, and spatial autocorrelation, built on top of pyramids and its GDAL stack. Input is scattered point observations; output is a continuous surface plus an uncertainty estimate, or per-feature autocorrelation statistics.

Main Features

  • Variograms — empirical variogram clouds (Matheron / Cressie estimators) and fitted theoretical models (spherical, exponential, gaussian, matern, plus power / nugget functions).
  • Ordinary kriging — from a fitted variogram onto a regular grid, returning a 2-band KrigedSurface (band 0 = estimate, band 1 = kriging variance) with a cKDTree moving neighborhood for large sample sets.
  • Validation — leave-one-out cross-validation with ME / RMSE / standardized-error diagnostics.
  • Spatial autocorrelation — a sparse Weights matrix (queen / rook contiguity, k-nearest, distance-band) feeding global (Moran's I, Geary's C) and local (Local Moran / LISA, Getis-Ord Gi*) statistics, with one-call spatial_autocorrelation / hotspots facades.
  • Plotting — variogram, LISA-cluster, and hotspot maps through cleopatra (the viz extra).

Everything hangs off Samples, a FeatureCollection subclass, so a column name is always a method argument. See ADR 0001 for the pyramids ↔ geostatista boundary (pyramids keeps IDW and the free gdal.Grid algorithms; geostatista owns every variogram and kriging variant).

Installation

conda (conda-forge)

conda install -c conda-forge geostatista

List the versions available on your platform with:

conda search geostatista --channel conda-forge

pip (PyPI)

pip install geostatista

From GitHub (latest development)

pip install git+https://github.com/serapeum-org/geostatista

Quick start

Krige scattered point observations onto a grid, with an uncertainty band:

from geostatista import Samples

samples = Samples.read_file("rain_gauges.geojson")   # a Samples is-a FeatureCollection

vg = samples.variogram("rain").fit(model="spherical")   # explore + fit spatial structure
surface = samples.krige("rain", vg, cell_size=1000)      # 2-band KrigedSurface (estimate + variance)
surface.to_file("rain.tif")                              # self-describing GeoTIFF (GS_* tags)

cv = samples.cross_validate("rain", vg)                  # leave-one-out diagnostics
print(cv.attrs["summary"])                               # ME, RMSE, standardized error, correlation

Measure and map spatial autocorrelation over polygon features:

from geostatista import Weights, morans_i, local_morans

w = Weights.queen(tracts)                 # queen-contiguity weights
morans_i(tracts, "income", w)             # global Moran's I (I, EI, z, p)
lisa = local_morans(tracts, "income", w)  # per-feature LISA clusters (HH / LL / HL / LH / ns)

See the documentation for the full guide.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

geostatista-0.2.0.tar.gz (46.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

geostatista-0.2.0-py3-none-any.whl (38.2 kB view details)

Uploaded Python 3

File details

Details for the file geostatista-0.2.0.tar.gz.

File metadata

  • Download URL: geostatista-0.2.0.tar.gz
  • Upload date:
  • Size: 46.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.14

File hashes

Hashes for geostatista-0.2.0.tar.gz
Algorithm Hash digest
SHA256 058764925777cfe9330e67d0f8db12bdb2a107c8e8a1601968e04ed2332c13d5
MD5 9fe105e8119174322581b57e18a55f74
BLAKE2b-256 a0b651284fa9d7e0501fc89d93c20f7344c6fa804f9aaf573eaef866b3fef930

See more details on using hashes here.

File details

Details for the file geostatista-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: geostatista-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 38.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.14

File hashes

Hashes for geostatista-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0b96f66e34d0fd9c5ceaa578f7b5424f607f85bc3619ab56c736af4a46764658
MD5 c6a0e0f1ec7732efa1d7a2e5427ecc81
BLAKE2b-256 c137d4ce4d251525ac029b41e7398a362542766d1762a13edc12169e6aedd94f

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

1 file

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page