Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
154 changes: 113 additions & 41 deletions Beginners_guide/01_Jupyter_notebooks.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,44 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Introduction to Jupyter notebooks <img align=\"right\" src=\"../Supplementary_data/dea_logo.jpg\">\n",
"<!-- DEA Notebook Header -->\n",
"<div style=\"font-family:'Segoe UI',Roboto,sans-serif; line-height:1.6; color:CanvasText; padding:32px;\">\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",
"* **Prerequisites**: \n",
" * There is no prerequisite learning required, as this document is designed for a novice user of the Jupyter environment"
"<img src=\"https://raw.githubusercontent.com/GeoscienceAustralia/dea-notebooks/stable/Supplementary_data/dea_logo_wide.jpg\" alt=\"DEA Notebooks logo\" style=\"width:86.5%;\">\n",
"\n",
"<h1>Introduction to Jupyter notebooks</h1>\n",
"\n",
"<p>\n",
"🔎 Visit <a href=\"https://knowledge.dea.ga.gov.au\">DEA's Knowledge Hub</a> for detailed technical information about the datasets and concepts used in this notebook.\n",
"</p>\n",
"\n",
"<p>\n",
"<span style=\"display:inline-block; font-size:12px; background:rgba(59,130,246,0.15); border-radius:12px; padding:3px 10px; margin-right:6px;\">🟢 Beginner</span>\n",
"<span style=\"display:inline-block; font-size:12px; background:rgba(16,185,129,0.15); border-radius:12px; padding:3px 10px; margin-right:6px;\">⚡ Time to complete: ~10 mins</span>\n",
"<span style=\"display:inline-block; font-size:12px; background:rgba(107,114,128,0.15); border-radius:12px; padding:3px 10px; margin-right:6px;\">🗓️ Updated: 2025-12</span>\n",
"</p>\n",
"\n",
"\n",
"<!-- Prerequisites - OPTIONAL, delete if not required -->\n",
"<div style=\"margin-bottom:12px; padding:12px; background:rgba(59,130,246,0.08); border:1px solid rgb(59,130,246); border-radius:8px; max-width:85%;\">\n",
"<b>🧾 Prerequisites</b><br>\n",
"There is no prerequisite learning required, as this document is designed for a novice user of the Jupyter environment\n",
"</div>\n",
"\n",
"<!-- How to run - REQUIRED -->\n",
"<div style=\"margin-bottom:12px; padding:12px; background:rgba(16,185,129,0.1); border:1px solid rgb(16,185,129); border-radius:8px; max-width:85%;\">\n",
"<b>🚀 How you can run this notebook</b><br>\n",
"\n",
"- <b>DEA Sandbox:</b> Eligible users can sign up for the <a href=\"https://knowledge.dea.ga.gov.au/guides/setup/Sandbox/sandbox/\">DEA Sandbox</a> that provides free compute and a managed Python environment.\n",
"\n",
"- <b>Run this notebook online:</b> Click on the badge below to launch a GitHub Codespaces instance to run the notebook from your browser. See this <a href=\"\">wiki page</a> for more information.\n",
"\n",
" <a href=\"https://codespaces.new/GeoscienceAustralia/dea-notebooks/tree/template?quickstart=1\" target=\"_blank\">\n",
" <img src=\"https://img.shields.io/badge/Codespaces-Open-blue?logo=github\" alt=\"Open in GitHub Codespaces\" style=\"height:25px;\">\n",
" </a>\n",
"</div>\n",
"\n",
"</div>"
]
},
{
Expand All @@ -20,7 +52,7 @@
"Access to implementations of the [Open Data Cube](https://www.opendatacube.org/) such as [Digital Earth Australia](https://www.ga.gov.au/dea) and [Digital Earth Africa](https://www.digitalearthafrica.org/) is achieved through the use of Python code and [Jupyter Notebooks](https://jupyterlab.readthedocs.io/en/stable/user/notebook.html).\n",
"The Jupyter Notebook (also termed notebook from here onwards) is an interactive web application that allows for the viewing, creation and documentation of live code.\n",
"Notebook applications include data transformation, visualisation, modelling and machine learning.\n",
"The default web interface to access notebooks when using either the National Computational Infrastructure (NCI) or the DEA Sandbox is [JupyterLab](https://jupyterlab.readthedocs.io/en/stable/)."
"The default web interface to access notebooks when using the DEA Sandbox is [JupyterLab](https://jupyterlab.readthedocs.io/en/stable/)."
]
},
{
Expand Down Expand Up @@ -68,9 +100,17 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 4,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"I ran a cell!\n"
]
}
],
"source": [
"print(\"I ran a cell!\")"
]
Expand All @@ -92,10 +132,19 @@
"* `[*]:` means that the cell is currently running.\n",
"* `[1]:` means that the cell has finished running and was the first cell run.\n",
"\n",
"The number indicates the order that the cells were run in.\n",
"\n",
"> **Note:** To check whether a cell is currently executing in a Jupyter notebook, inspect the small circle in the top-right of the window. \n",
"The circle will turn grey (\"Kernel busy\") when the cell is running, and return to empty (\"Kernel idle\") when the process is complete."
"The number indicates the order that the cells were run in.\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<div class=\"alert alert-info\">\n",
" \n",
"**Note:** To check whether a cell is currently executing in a Jupyter notebook, inspect the small circle in the top-right of the window. \n",
"The circle will turn grey (\"Kernel busy\") when the cell is running, and return to empty (\"Kernel idle\") when the process is complete.\n",
" \n",
"</div>"
]
},
{
Expand All @@ -122,9 +171,17 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 5,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"This is a code cell\n"
]
}
],
"source": [
"print(\"This is a code cell\")"
]
Expand Down Expand Up @@ -163,7 +220,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -206,9 +263,18 @@
"Below the heading \"Notebook\", click the large \"Python 3\" button.\n",
"This will create a new notebook entitled \"Untitled.ipynb\" in the chosen directory.\n",
"\n",
"To rename this notebook to something more useful, right-click on it in the file browser and select \"Rename\".\n",
"\n",
"> **Note:** The `dea-notebooks` repository provides a **template notebook** containing a consistent structure and style that is recommended for all DEA Jupyter notebooks. To use this template rather than start a notebook from scratch, click [this link to open the \"DEA_notebooks_template.ipynb\"](https://github.com/GeoscienceAustralia/dea-notebooks/blob/develop/DEA_notebooks_template.ipynb) notebook, then click \"File\" and \"Save Notebook As...\" to create a copy of the template in your desired location."
"To rename this notebook to something more useful, right-click on it in the file browser and select \"Rename\".\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<div class=\"alert alert-info\">\n",
" \n",
"**Note:** The `dea-notebooks` repository provides a **template notebook** containing a consistent structure and style that is recommended for all DEA Jupyter notebooks. To use this template rather than start a notebook from scratch, click [this link to open the \"DEA_notebooks_template.ipynb\"](https://github.com/GeoscienceAustralia/dea-notebooks/blob/develop/DEA_notebooks_template.ipynb) notebook, then click \"File\" and \"Save Notebook As...\" to create a copy of the template in your desired location.\n",
" \n",
"</div>"
]
},
{
Expand All @@ -224,25 +290,27 @@
"1. **Jupyter Notebooks (this notebook)**\n",
"2. [Digital Earth Australia](02_DEA.ipynb)\n",
"3. [Products and Measurements](03_Products_and_measurements.ipynb)\n",
"4. [Loading data](04_Loading_data.ipynb)\n",
"5. [Plotting](05_Plotting.ipynb)\n",
"6. [Performing a basic analysis](06_Basic_analysis.ipynb)\n",
"7. [Introduction to Numpy](07_Intro_to_numpy.ipynb)\n",
"8. [Introduction to Xarray](08_Intro_to_xarray.ipynb)\n",
"9. [Parallel processing with Dask](09_Parallel_processing_with_Dask.ipynb)\n",
"4. [Loading data with STAC](04a_Loading_data_STAC.ipynb)\n",
"5. [Loading data with datacube](04b_Loading_data_datacube.ipynb)\n",
"6. [Plotting](05_Plotting.ipynb)\n",
"7. [Performing a basic analysis](06_Basic_analysis.ipynb)\n",
"8. [Introduction to Numpy](07_Intro_to_numpy.ipynb)\n",
"9. [Introduction to Xarray](08_Intro_to_xarray.ipynb)\n",
"10. [Parallel processing with Dask](09_Parallel_processing_with_Dask.ipynb)\n",
"\n",
"Once you have worked through the beginner's guide, you can join advanced users by exploring:\n",
"\n",
"* The \"DEA_products\" directory in the repository, where you can explore DEA products in depth.\n",
"* The \"How_to_guides\" directory, which contains a recipe book of common techniques and methods for analysing DEA data.\n",
"* The \"Real_world_examples\" directory, which provides more complex workflows and analysis case studies."
"* The [DEA_products](https://github.com/GeoscienceAustralia/dea-notebooks/tree/develop/DEA_products) directory in the repository, where you can explore DEA products in depth.\n",
"* The [How_to_guides](https://github.com/GeoscienceAustralia/dea-notebooks/tree/develop/How_to_guides) directory, which contains a recipe book of common techniques and methods for analysing DEA data.\n",
"* The [Real_world_examples](https://github.com/GeoscienceAustralia/dea-notebooks/tree/develop/Real_world_examples) directory, which provides more complex workflows and analysis case studies."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"***\n",
"\n",
"## Additional information\n",
"\n",
"**License:** The code in this notebook is licensed under the [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0). \n",
Expand All @@ -251,24 +319,28 @@
"**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:** December 2023"
"**Last tested:**\n"
]
},
{
"cell_type": "markdown",
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'2025-12-09'"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"## Tags\n",
"<!-- Browse all available tags on the DEA User Guide's [Tags Index](https://knowledge.dea.ga.gov.au/genindex/) -->"
]
},
{
"cell_type": "raw",
"metadata": {
"raw_mimetype": "text/restructuredtext"
},
"source": [
"**Tags**: :index:`sandbox compatible`, :index:`NCI compatible`, :index:`beginner`, :index:`export`, :index:`jupyterlab`, :index:`jupyter notebook`, :index:`code cells`, :index:`markdown cells`, :index:`raw cells`"
"from datetime import datetime\n",
"datetime.today().strftime('%Y-%m-%d')"
]
}
],
Expand All @@ -288,7 +360,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.10"
"version": "3.11.14"
},
"widgets": {
"application/vnd.jupyter.widget-state+json": {
Expand Down
Loading