Skip to main content

Build Status codecov Documentation PyPI version DOI

nd

Overview

The main goal of this library is to generalize methods that work in lower dimensions to higher-dimensional data.

Multi-dimensional data often arise as spatio-temporal datacubes, e.g. climate data or time series of geospatial satellite data. Many data analysis methods are designed to work on single images or time series at a single point. nd makes it easy to broadcast these methods across a whole dataset, adding additional features such as automatic parallelization.

Examples include

  • pixelwise change detection algorithms
  • reprojection between coordinate systems
  • machine learning algorithms

nd is built on xarray. Internally, all data are passed around as xarray Datasets and all provided methods expect this format as inputs. An xarray.Dataset is essentially a Python representation of the NetCDF file format and as such easily reads/writes NetCDF files.

nd is making heavy use of the xarray and rasterio libraries. The GDAL library is only used via rasterio as a compatibility layer to enable reading supported file formats. nd.open_dataset may be used to read any NetCDF file or any GDAL-readable file into an xarray.Dataset.

Read the Documentation for detailed user guides.

You can also have a look at these two example notebooks:

Installation

pip install nd

It is recommended that you have GDAL available before installation and also make sure to have the correct environment variable set:

export GDAL_DATA=$(gdal-config --datadir)

Note that the following algorithms require the libgsl-dev C library to be installed:

  • nd.change.OmnibusTest

What does this library add?

xarray provides all data structures required for dealing with n-dimensional data in Python. nd explicitly does not aim to add additional data structures or file formats. Rather, the aim is to bring the various corners of the scientific ecosystem in Python closer together.

As such, nd adds functionality to more seamlessly integrate libraries like xarray, rasterio, scikit-learn, etc.

For example:

  • nd allows to reproject an entire multivariate and multi-temporal dataset between different coordinate systems by wrapping rasterio methods.

  • nd provides a wrapper for scikit-learn estimators to easily apply classification algorithms to raster data.

Additionally, nd contains a growing library of algorithms that are especially useful for spatio-temporal datacubes, for example:

  • change detection algorithms

  • spatio-temporal filters

Since xarray is our library of choice for representing geospatial raster data, this is also an attempt to promote the use of xarray and the NetCDF file format in the Earth Observation community.

Why NetCDF?

NetCDF (specifically NetCDF-4) is a highly efficient file format that was built on top of HDF5. It is capable of random access which ties in with indexing and slicing in numpy. Because slices of a large dataset can be accessed independently, it becomes feasible to handle larger-than-memory file sizes. NetCDF-4 also supports data compression using zlib. Random access capability for compressed data is maintained through data chunking. Furthermore, NetCDF is designed to be fully self-descriptive. Crucially, it has a concept of named dimensions and coordinates, can store units and arbitrary metadata.

Feature requests and bug reports

For feature requests and bug reports please submit an issue on the Github repository.

Metadata

Release files for nd 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nd 0.3.1
File Size Uploaded
nd-0.3.1.tar.gz 99.9 MB Details

Release files / nd-0.3.1.tar.gz

Download URL nd-0.3.1.tar.gz
Size 99.9 MB
Tags Source
SHA-256 checksum
How to use checksums
548d5909bea1e87f3f24a8b9d5aed82a5f898b9a8e142cb0ce0a5cb311cd060a
BLAKE2b-256 checksum
How to use checksums
806d0687a84a0788d2b101d3860099578befa3fb9440c2f1ca21f11610926951
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

Release history Release notifications | RSS feed

This release

0.3.1 This release

1 release file

0.3

1 release file

0.2

1 release file

0.1

1 release file

0.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page