Statistical routines to analyze the spatial structure of 2D and 3D spatial fields and particle distributions.
Project description
spatialstats
spatialstats is a collection of statistical tools and utility routines used to analyze the multi-scale structure of 2D and 3D spatial fields and particle distributions.
Routines are designed to work with large datasets and some include optional CuPy acceleration. Each routine aims to be independent from the rest of the package, so feel free to just pull out the routine that you need!
You can read the docs at https://spatialstats.readthedocs.io/.
polyspectra
Calculate the bispectrum and power spectrum of 2D and 3D grids.
points
Calculate statistics about the multi-scale structure of 2D and 3D point distributions, like the radial distribution function and structure factor.
GPU usage
The following example demonstrates how to interact with the spatialstats configuration object to toggle gpu usage
import numpy as np
import spatialstats as ss
ss.config.gpu = True
shape = (100, 100)
data = np.random.rand(*shape)
result = ss.polyspectra.bispectrum(data)
Installation
Option 1
Clone from github and build by running
python setup.py install
Option 2
Install from PyPI
pip install spatialstats
Additional Dependencies
spatialstats does not load any of its routines until the time of import (lazy loading), so the only installation requirement is numpy. This is to keep the flexibility and extensibility of spatialstats as a package of disconnected routines. Users may need to add additional dependencies after installation, such as scipy, numba>=0.50, cupy>=8.0, and pyfftw.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.