{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Open Data Cube Workshop Material \n", "\n", "* **Compatibility:** Notebook currently compatible with the `DEA Sandbox` environments\n", "* **Prerequisites:** Users will benefit from having some experience with Python code prior to participation in this workshop\n", "---\n", "## Introduction\n", "These materials will introduce working with Digital Earth Australia (DEA) data in the DEA Sandbox environment for the Open Data Cube (ODC). \n", "The tutorial is broken into the following sections:\n", "\n", "1. Getting started: Accessing the Sandbox\n", "2. Jupyter Notebooks: What are they and how to use them? \n", "3. Using interactive notebooks: Run a simple interactive notebook to perform a temporal analysis using DEA data\n", "4. Do it yourself: Run and modify Python code to load, analyse and visualise data\n", "5. Build it yourself: Explore the dea-notebooks code repository and build your own notebooks to answer specific analysis questions.\n", "6. Learning more: How to continue exploring DEA data and resources \n", "\n", "At the end of the tutorial you will know how to use a Jupyter Notebook in conjunction with the ODC to access and analyse Earth observation data. \n", "The tutorial should take around two hours to complete.\n", "\n", "Notes for taking the workshop:\n", "\n", "* It's a good idea to read this document from within the DEA Sandbox. Navigate to it at \"Beginners_guide/Guided_tutorial.ipynb.\"\n", "* For each notebook that you run, you should clear the example output by going to \"Edit\" > \"Clear All Outputs.\"\n", "\n", "---\n", "\n", "## 1. Getting started\n", "\n", "The DEA Sandbox is a learning and analysis environment for getting started with Digital Earth Australia and the Open Data Cube. \n", "It includes sample data and Jupyter notebooks that demonstrate the capability of the Open Data Cube.\n", "\n", "#### Sign up for a DEA Sandbox Account\n", "\n", "The DEA Sandbox uses requires you to create an account to log in. \n", "Please visit [https://app.sandbox.dea.ga.gov.au/](https://app.sandbox.dea.ga.gov.au/) to sign up for a new account (a verification code will be sent to the email address you register with), or log in if you already have one. \n", "\n", "#### Accessing the DEA Sandbox\n", "\n", "After signing into the DEA Sandbox, your Jupyter environment will be created and you should see a loading screen while the system is working to prepare the environment.\n", "\n", "Once signed in, the JupyterLab homepage should appear. \n", "The JupyterLab interface consists of the main work area (right-hand panel), the left sidebar (containing a file browser and other useful features), and a menu bar along the top:\n", "\n", "![Sandbox work area](../Supplementary_data/Beginners_guide_Guided_tutorial/sandbox-jupyterlab-startup.png)\n", "\n", "---\n", "\n", "## 2. Jupyter Notebooks\n", "\n", "[Jupyter](https://jupyter.org/) is an interactive coding environment that allows you to create and share documents, as Jupyter Notebooks, that contain live code, equations, visualizations and narrative text. Uses include: data cleaning and transformation, numerical simulation, statistical modeling, data visualization, machine learning, and much more.\n", "\n", "The name ‘Jupyter’ comes from Julia, Python and R, which are all programming languages that are used in scientific computing. Jupyter started as a purely Python-based environment called iPython, but there has been rapid progress over the last few years, and now many large organisations like [Netflix](https://netflixtechblog.com/notebook-innovation-591ee3221233) are using the system to analyse data.\n", "\n", "As the ODC is a Python library, the workshop will cover working with Earth observation data in Python-based notebooks.\n", "\n", "#### Getting started with Jupyter\n", "\n", "The first exercise is to explore and understand some key features of the Jupyter notebook, including how to run cells containing code, and edit documentation. \n", "\n", "Click the link to run the following notebook and return here when you have worked through the examples:\n", "\n", "[Introduction to Jupyter notebooks](01_Jupyter_notebooks.ipynb). \n", "\n", "---\n", "\n", "## 3. Using interactive notebooks\n", "\n", "A major feature of the Open Data Cube approach is its spatiotemporal data richness and searchability. \n", "The following notebook has been designed as an application, with almost all of the code stored in the background as a function.\n", "Its purpose is to show users the temporal data richness that is stored in the DEA archive.\n", "In this notebook, the most recent 12 months worth of Sentinel 2 data is loaded over a predetermined location.\n", "Users can select small sub-locations to compare changes in the relative greenness (NDVI) response over time.\n", "\n", "![Crop_health](../Supplementary_data/ODC_workshop/crop_health.png)\n", "\n", "Click the link to run the following notebook and return here when you have worked through the examples:\n", "\n", "[Measuring crop health](../Interactive_apps/Crop_health.ipynb)\n", "\n", "---\n", "\n", "## 4. Do it yourself\n", "\n", "This activity uses a code-based Jupyter notebook to demonstrate how the ODC Python API works. \n", "This example includes the following analysis steps:\n", "\n", "- Picking a study site in Australia\n", "- Loading satellite data for that area\n", "- Plotting red, green and blue satellite bands as a true colour image\n", "- Using a vegetation index to calculate the \"greenness\" of an image\n", "- Exporting your data to a raster file\n", "\n", "#### Next steps\n", "Once you have run the notebook in its entirety, return to the top and experiment with changing some of the variables. \n", "For example, consider setting a new study location, and/or changing the time period of the analysis.\n", "\n", "Click the link to run the following notebook and return here when you have worked through the examples:\n", "\n", "[Performing a basic analysis](06_Basic_analysis.ipynb)\n", "\n", "---\n", "\n", "## 5. Build it yourself\n", "\n", "For the next excercise, we will build a new analysis focused around a specific scientific question: \n", "\n", ">*Monitor how waterbodies in Australia have changed over time using satellite data.*\n", "\n", "Choose one of the following options depending on difficulty: \n", "\n", "#### *Intermediate level*: Update the basic analysis notebook to study changes in water over time\n", "\n", "Starting at the top of the [Performing a basic analysis](06_Basic_analysis.ipynb) notebook, modify the notebook to change the analysis to focus on monitoring changes in water over time. \n", "This could involve:\n", "\n", "- Changing the study area to a location with a waterbody (e.g. Canberra's Lake Tuggeranong, or Lake Menindee in western New South Wales)\n", "- Change the Normalised Difference Vegetation Index (NDVI) used in the notebook to a new index that is better for monitoring water. \n", "For example, the Normalised Difference Water Index (NDWI) that is used to monitor changes related to water content in water bodies:\n", "\n", "![NDWI](../Supplementary_data/ODC_workshop/ndwi.jpg)\n", "\n", "- Plot the output water index results for different timesteps to compare how distributions of water have changed over time.\n", "\n", "\n", "#### *Advanced level*: Build a new analysis from scratch\n", "\n", "Starting from a blank notebook ([hint](01_Jupyter_notebooks.ipynb)), build a new analysis from scratch using content from the [Performing a basic analysis](06_Basic_analysis.ipynb) notebook, and code from other notebooks in the [Digital Earth Australia Notebooks repository](https://github.com/GeoscienceAustralia/dea-notebooks/). For example, this could involve:\n", "\n", "- Using the `load_ard` function to load cloud-free Landsat or Sentinel-2 imagery (see the [Using load_ard](../How_to_guides/Using_load_ard.ipynb) notebook)\n", "- Calculating a water index (e.g. Normalised Difference Water Index or NDWI) using the `calculate_indices` function (see the [Calculating_band_indices](../How_to_guides/Calculating_band_indices.ipynb) notebook)\n", "- Plot the output water index results for different timesteps to compare how distributions of water have changed over time.\n", "\n", "\n", "#### *Tips*\n", "\n", "- You can view multiple notebooks simultaneously in Jupyter Lab. Simply click and\n", " drag your notebook tab to the right hand side of your screen for a side by side\n", " view.\n", "- All the code in this repository is open source and we encourage code recycling\n", " to fit your needs. Therefore, you can copy/paste cells between notebooks by\n", " right-clicking inside a cell, selecting `Copy Cells` and then navigating to your\n", " desired paste-location and right click any cell then selecting 'Paste Cells\n", " Below'\n", " \n", "---\n", "\n", "## 6. Learning more\n", "\n", "For a more detailed introduction to Digital Earth Australia and the Open Data Cube, we recommend running the entire set of Beginner's Guide notebooks located in this folder, starting with [Performing a basic analysis](06_Basic_analysis.ipynb) and continuing on to [Parallel processing with Dask.ipynb](09_Parallel_processing_with_Dask.ipynb).\n", "\n", "![Dask notebook](../Supplementary_data/ODC_workshop/dask.PNG)\n", "\n", "You can now join more advanced users in 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 focused on answering real-world scientific and management problems using the Open Data Cube.\n", "\n", "\n", "\n", "***\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", "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 Slack channel](http://slack.opendatacube.org/) 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:** April 2023\n", "\n", "## Tags\n", "" ] }, { "cell_type": "raw", "metadata": { "raw_mimetype": "text/restructuredtext" }, "source": [ "**Tags**: :index:`sandbox compatible`, :index:`beginners guide`, :index:`ODC workshop`" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.10" }, "widgets": { "application/vnd.jupyter.widget-state+json": { "state": {}, "version_major": 2, "version_minor": 0 } } }, "nbformat": 4, "nbformat_minor": 4 }