From ef6a30edcd863ce0997540645853b3fb46aad709 Mon Sep 17 00:00:00 2001 From: cbur24 Date: Wed, 20 Aug 2025 03:59:08 +0000 Subject: [PATCH 01/16] test out binder links on template --- DEA_notebooks_template.ipynb | 45 ++++++++++++++++++++---------------- requirements.txt | 4 ++++ 2 files changed, 29 insertions(+), 20 deletions(-) create mode 100644 requirements.txt diff --git a/DEA_notebooks_template.ipynb b/DEA_notebooks_template.ipynb index daf3b1275..9b1eeeaae 100644 --- a/DEA_notebooks_template.ipynb +++ b/DEA_notebooks_template.ipynb @@ -38,8 +38,7 @@ "source": [ "# Descriptive title that follows notebook filename \n", "\n", - "* **[Sign up to the DEA Sandbox](https://app.sandbox.dea.ga.gov.au/)** to run this notebook interactively from a browser\n", - "* **Compatibility:** Notebook currently compatible with both the `NCI` and `DEA Sandbox` environments\n", + "* Visit DEA's [Knowledge Hub](https://knowledge.dea.ga.gov.au/) for detailed technical information including methods, quality, and data access.\n", "* **Products used:** \n", "[ga_s2am_ard_3](https://explorer.dea.ga.gov.au/products/ga_s2am_ard_3), \n", "[ga_s2bm_ard_3](https://explorer.dea.ga.gov.au/products/ga_s2bm_ard_3),\n", @@ -48,7 +47,21 @@ "[ga_ls7e_ard_3](https://explorer.dea.ga.gov.au/products/ga_ls7e_ard_3),\n", "[ga_ls8c_ard_3](https://explorer.dea.ga.gov.au/products/ga_ls8c_ard_3)\n", "* **Special requirements:** An _optional_ description of any special requirements, e.g. If running on the [NCI](https://nci.org.au/), ensure that `module load otps` is run prior to launching this notebook\n", - "* **Prerequisites:** An _optional_ list of any notebooks that should be run or content that should be understood prior to launching this notebook\n" + "* **Prerequisites:** An _optional_ list of any notebooks that should be run or content that should be understood prior to launching this notebook\n", + "\n", + "\n", + "
\n", + " \n", + "**How you can run this notebook:** \n", + "* **DEA's Sandbox**: Some users may be eligible to sign-up for [DEA's Sandbox](https://app.sandbox.dea.ga.gov.au/) environment which provides a small amount of free compute and an ODC-compatible python environment.\n", + "* **Personal computer:** This notebook loads DEA data using [odc-stac](https://odc-stac.readthedocs.io/en/latest/). This means data is streamed across an internet connection so can be run on your personal computer provided you have the the required Python packages installed. Running `pip install dea-tools>0.4` will usually suffice.\n", + "* **Run this notebook online:** You can also use the links below to launch either a binder or GitHub Codespaces cloud compute instance to run this notebook:\n", + "\n", + "[![Launch Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/GeoscienceAustralia/dea-notebooks/develop?labpath=How_to_guides/Downloading_data_with_STAC.ipynb)\n", + "\n", + "[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new?hide_repo_select=true&ref=develop&repo=GeoscienceAustralia%2Fdea-notebooks&location=How_to_guides/Downloading_data_with_STAC.ipynb)\n", + "\n", + "
" ] }, { @@ -98,7 +111,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -127,7 +140,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "metadata": { "jupyter": { "source_hidden": true @@ -152,7 +165,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -174,7 +187,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -192,7 +205,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -210,7 +223,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -232,24 +245,16 @@ "**Contact:** If you need assistance, please post a question on the [Open Data Cube Discord chat](https://discord.com/invite/4hhBQVas5U) or on the [GIS Stack Exchange](https://gis.stackexchange.com/questions/ask?tags=open-data-cube) using the `open-data-cube` tag (you can view previously asked questions [here](https://gis.stackexchange.com/questions/tagged/open-data-cube)).\n", "If you would like to report an issue with this notebook, you can file one on [GitHub](https://github.com/GeoscienceAustralia/dea-notebooks).\n", "\n", - "**Last modified:** September 2021\n", + "**Last modified:** September 2025\n", "\n", "**Compatible datacube version:** " ] }, { "cell_type": "code", - "execution_count": 7, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "1.8.19\n" - ] - } - ], + "outputs": [], "source": [ "print(datacube.__version__)" ] diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 000000000..6cc40a909 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,4 @@ +## dea-tools will install most required packages +dea-tools==0.4.1 +dea-tools[jupyter] +jupyter-resource-usage \ No newline at end of file From 085d2d202b4ade1a908cb85a0bb979839b060662 Mon Sep 17 00:00:00 2001 From: cbur24 Date: Wed, 20 Aug 2025 04:03:05 +0000 Subject: [PATCH 02/16] add devcontainer --- .devcontainer/devcontainer.json | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000..df554eb54 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,24 @@ +{ + "image": "mcr.microsoft.com/devcontainers/universal:2", + "features": { + "ghcr.io/devcontainers/features/python:1": { + "version": "3.11", + "installJupyterlab": true + } + }, + "postCreateCommand": "pip3 install --user -r requirements.txt", + "hostRequirements": { + "cpus": 4, + "memory": "16gb", + "storage": "32gb" + }, + "customizations": { + "vscode": { + "extensions": [ + "ms-python.python", + "ms-toolsai.jupyter", + "charliermarsh.ruff" + ] + } + } +} From e1e5bc2ddf62656a1420347c08070ac12aaa3639 Mon Sep 17 00:00:00 2001 From: cbur24 Date: Wed, 20 Aug 2025 04:19:46 +0000 Subject: [PATCH 03/16] update reuirements --- requirements.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/requirements.txt b/requirements.txt index 6cc40a909..ea175c4b8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,2 @@ ## dea-tools will install most required packages -dea-tools==0.4.1 -dea-tools[jupyter] -jupyter-resource-usage \ No newline at end of file +dea-tools>0.4.1 \ No newline at end of file From 23bc08b0cc1a1cd4ce39d2b30d54f3428bff9bb2 Mon Sep 17 00:00:00 2001 From: cbur24 Date: Mon, 25 Aug 2025 02:51:10 +0000 Subject: [PATCH 04/16] test devcontainer again --- .devcontainer/devcontainer.json | 17 ++++-- DEA_notebooks_template.ipynb | 100 +++++++++++++++++++++----------- requirements.txt | 4 +- 3 files changed, 83 insertions(+), 38 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index df554eb54..004fa5860 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,16 +1,25 @@ { - "image": "mcr.microsoft.com/devcontainers/universal:2", + "name": "Sentinel-1 Hackathon", + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", "features": { "ghcr.io/devcontainers/features/python:1": { "version": "3.11", "installJupyterlab": true } }, - "postCreateCommand": "pip3 install --user -r requirements.txt", + "postCreateCommand": "pip install -r requirements.txt", + "postStartCommand": "nohup jupyter lab --ip 0.0.0.0 --port 8888 --no-browser --NotebookApp.token='' > /tmp/jupyter.log 2>&1 &", + "forwardPorts": [8888], + "portsAttributes": { + "8888": { + "label": "JupyterLab", + "onAutoForward": "openBrowser" + } + }, "hostRequirements": { - "cpus": 4, + "cpus": 2, "memory": "16gb", - "storage": "32gb" + "storage": "15gb" }, "customizations": { "vscode": { diff --git a/DEA_notebooks_template.ipynb b/DEA_notebooks_template.ipynb index 9b1eeeaae..e0c1efb04 100644 --- a/DEA_notebooks_template.ipynb +++ b/DEA_notebooks_template.ipynb @@ -1,5 +1,71 @@ { "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "
\n", + "\n", + "

Descriptive title that follows notebook filename

\n", + "\n", + "

\n", + "πŸ”Ž Visit DEA's Knowledge Hub for detailed technical information including methods, quality, and data access.\n", + "

\n", + "\n", + "\n", + "
\n", + "πŸ“¦ Products used
\n", + "ga_s2am_ard_3, \n", + "ga_s2bm_ard_3, \n", + "ga_s2cm_ard_3, \n", + "ga_ls5t_ard_3, \n", + "ga_ls7e_ard_3, \n", + "ga_ls8c_ard_3\n", + "
\n", + "\n", + "
\n", + "βš™οΈ Special requirements
\n", + "Optional notes, e.g. If running on the NCI, ensure that module load otps is run prior to launching this notebook.\n", + "
\n", + "\n", + "
\n", + "πŸ“– Prerequisites
\n", + "Optional list of prerequisite notebooks or background knowledge.\n", + "
\n", + "\n", + "
\n", + "πŸš€ How you can run this notebook
\n", + "\n", + "- DEA Sandbox: Some users may be eligible to sign up for DEA's \n", + " Sandbox environment which provides \n", + " free compute and an ODC-compatible Python environment.
\n", + "\n", + "- Personal computer: This notebook loads DEA data using odc-stac. Data streams across an internet connection, so it can be run locally provided you install the required Python packages, e.g. pip install dea-tools[notebooks]
\n", + "\n", + "- Run this notebook online: Launch a GitHub Codespaces instance to run the notebook from your browser:
\n", + "\n", + " \n", + " \n", + " \n", + "\n", + " \n", + " \"Open\n", + " \n", + "
\n", + "\n", + "
\n", + " \"DEA\n", + "
\n" + ] + }, { "attachments": {}, "cell_type": "markdown", @@ -32,38 +98,6 @@ "---\n" ] }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Descriptive title that follows notebook filename \n", - "\n", - "* Visit DEA's [Knowledge Hub](https://knowledge.dea.ga.gov.au/) for detailed technical information including methods, quality, and data access.\n", - "* **Products used:** \n", - "[ga_s2am_ard_3](https://explorer.dea.ga.gov.au/products/ga_s2am_ard_3), \n", - "[ga_s2bm_ard_3](https://explorer.dea.ga.gov.au/products/ga_s2bm_ard_3),\n", - "[ga_s2cm_ard_3](https://explorer.dea.ga.gov.au/products/ga_s2cm_ard_3),\n", - "[ga_ls5t_ard_3](https://explorer.dea.ga.gov.au/products/ga_ls5t_ard_3),\n", - "[ga_ls7e_ard_3](https://explorer.dea.ga.gov.au/products/ga_ls7e_ard_3),\n", - "[ga_ls8c_ard_3](https://explorer.dea.ga.gov.au/products/ga_ls8c_ard_3)\n", - "* **Special requirements:** An _optional_ description of any special requirements, e.g. If running on the [NCI](https://nci.org.au/), ensure that `module load otps` is run prior to launching this notebook\n", - "* **Prerequisites:** An _optional_ list of any notebooks that should be run or content that should be understood prior to launching this notebook\n", - "\n", - "\n", - "
\n", - " \n", - "**How you can run this notebook:** \n", - "* **DEA's Sandbox**: Some users may be eligible to sign-up for [DEA's Sandbox](https://app.sandbox.dea.ga.gov.au/) environment which provides a small amount of free compute and an ODC-compatible python environment.\n", - "* **Personal computer:** This notebook loads DEA data using [odc-stac](https://odc-stac.readthedocs.io/en/latest/). This means data is streamed across an internet connection so can be run on your personal computer provided you have the the required Python packages installed. Running `pip install dea-tools>0.4` will usually suffice.\n", - "* **Run this notebook online:** You can also use the links below to launch either a binder or GitHub Codespaces cloud compute instance to run this notebook:\n", - "\n", - "[![Launch Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/GeoscienceAustralia/dea-notebooks/develop?labpath=How_to_guides/Downloading_data_with_STAC.ipynb)\n", - "\n", - "[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new?hide_repo_select=true&ref=develop&repo=GeoscienceAustralia%2Fdea-notebooks&location=How_to_guides/Downloading_data_with_STAC.ipynb)\n", - "\n", - "
" - ] - }, { "cell_type": "markdown", "metadata": {}, @@ -293,7 +327,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.15" + "version": "3.10.18" }, "widgets": { "application/vnd.jupyter.widget-state+json": { diff --git a/requirements.txt b/requirements.txt index ea175c4b8..34b89f4e9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,4 @@ ## dea-tools will install most required packages -dea-tools>0.4.1 \ No newline at end of file +dea-tools[jupyter]>0.4 +dask-labextension +jupyter-resource-usage \ No newline at end of file From ffaf0d49681e3df1ddd246d48c5cd34a1b1a25b3 Mon Sep 17 00:00:00 2001 From: Chad Burton Date: Mon, 25 Aug 2025 12:55:31 +1000 Subject: [PATCH 05/16] Update devcontainer.json --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 004fa5860..58d448b1c 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,5 +1,5 @@ { - "name": "Sentinel-1 Hackathon", + "name": "dea-notebooks", "image": "mcr.microsoft.com/devcontainers/base:ubuntu", "features": { "ghcr.io/devcontainers/features/python:1": { From c8036fed3440ca28189c0b134a122618b434fccb Mon Sep 17 00:00:00 2001 From: Chad Burton Date: Mon, 25 Aug 2025 13:06:38 +1000 Subject: [PATCH 06/16] Update devcontainer.json --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 58d448b1c..d488f2676 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -17,7 +17,7 @@ } }, "hostRequirements": { - "cpus": 2, + "cpus": 4, "memory": "16gb", "storage": "15gb" }, From 76f8cbd288234301de39bcff3016b74ace7a64b3 Mon Sep 17 00:00:00 2001 From: cbur24 Date: Wed, 27 Aug 2025 22:13:22 +0000 Subject: [PATCH 07/16] update path --- DEA_notebooks_template.ipynb | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/DEA_notebooks_template.ipynb b/DEA_notebooks_template.ipynb index e0c1efb04..91fe9d75a 100644 --- a/DEA_notebooks_template.ipynb +++ b/DEA_notebooks_template.ipynb @@ -47,13 +47,11 @@ "\n", "- Run this notebook online: Launch a GitHub Codespaces instance to run the notebook from your browser:
\n", "\n", - " \n", - " \n", + " \n", + " \"Open\n", " \n", "\n", - " \n", - " \"Open\n", - " \n", + "\n", "\n", "\n", "\n", @@ -327,7 +325,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.18" + "version": "3.10.15" }, "widgets": { "application/vnd.jupyter.widget-state+json": { From edeb65750f0b72b2c47e53fe08f8d815f2de3e56 Mon Sep 17 00:00:00 2001 From: cbur24 Date: Wed, 27 Aug 2025 22:19:41 +0000 Subject: [PATCH 08/16] update text --- DEA_notebooks_template.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEA_notebooks_template.ipynb b/DEA_notebooks_template.ipynb index 91fe9d75a..bf3173a55 100644 --- a/DEA_notebooks_template.ipynb +++ b/DEA_notebooks_template.ipynb @@ -45,7 +45,7 @@ "\n", "- Personal computer: This notebook loads DEA data using odc-stac. Data streams across an internet connection, so it can be run locally provided you install the required Python packages, e.g. pip install dea-tools[notebooks]
\n", "\n", - "- Run this notebook online: Launch a GitHub Codespaces instance to run the notebook from your browser:
\n", + "- Run this notebook online: Click on the badge below to launch a GitHub Codespaces instance to run the notebook from your browser. See this [wiki page]() for more information.
\n", "\n", " \n", " \"Open\n", From 5810b8345d05f68cbd43cae6ce57e4bce5163d6d Mon Sep 17 00:00:00 2001 From: cbur24 Date: Thu, 28 Aug 2025 23:16:28 +0000 Subject: [PATCH 09/16] refine template for PR --- DEA_notebooks_template.ipynb | 89 +++++++++++++++++++++++------------- 1 file changed, 56 insertions(+), 33 deletions(-) diff --git a/DEA_notebooks_template.ipynb b/DEA_notebooks_template.ipynb index bf3173a55..a1ef5afa5 100644 --- a/DEA_notebooks_template.ipynb +++ b/DEA_notebooks_template.ipynb @@ -5,18 +5,24 @@ "metadata": {}, "source": [ "\n", - "\n", + "
\n", "\n", "\n", "\n", "\n", "\n", "\n", "
\n", "\n", - "

Descriptive title that follows notebook filename

\n", + "

Descriptive title that follows notebook filename

\n", "\n", "

\n", - "πŸ”Ž Visit DEA's Knowledge Hub for detailed technical information including methods, quality, and data access.\n", + "πŸ”Ž Visit DEA's Knowledge Hub for detailed technical information about the datasets and concepts used in this notebook.\n", "

\n", "\n", - "\n", - "
\n", + "

\n", + "🟒 Beginner\n", + "⚑ Runtime: ~10 mins\n", + "πŸ—“οΈ Updated: 2025-08\n", + "

\n", + "\n", + "\n", + "
\n", "πŸ“¦ Products used
\n", "ga_s2am_ard_3, \n", "ga_s2bm_ard_3, \n", @@ -26,39 +32,39 @@ "ga_ls8c_ard_3\n", "
\n", "\n", - "
\n", + "\n", + "
\n", "βš™οΈ Special requirements
\n", "Optional notes, e.g. If running on the NCI, ensure that module load otps is run prior to launching this notebook.\n", "
\n", "\n", - "
\n", + "\n", + "
\n", "πŸ“– Prerequisites
\n", "Optional list of prerequisite notebooks or background knowledge.\n", "
\n", "\n", - "
\n", - "πŸš€ How you can run this notebook
\n", + "\n", + "
\n", + "πŸš€ How you can run this notebook\n", + "\n", + "- DEA Sandbox: Eligible users can sign up for the DEA Sandbox that provides free compute and a managed Python environment.\n", "\n", - "- DEA Sandbox: Some users may be eligible to sign up for DEA's \n", - " Sandbox environment which provides \n", - " free compute and an ODC-compatible Python environment.
\n", + "- Personal computer: This notebook loads DEA data using odc-stac. Data streams across the internet, so can be run locally after installing the required DEA Tools Python package, e.g. pip install dea-tools[jupyter].\n", "\n", - "- Personal computer: This notebook loads DEA data using odc-stac. Data streams across an internet connection, so it can be run locally provided you install the required Python packages, e.g. pip install dea-tools[notebooks]
\n", "\n", - "- Run this notebook online: Click on the badge below to launch a GitHub Codespaces instance to run the notebook from your browser. See this [wiki page]() for more information.
\n", + "- Run this notebook online: Click on the badge below to launch a GitHub Codespaces instance to run the notebook from your browser. See this [wiki page]() for more information.\n", "\n", - " \n", + " \n", " \"Open\n", " \n", - "\n", - "\n", "
\n", "\n", "
\n", - " \"DEA\n", + " \"DEA\n", "
\n" @@ -71,7 +77,6 @@ "source": [ "### General advice (delete this cell before submitting for review)\n", "\n", - "* Update the **Compatibility** line depending on whether the notebook is compatible with the `NCI` and `DEA Sandbox` environments (e.g. \"Notebook currently compatible with the `DEA Sandbox` environment only\" or \"Notebook currently compatible with the `NCI` environment only\")\n", "* When adding **Products used**, embed the hyperlink to that specific product on the DEA Explorer using the `[product_name](product url)` syntax.\n", "* When writing in Markdown cells, start each sentence on a **new line**. This makes it easy to see changes through git commits.\n", "* Use Australian English in markdown cells and code comments.\n", @@ -149,14 +154,14 @@ "source": [ "%matplotlib inline\n", "\n", - "import datacube\n", - "import matplotlib.pyplot as plt\n", + "import pystac_client\n", + "import odc.stac\n", + "\n", "import numpy as np\n", "import pandas as pd\n", "import xarray as xr\n", + "import matplotlib.pyplot as plt\n", "\n", - "import sys\n", - "sys.path.insert(1, '../Tools/')\n", "from dea_tools.plotting import rgb\n" ] }, @@ -164,30 +169,48 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "### Connect to the datacube\n", + "## Connect to DEA's Explorer STAC API\n", "\n", - "Connect to the datacube so we can access DEA data.\n", - "The `app` parameter is a unique name for the analysis which is based on the notebook file name." + "This allows us to search for data through DEA's STAC catalog" ] }, { "cell_type": "code", "execution_count": null, - "metadata": { - "jupyter": { - "source_hidden": true - } - }, + "metadata": {}, + "outputs": [], + "source": [ + "catalog = pystac_client.Client.open(\"https://explorer.dea.ga.gov.au/stac\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Configure AWS access\n", + "\n", + "To load data via STAC, we must configure appropriate access to data stored on DEA’s Amazon S3 buckets. This can be done with the `odc.stac.configure_rio` function. The configuration below must be used when loading any DEA data through the STAC API.\n", + "\n", + "If opening a dask client, e.g. through `dea_tools.dask.create_local_dask_cluster()`, then this step is not required as the function handles this." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, "outputs": [], "source": [ - "dc = datacube.Datacube(app='DEA_notebooks_template')" + "odc.stac.configure_rio(\n", + " cloud_defaults=True,\n", + " aws={\"aws_unsigned\": True},\n", + ")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Analysis parameters\n", + "## Analysis parameters\n", "\n", "An *optional* section to inform the user of any parameters they'll need to configure to run the notebook:\n", "\n", From 9839ca2d7d82da280d9f5074acca6caf57b3ca5a Mon Sep 17 00:00:00 2001 From: Chad Burton Date: Fri, 29 Aug 2025 09:19:09 +1000 Subject: [PATCH 10/16] Update requirements.txt --- requirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index 34b89f4e9..82223230b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ ## dea-tools will install most required packages -dea-tools[jupyter]>0.4 +dea-tools[notebooks]>0.4 dask-labextension -jupyter-resource-usage \ No newline at end of file +jupyter-resource-usage From c0948923324467ca7267f0200ba21d6e0efae2b8 Mon Sep 17 00:00:00 2001 From: cbur24 Date: Thu, 28 Aug 2025 23:29:22 +0000 Subject: [PATCH 11/16] refine text --- DEA_notebooks_template.ipynb | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/DEA_notebooks_template.ipynb b/DEA_notebooks_template.ipynb index a1ef5afa5..4c0d78305 100644 --- a/DEA_notebooks_template.ipynb +++ b/DEA_notebooks_template.ipynb @@ -130,16 +130,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Getting started\n", - "\n", - "Provide any particular instructions that the user might need, e.g. To run this analysis, run all the cells in the notebook, starting with the \"Load packages\" cell. " - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Load packages\n", + "## Load packages\n", "Import Python packages that are used for the analysis.\n", "\n", "Use standard import commands; some are shown below. \n", From 2633d6d53ff3531132214c5489484c8073bae430 Mon Sep 17 00:00:00 2001 From: cbur24 Date: Thu, 28 Aug 2025 23:38:58 +0000 Subject: [PATCH 12/16] change pip install --- DEA_notebooks_template.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEA_notebooks_template.ipynb b/DEA_notebooks_template.ipynb index 4c0d78305..cb6242185 100644 --- a/DEA_notebooks_template.ipynb +++ b/DEA_notebooks_template.ipynb @@ -50,7 +50,7 @@ "\n", "- DEA Sandbox: Eligible users can sign up for the
DEA Sandbox that provides free compute and a managed Python environment.\n", "\n", - "- Personal computer: This notebook loads DEA data using odc-stac. Data streams across the internet, so can be run locally after installing the required DEA Tools Python package, e.g. pip install dea-tools[jupyter].\n", + "- Personal computer: This notebook loads DEA data using odc-stac. Data streams across the internet, so can be run locally after installing the required DEA Tools Python package, e.g. pip install dea-tools[notebooks].\n", "\n", "\n", "- Run this notebook online: Click on the badge below to launch a GitHub Codespaces instance to run the notebook from your browser. See this [wiki page]() for more information.\n", From f13c0e0ed4beb6056c3582f394b907864262a18b Mon Sep 17 00:00:00 2001 From: cbur24 Date: Sun, 31 Aug 2025 22:44:55 +0000 Subject: [PATCH 13/16] remove datacube --- DEA_notebooks_template.ipynb | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/DEA_notebooks_template.ipynb b/DEA_notebooks_template.ipynb index cb6242185..7b097f801 100644 --- a/DEA_notebooks_template.ipynb +++ b/DEA_notebooks_template.ipynb @@ -289,20 +289,7 @@ "Digital Earth Australia data is licensed under the [Creative Commons by Attribution 4.0](https://creativecommons.org/licenses/by/4.0/) license.\n", "\n", "**Contact:** If you need assistance, please post a question on the [Open Data Cube Discord chat](https://discord.com/invite/4hhBQVas5U) or on the [GIS Stack Exchange](https://gis.stackexchange.com/questions/ask?tags=open-data-cube) using the `open-data-cube` tag (you can view previously asked questions [here](https://gis.stackexchange.com/questions/tagged/open-data-cube)).\n", - "If you would like to report an issue with this notebook, you can file one on [GitHub](https://github.com/GeoscienceAustralia/dea-notebooks).\n", - "\n", - "**Last modified:** September 2025\n", - "\n", - "**Compatible datacube version:** " - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "print(datacube.__version__)" + "If you would like to report an issue with this notebook, you can file one on [GitHub](https://github.com/GeoscienceAustralia/dea-notebooks).\n" ] }, { @@ -339,7 +326,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.15" + "version": "3.10.18" }, "widgets": { "application/vnd.jupyter.widget-state+json": { From af4acbcd71a2de2dd75ff11d2723a4f3b9c44462 Mon Sep 17 00:00:00 2001 From: cbur24 Date: Tue, 2 Sep 2025 01:03:59 +0000 Subject: [PATCH 14/16] adding a last tested cell --- DEA_notebooks_template.ipynb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/DEA_notebooks_template.ipynb b/DEA_notebooks_template.ipynb index 7b097f801..45274d294 100644 --- a/DEA_notebooks_template.ipynb +++ b/DEA_notebooks_template.ipynb @@ -292,6 +292,23 @@ "If you would like to report an issue with this notebook, you can file one on [GitHub](https://github.com/GeoscienceAustralia/dea-notebooks).\n" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**Last Tested:**" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from datetime import datetime\n", + "datetime.today().strftime('%Y-%m-%d')" + ] + }, { "cell_type": "markdown", "metadata": {}, From b1bd13bf870ab4da2c2f5af5b3ae8ce161d1e784 Mon Sep 17 00:00:00 2001 From: Robbi Bishop-Taylor Date: Thu, 4 Sep 2025 14:30:45 +1000 Subject: [PATCH 15/16] Additional notebook template updates (#1387) * Additional notebook updates * Remove table layout, use horizontal logo * Fix formatting * Minor formatting * Update header --- DEA_notebooks_template.ipynb | 179 +++++++++++------------------------ 1 file changed, 55 insertions(+), 124 deletions(-) diff --git a/DEA_notebooks_template.ipynb b/DEA_notebooks_template.ipynb index 45274d294..99c663243 100644 --- a/DEA_notebooks_template.ipynb +++ b/DEA_notebooks_template.ipynb @@ -5,69 +5,44 @@ "metadata": {}, "source": [ "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "
\n", + "
\n", "\n", - "

Descriptive title that follows notebook filename

\n", + "\"DEA\n", + "\n", + "

Descriptive title that follows notebook filename

\n", "\n", "

\n", - "πŸ”Ž Visit DEA's Knowledge Hub for detailed technical information about the datasets and concepts used in this notebook.\n", + "πŸ”Ž Visit DEA's Knowledge Hub for detailed technical information about the datasets and concepts used in this notebook.\n", "

\n", "\n", "

\n", "🟒 Beginner\n", "⚑ Runtime: ~10 mins\n", - "πŸ—“οΈ Updated: 2025-08\n", + "πŸ—“οΈ Updated: 2025-08\n", "

\n", "\n", - "\n", - "
\n", - "πŸ“¦ Products used
\n", - "ga_s2am_ard_3, \n", - "ga_s2bm_ard_3, \n", - "ga_s2cm_ard_3, \n", - "ga_ls5t_ard_3, \n", - "ga_ls7e_ard_3, \n", - "ga_ls8c_ard_3\n", - "
\n", "\n", - "\n", - "
\n", - "βš™οΈ Special requirements
\n", - "Optional notes, e.g. If running on the NCI, ensure that module load otps is run prior to launching this notebook.\n", - "
\n", "\n", - "\n", - "
\n", - "πŸ“– Prerequisites
\n", - "Optional list of prerequisite notebooks or background knowledge.\n", + "\n", + "
\n", + "πŸ“¦ Products used
\n", + "ga_s2am_ard_3, \n", + "ga_s2bm_ard_3, \n", + "ga_s2cm_ard_3, \n", + "ga_ls5t_ard_3, \n", + "ga_ls7e_ard_3, \n", + "ga_ls8c_ard_3\n", "
\n", "\n", - "\n", - "
\n", - "πŸš€ How you can run this notebook\n", - "\n", - "- DEA Sandbox: Eligible users can sign up for the DEA Sandbox that provides free compute and a managed Python environment.\n", + "\n", + "
\n", + "πŸš€ How you can run this notebook
\n", "\n", - "- Personal computer: This notebook loads DEA data using odc-stac. Data streams across the internet, so can be run locally after installing the required DEA Tools Python package, e.g. pip install dea-tools[notebooks].\n", + "- DEA Sandbox: Eligible users can sign up for the DEA Sandbox that provides free compute and a managed Python environment.\n", "\n", + "- Personal computer: This notebook loads DEA data using odc-stac. Data streams via the internet, so can be run locally after installing the required DEA Tools Python package, e.g. pip install dea-tools[notebooks].\n", "\n", - "- Run this notebook online: Click on the badge below to launch a GitHub Codespaces instance to run the notebook from your browser. See this [wiki page]() for more information.\n", - "\n", - " \n", - " \"Open\n", - " \n", - "
\n", - "\n", - "
\n", - " \"DEA\n", - "
\n" + "\n" ] }, { @@ -75,30 +50,26 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "### General advice (delete this cell before submitting for review)\n", - "\n", - "* When adding **Products used**, embed the hyperlink to that specific product on the DEA Explorer using the `[product_name](product url)` syntax.\n", - "* When writing in Markdown cells, start each sentence on a **new line**. This makes it easy to see changes through git commits.\n", - "* Use Australian English in markdown cells and code comments.\n", - "* See the [Knowledge Hub formatting troubleshooting guide](https://github.com/GeoscienceAustralia/dea-notebooks/wiki/Troubleshooting-Knowledge-Hub-formatting) to ensure your formatting will display properly on the [DEA Knowledge Hub](https://knowledge.dea.ga.gov.au/). Things to be aware of:\n", - " * Sphinx is highly sensitive to bulleted lists:\n", - " * Ensure that there is an empty line between any preceding text and the list\n", - " * Only use the `*` bullet (`-` is not recognised)\n", - " * Sublists must be indented by 4 spaces \n", - " * Two kinds of formatting cannot be used simultaneously:\n", - " * Hyperlinked code: \\[\\`code_format\\`](hyperlink) fails\n", - " * Bolded code: \\*\\*\\`code_format\\`\\*\\* fails\n", - " * Headers must appear in heirachical order (`#`, `##`, `###`, `####`) and there can only be one title (`#`).\n", - "* Use the [PEP8 standard](https://www.python.org/dev/peps/pep-0008/) for code. To make sure all code in the notebook is consistent, you can use the `jupyterlab_code_formatter` tool: select each code cell, then click `Edit` and then one of the `Apply X Formatter` options (`YAPF` or `Black` are recommended). This will reformat the code in the cell to a consistent style.\n", - "* For additional guidance, refer to the style conventions and layouts in approved `develop` branch notebooks. Examples include:\n", - " * [How_to_guides/Using_load_ard.ipynb](../How_to_guides/Using_load_ard.ipynb)\n", - " * [Real_world_examples/Coastal_erosion.ipynb](../Real_world_examples/Coastal_erosion.ipynb)\n", - " * [Tools/dea_tools/datahandling.py](../Tools/dea_tools/datahandling.py)\n", - "* In the final notebook cell, include a set of relevant tags which are used to build the DEA User Guide's [Tag Index](https://knowledge.dea.ga.gov.au/genindex/). \n", - "Use all lower-case (unless the tag is an acronym), separate words with spaces (unless it is the name of an imported module), and [re-use existing tags](https://github.com/GeoscienceAustralia/dea-notebooks/wiki/List-of-tags).\n", - "Ensure the tags cell below is in `Raw` format, rather than `Markdown` or `Code`.\n", - "\n", - "---\n" + "> ### General advice (delete this cell before submitting for review)\n", + ">\n", + "> * When adding **Products used**, embed the hyperlink to that specific product page on the [DEA Knowledge Hub](https://knowledge.dea.ga.gov.au/data/) using the `[product ID](product url)` syntax.\n", + "> * When writing in Markdown cells, start each sentence on a **new line**. This makes it easy to see changes through Git commits.\n", + "> * Use Australian English in markdown cells and code comments.\n", + "> * See the [Knowledge Hub formatting troubleshooting guide](https://github.com/GeoscienceAustralia/dea-notebooks/wiki/Troubleshooting-Knowledge-Hub-formatting) to ensure your formatting will display properly on the [DEA Knowledge Hub](https://knowledge.dea.ga.gov.au/). Things to be aware of:\n", + "> * Sphinx is highly sensitive to bulleted lists:\n", + "> * Ensure that there is an empty line between any preceding text and the list\n", + "> * Only use the `*` bullet (`-` is not recognised)\n", + "> * Sublists must be indented by 4 spaces \n", + "> * Two kinds of formatting cannot be used simultaneously:\n", + "> * Hyperlinked code: \\[\\`code_format\\`](hyperlink) fails\n", + "> * Bolded code: \\*\\*\\`code_format\\`\\*\\* fails\n", + "> * Headers must appear in heirachical order (`#`, `##`, `###`, `####`) and there can only be one title (`#`).\n", + "> * Use the [PEP8 standard](https://www.python.org/dev/peps/pep-0008/) for code. To make sure all code in the notebook is consistent, you can use the `jupyterlab_code_formatter` tool: select each code cell, then click `Edit` and then one of the `Apply X Formatter` options (`YAPF` or `Black` are recommended). This will reformat the code in the cell to a consistent style.\n", + "> * For additional guidance, refer to the style conventions and layouts in approved `develop` branch notebooks. Examples include:\n", + "> * [How_to_guides/Using_load_ard.ipynb](../How_to_guides/Using_load_ard.ipynb)\n", + "> * [Real_world_examples/Coastal_erosion.ipynb](../Real_world_examples/Coastal_erosion.ipynb)\n", + "> * [Tools/dea_tools/datahandling.py](../Tools/dea_tools/datahandling.py)\n", + ">" ] }, { @@ -133,8 +104,8 @@ "## Load packages\n", "Import Python packages that are used for the analysis.\n", "\n", - "Use standard import commands; some are shown below. \n", - "Begin with any `iPython` magic commands, followed by standard Python packages, then any additional functionality you need from the `Tools` directory." + "Use standard import commands; some are shown below.\n", + "Begin with any `iPython` magic commands (if required), followed by standard Python packages, then any additional functionality from the `dea_tools` Python package." ] }, { @@ -143,8 +114,6 @@ "metadata": {}, "outputs": [], "source": [ - "%matplotlib inline\n", - "\n", "import pystac_client\n", "import odc.stac\n", "\n", @@ -160,29 +129,12 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Connect to DEA's Explorer STAC API\n", + "## Connect to DEA's STAC API\n", "\n", - "This allows us to search for data through DEA's STAC catalog" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "catalog = pystac_client.Client.open(\"https://explorer.dea.ga.gov.au/stac\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Configure AWS access\n", + "This allows us to search for data using DEA's STAC API (refer to the [SpatioTemporal Asset Catalogue guide](https://knowledge.dea.ga.gov.au/guides/setup/gis/stac/) for details).\n", "\n", - "To load data via STAC, we must configure appropriate access to data stored on DEA’s Amazon S3 buckets. This can be done with the `odc.stac.configure_rio` function. The configuration below must be used when loading any DEA data through the STAC API.\n", - "\n", - "If opening a dask client, e.g. through `dea_tools.dask.create_local_dask_cluster()`, then this step is not required as the function handles this." + "To load data, we must also configure access to DEA's Amazon S3 buckets using `odc.stac.configure_s3_access`.\n", + "If launching a Dask client (e.g. `dea_tools.dask.create_local_dask_cluster()`), this is done automatically." ] }, { @@ -191,10 +143,11 @@ "metadata": {}, "outputs": [], "source": [ - "odc.stac.configure_rio(\n", - " cloud_defaults=True,\n", - " aws={\"aws_unsigned\": True},\n", - ")" + "# Configure data access\n", + "odc.stac.configure_s3_access(cloud_defaults=True, aws_unsigned=True)\n", + "\n", + "# Connect to STAC API\n", + "catalog = pystac_client.Client.open(\"https://explorer.dea.ga.gov.au/stac\")\n" ] }, { @@ -289,14 +242,9 @@ "Digital Earth Australia data is licensed under the [Creative Commons by Attribution 4.0](https://creativecommons.org/licenses/by/4.0/) license.\n", "\n", "**Contact:** If you need assistance, please post a question on the [Open Data Cube Discord chat](https://discord.com/invite/4hhBQVas5U) or on the [GIS Stack Exchange](https://gis.stackexchange.com/questions/ask?tags=open-data-cube) using the `open-data-cube` tag (you can view previously asked questions [here](https://gis.stackexchange.com/questions/tagged/open-data-cube)).\n", - "If you would like to report an issue with this notebook, you can file one on [GitHub](https://github.com/GeoscienceAustralia/dea-notebooks).\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "**Last Tested:**" + "If you would like to report an issue with this notebook, you can file one on [GitHub](https://github.com/GeoscienceAustralia/dea-notebooks).\n", + "\n", + "**Last tested:**\n" ] }, { @@ -308,23 +256,6 @@ "from datetime import datetime\n", "datetime.today().strftime('%Y-%m-%d')" ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Tags\n", - "" - ] - }, - { - "cell_type": "raw", - "metadata": { - "raw_mimetype": "text/restructuredtext" - }, - "source": [ - "**Tags**: :index:`template`, :index:`sandbox compatible`, " - ] } ], "metadata": { From 293af5e6a1c5df27e496fcd7390ab12a4058419e Mon Sep 17 00:00:00 2001 From: Robbi Bishop-Taylor Date: Thu, 4 Sep 2025 14:37:12 +1000 Subject: [PATCH 16/16] Fix missing content --- DEA_notebooks_template.ipynb | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/DEA_notebooks_template.ipynb b/DEA_notebooks_template.ipynb index 99c663243..ad1bab08a 100644 --- a/DEA_notebooks_template.ipynb +++ b/DEA_notebooks_template.ipynb @@ -21,8 +21,6 @@ "πŸ—“οΈ Updated: 2025-08\n", "

\n", "\n", - "\n", - "\n", "\n", "
\n", "πŸ“¦ Products used
\n", @@ -34,6 +32,30 @@ "ga_ls8c_ard_3\n", "
\n", "\n", + "\n", + "
\n", + "βš™οΈ Special requirements
\n", + "Optional notes, e.g. If running on the NCI, ensure that module load otps is run prior to launching this notebook.\n", + "
\n", + "\n", + "\n", + "
\n", + "🧾 Prerequisites
\n", + "Optional list of prerequisite notebooks or background knowledge, e.g. Run the XYZ notebook before running this.\n", + "
\n", + "\n", + "\n", + "
\n", + "πŸ“ Citation
\n", + "Optional description of any notebook-specific acknowledgement/citation requirements, e.g. Please cite Krause et al. (2021) when using the results of this notebook.\n", + "
\n", + "\n", + "\n", + "
\n", + "⚠️ Important
\n", + "Optional important notes to be highlighted, e.g. This notebook is not to be used for safety of life decisions.\n", + "
\n", + "\n", "\n", "
\n", "πŸš€ How you can run this notebook
\n", @@ -42,6 +64,13 @@ "\n", "- Personal computer: This notebook loads DEA data using odc-stac. Data streams via the internet, so can be run locally after installing the required DEA Tools Python package, e.g. pip install dea-tools[notebooks].\n", "\n", + "\n", + "\n", "
\n" ] },