Package: nd
ndOverviewThe 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.ndmakes it easy to broadcast these methods across a whole dataset,
adding additional features such as automatic parallelization.Examples includepixelwise change detection algorithmsreprojection between coordinate systemsmachine learning algorithmsndis built onxarray.
Internally, all data are passed around asxarrayDatasets and all provided methods expect this format as inputs.
Anxarray.Datasetis essentially a Python representation of the NetCDF file format and as such easily reads/writes NetCDF files.ndis making heavy use of thexarrayandrasteriolibraries.
The GDAL library is only used viarasterioas a compatibility layer to enable reading supported file formats.nd.open_datasetmay be used to read any NetCDF file or any GDAL-readable file into anxarray.Dataset.Read theDocumentationfor detailed user guides.You can also have a look at these two example notebooks:Visualizing and reprojecting GHRSST dataChange detection in Sentinel-1Installationpip install ndIt is recommended that you have GDAL available before installation and also make sure to have the correct environment variable set:exportGDAL_DATA=$(gdal-config--datadir)Note that the following algorithms require thelibgsl-devC library to be installed:nd.change.OmnibusTestWhat does this library add?xarrayprovides all data structures required for dealing withn-dimensional data in Python.ndexplicitly 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,ndadds functionality to more seamlessly integrate libraries likexarray,rasterio,scikit-learn, etc.For example:ndallows to reproject an entire multivariate and multi-temporal dataset between different coordinate systems by wrappingrasteriomethods.ndprovides a wrapper forscikit-learnestimators to easily apply classification algorithms to raster data.Additionally,ndcontains a growing library of algorithms that are especially useful for spatio-temporal datacubes, for example:change detection algorithmsspatio-temporal filtersSincexarrayis our library of choice for representing geospatial raster data, this is also an attempt to promote the use ofxarrayand 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 innumpy.
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 usingzlib. 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 reportsFor feature requests and bug reports pleasesubmit an issueon the Github repository.