Author:
This repository contains a set of Jupyter Notebooks and accompanying Python scripts to allow a user to interactively query, download and process satellite data into vegetation health metrics.
Metrics include:
Normalised Difference Vegetation Index (NDVI)
$NDVI = \frac{NIR - Red}{NIR + Red}$
Normalised Difference Moisture Index (NDMI)
$NDMI = \frac{NIR - SWIR1}{NIR + SWIR1}$
Normalised Burn Ratio (NBR)
$NBR = \frac{NIR - SWIR2}{NIR + SWIR2}$
Available satellite imagery sources currently include:
Due to the various satellite imagery sources and processing requirements, each has a dedicated Jupyter Notebook for downloading, processing and visualisation.
You can view a static visualisation of NDVI, NDMI and NBR as captured by Sentinel-2 on 2024-01-06 for the Perth region below.
For an interactive visualisation, you can download the sample/demo_sentinel_2.html file in this repository and view via your web browser.
An in-depth guide on the Eyes on Australian Forests repository can be found here.
To use this repository, you will need to have conda setup on your machine. A recommended version of conda is Miniforge. Please follow the latest installation instructions found on the link provided.
Once you have installed Miniforge, please download this repository (top-right code button) and follow the below steps in a terminal to install the environment (Mac & Linux).
% cd <extracted folder, e.g. ~/Downloads/EoAF>
% conda env create -f environment.yml
% conda activate EoAF
% poetry install --no-root
On Windows, you will need to run these commands inside "Miniforge Prompt" (that you just installed from the link above) available from the start menu
Before proceeding, please confirm the download and processed directory paths for each satellite provider within config.yaml
and update as required.
By default, the data will be saved in the data directory located within this repository's working directory.
A Gradio web interface is available for each satellite source for the basic downloading and processing of satellite products. Visualisations of the data can be generated and downloaded as HTML for viewing via a web browser.
The webUI can be launched as follows.
Sentinel-2 Example
python webui/sentinel_ui.py
If you are on Windows, once you have followed the installation steps above, to use the webUI please instead run the following in the miniforge prompt:
poetry run python webui\sentinel_ui.py
For additional interactivity and customisations, a set of Jupyter Notebooks have been provided for each satellite source.
To access these notebooks, you can open then via VSCode or by launching Jupyter Lab via Terminal to open your required notebook.
jupyter lab
Please run each cell sequentially and use the Jupyter Widgets to interact with the notebook.
A Command Line Interface has also been provided for automatically download and process products based on a search criteria. This enables the creation of automated processing pipelines and usage of output products in applications such as QGIS.
Sentinel-2 Example with Bounding Box
python src/sentinel.py --session-id Sentinel_2_Example --start-date 2024-01-01 --end-date 2024-01-08 --min-lon 116.01897 --max-lon 116.20093 --min-lat -32.30959 --max-lat -31.98176 --collection ga_s2am_ard_3 --crop --no-merge --download-from-thredds --raw-dir data/raw_data/sentinel_2 --processed-dir data/processed_data/sentinel_2
Landsat 8 & 9 Example with Shapefile
python src/landsat.py --session-id Landsat_8_Example --start-date 2024-01-01 --end-date 2024-01-08 --shapefile shapefiles/large.shp --collection ga_ls8c_ard_3 --crop --merge --download-from-thredds --raw-dir data/raw_data/landsat_8_9 --processed-dir data/processed_data/landsat_8_9
Help documentation for the CLI can be accessed as follows.
python src/viirs.py --help
Note: All three interfaces will store the downloaded and processed products in the previously configured directories. You may export these for use in other applications such as QGIS or ArcGIS.
Once products have been downloaded, it is advised to keep the given naming conventions to maintain data provenance.
To assist in this: