Digital Earth Australia logo

DEA Tools Python package

DOI Apache license Discord

dea-tools is an open-source Python package for geospatial analysis of satellite data using Digital Earth Australia, Open Data Cube, and Xarray. It provides a broad set of utilities for loading, visualising, transforming, and analysing Earth Observation (EO) data across space and time.

The package includes tools for:

  • πŸ“¦ Data handling: Load and combine DEA data products, manage projections and resolutions.

  • πŸ—ΊοΈ Visualisation: Create static and interactive maps, RGB plots, and animations.

  • πŸ›°οΈ Remote sensing indices: Calculate band indices such as NDVI, NDWI, and more.

  • 🌐 Spatial and temporal analysis: Apply raster/vector operations, extract contours, compute temporal stats, and model change over time.

  • πŸ€– Machine learning and segmentation: Train and apply classifiers, or run image segmentation workflows.

  • βš™οΈ Parallel processing: Set up Dask clusters for scalable processing of large datasets.

  • 🌏 Domain-specific tools: Analyse coastal change, intertidal zones, land cover, wetland and waterbody dynamics, and climate datasets.

API documentation

Full API documentation describing the modules and functions available in dea-tools is available on the DEA Knowledge Hub.

Installation

You can install dea-tools from PyPI with pip (https://pypi.org/project/dea-tools/).

By default dea-tools will be installed with minimal dependencies, which excludes datacube and other difficult to install packages:

pip install dea-tools

To install with datacube dependencies (note that this requires access to a datacube database):

pip install dea-tools[datacube]

To install with additonal Jupyter-related dependencies:

pip install dea-tools[jupyter]

To install with other packages used in DEA Notebooks examples:

pip install dea-tools[jupyter,dask_gateway,hdstats,notebooks]

You can also install dea-tools with all optional dependencies. Note: some of these dependencies are difficult to install. If you encounter issues, you may need to try the Conda instructions below.

pip install dea-tools[all]

With conda

If you encounter issues with the installation, try installing the package in a conda Python environment where GDAL and pyproj are already installed:

wget -O conda-environment.yml https://raw.githubusercontent.com/opendatacube/datacube-core/develop/conda-environment.yml

mamba env create -f conda-environment.yml
conda activate cubeenv

pip install dea-tools

Working on DEA Sandbox or NCI

To work with this module on the DEA Sandbox or National Computational Infrastructure environments without installing it, you can add the Tools directory to the system path from within your dea-notebooks directory:

import sys
sys.path.insert(1, "../Tools/")
from dea_tools.datahandling import load_ard  # or some other function

Alternatively, you can also do a local installation of dea-tools. To do this on the DEA Sandbox, run pip from the terminal from within your dea-notebooks directory:

pip install -e .

Importing functions in Python

One dea-tools is installed, you can import functions using:

from dea_tools.datahandling import load_ard
from dea_tools.plotting import rgb

Citing DEA Tools

If you use any of the notebooks, code or tools in this repository in your work, please reference them using the following citation:

Krause, C., Dunn, B., Bishop-Taylor, R., Adams, C., Burton, C., Alger, M., Chua, S., Phillips, C., Newey, V., Kouzoubov, K., Leith, A., Ayers, D., Hicks, A., DEA Notebooks contributors 2021. Digital Earth Australia notebooks and tools repository. Geoscience Australia, Canberra. https://doi.org/10.26186/145234