diff --git a/notebooks/contributions/Sentinel_2.ipynb b/notebooks/contributions/Sentinel_2.ipynb new file mode 100644 index 00000000..da515982 --- /dev/null +++ b/notebooks/contributions/Sentinel_2.ipynb @@ -0,0 +1,861 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "3e962f1a", + "metadata": { + "tags": [ + "papermill-error-cell-tag" + ] + }, + "source": [ + "An Exception was encountered at 'In [2]'." + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "455aa742", + "metadata": { + "execution": { + "iopub.execute_input": "2022-01-13T14:56:44.376074Z", + "iopub.status.busy": "2022-01-13T14:56:44.375087Z", + "iopub.status.idle": "2022-01-13T14:56:44.447007Z", + "shell.execute_reply": "2022-01-13T14:56:44.446339Z" + }, + "papermill": { + "duration": 0.137492, + "end_time": "2022-01-13T14:56:44.447139", + "exception": false, + "start_time": "2022-01-13T14:56:44.309647", + "status": "completed" + }, + "tags": [] + }, + "outputs": [ + { + "data": { + "text/html": [ + "" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "This notebook is compatible with this base image version (user-2021.12)." + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/markdown": [ + "\n", + "\n", + "---------\n", + "\n", + "The following environment variables are available:\n", + "\n", + "* `GEODB_AUTH_AUD`, `GEODB_AUTH_CLIENT_ID`, `GEODB_AUTH_DOMAIN`, `GEODB_API_SERVER_URL`, `GEODB_AUTH_CLIENT_SECRET`, `GEODB_API_SERVER_PORT`\n", + "* `SH_CLIENT_ID`, `SH_INSTANCE_ID`, `SH_CLIENT_NAME`, `SH_CLIENT_SECRET`\n", + "* `XCUBE_GEN_AUTH_AUD`, `XCUBE_GEN_API_SERVER_PORT`, `XCUBE_GEN_AUTH_DOMAIN`, `XCUBE_GEN_AUTH_CLIENT_ID`, `XCUBE_GEN_AUTH_CLIENT_SECRET`, `XCUBE_GEN_API_SERVER_URL`\n" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "from edc import check_compatibility\n", + "check_compatibility(\"user-2021.12\", dependencies=[\"GEODB\", \"SH\", \"XCUBE_GEN\"])" + ] + }, + { + "cell_type": "markdown", + "id": "77de060d", + "metadata": { + "papermill": { + "duration": 0.058329, + "end_time": "2022-01-13T14:56:44.578744", + "exception": false, + "start_time": "2022-01-13T14:56:44.520415", + "status": "completed" + }, + "tags": [] + }, + "source": [ + "# Sentinel-2 \n", + "\n", + "* [**Sign up to the DEA Sandbox**](https://docs.dea.ga.gov.au/setup/sandbox.html) to run this notebook interactively from a browser\n", + "* **Compatibility:** Notebook currently compatible with both the `NCI` and `DEA Sandbox` environments\n", + " * One step of the analysis ('Sentinel-2 Near Real Time') is currently only compatible with the DEA Sandbox\n", + "* **Products used:** \n", + "[s2a_ard_granule](https://explorer.sandbox.dea.ga.gov.au/s2a_ard_granule), \n", + "[s2b_ard_granule](https://explorer.sandbox.dea.ga.gov.au/s2b_ard_granule),\n", + "[s2a_nrt_granule](https://explorer.sandbox.dea.ga.gov.au/s2a_nrt_granule), \n", + "[s2b_nrt_granule](https://explorer.sandbox.dea.ga.gov.au/s2b_nrt_granule)\n" + ] + }, + { + "cell_type": "markdown", + "id": "fd7ac5e8", + "metadata": { + "papermill": { + "duration": 0.058306, + "end_time": "2022-01-13T14:56:44.696748", + "exception": false, + "start_time": "2022-01-13T14:56:44.638442", + "status": "completed" + }, + "tags": [] + }, + "source": [ + "## Background\n", + "\n", + "Sentinel-2 is an Earth observation mission from the EU Copernicus Programme that systematically acquires optical imagery at high spatial resolution (up to 10 m for some bands).\n", + "The mission is based on a constellation of two identical satellites in the same orbit, 180° apart for optimal coverage and data delivery.\n", + "Together, they cover all Earth's land surfaces, large islands, inland and coastal waters every 3-5 days.\n", + "\n", + "Sentinel-2A was launched on 23 June 2015 and Sentinel-2B followed on 7 March 2017.\n", + "Both of the Sentinel-2 satellites carry an innovative wide swath high-resolution multispectral imager with 13 spectral bands.\n", + "For more information on the Sentinel-2 platforms and applications, check out the [European Space Agency website](http://www.esa.int/Applications/Observing_the_Earth/Copernicus/Overview4).\n", + "\n", + "Digital Earth Australia (DEA) applies corrections to Sentinel-2 satellite images to arrive at a [surface reflectance](https://cmi.ga.gov.au/ga_s2_m_nbart_1) product (see the [introduction to Digtial Earth Australia](../Beginners_guide/02_DEA.ipynb) section for more information on the surface reflectance corrections).\n", + "Surface reflectance provides standardised optical datasets by using robust physical models to correct for variations in image radiance values due to atmospheric properties, as well as sun and sensor geometry.\n", + "The resulting stack of surface reflectance grids are consistent over space and time, which is instrumental in identifying and quantifying environmental change.\n", + "\n", + "DEA provides two Sentinel-2 surface reflectance products:\n", + "\n", + "1. **Sentinel-2 Definitive** (e.g. `s2a_ard_granule`): These products represent the 'definitive' source of high quality Sentinel-2 surface reflectance data, and are available from the beginning of the Sentinel-2 archive up to a delay of several weeks. \n", + "\n", + "2. **Sentinel-2 Near Real Time** (e.g. `s2a_nrt_granule`): These products are processed with best-available ancillary information and provided as a rolling 90 day archive of imagery which is typically available to load within approximately ~24 hours of a satellite overpass.\n", + "\n", + "Both Sentinel-2 Definitive and Sentinel-2 Near Real Time products contain data processed to two surface reflectance corrections, however only NBART data is available on the DEA Sandbox:\n", + "\n", + "1. **NBAR** (e.g. `nbar_green`): Radiance data collected by Sentinel-2 can be affected by atmospheric conditions, sun position, sensor view angle, surface slope and surface aspect. \n", + "These need to be reduced or removed to ensure the data can be compared consistently over time and space to identify and quantify environmental change.\n", + "NBAR data (i.e. measurements with the `nbar_` prefix above) takes Sentinel-2 imagery captured over the Australian continent and corrects inconsistencies using Nadir corrected Bi-directional reflectance distribution function Adjusted Reflectance (NBAR).\n", + "\n", + "> **Note:** NBAR data is currently only available in the [NCI environment](https://docs.dea.ga.gov.au/setup/NCI/README.html), not the [DEA Sandbox environment](https://docs.dea.ga.gov.au/setup/sandbox.html).\n", + "\n", + "2. **NBART** (e.g. `nbart_green`): NBART data (i.e. measurements with the `nbart_` prefix) are also processed using NBAR, but have an additional terrain illumination correction applied using a Digital Surface Model (DSM) to correct for varying terrain. NBART is typically the default choice for most analyses as removing terrain illumination and shadows allows changes in the landscape to be compared more consistently across time.\n" + ] + }, + { + "cell_type": "markdown", + "id": "5cacca1b", + "metadata": { + "papermill": { + "duration": 0.067781, + "end_time": "2022-01-13T14:56:44.823430", + "exception": false, + "start_time": "2022-01-13T14:56:44.755649", + "status": "completed" + }, + "tags": [] + }, + "source": [ + "Sentinel-2 surface reflectance products have 13 spectral channels:\n", + "\n", + "| Sentinel-2 bands | DEA band name | Band number | Central wavelength (nm) | Resolution (m) | Bandwidth (nm) |\n", + "| -----------------|---------------|-------------|-------------------------|----------------|----------------|\n", + "| Coastal aerosol | `nbar(t)_coastal_aerosol` | 1 | 443 | 60 | 20 |\n", + "| Blue | `nbar(t)_blue` | 2 | 490 | 10 | 65 |\n", + "| Green | `nbar(t)_green` | 3 | 560 | 10 | 35 |\n", + "| Red | `nbar(t)_red` | 4 | 665 | 10 | 30 |\n", + "| Vegetation red edge | `nbar(t)_red_edge_1` | 5 | 705 | 20 | 15 |\n", + "| Vegetation red edge | `nbar(t)_red_edge_2` | 6 | 740 | 20 | 15 |\n", + "| Vegetation red edge | `nbar(t)_red_edge_3` | 7 | 783 | 20 | 20 |\n", + "| NIR | `nbar(t)_nir_1` | 8 | 842 | 10 | 115 |\n", + "| Narrow NIR | `nbar(t)_nir_2` | 8A | 865 | 20 | 20 |\n", + "| Water vapour | N/A | 9 | 945 | 60 | 20 |\n", + "| SWIR - Cirrus | N/A | 10 | 1375 | 60 | 20 |\n", + "| SWIR | `nbar(t)_swir_2` | 11 | 1610 | 20 | 90 |\n", + "| SWIR | `nbar(t)_swir_3` | 12 | 2190 | 20 | 180 |\n", + "\n", + "These bands cover the visible, near-infrared and short-wave infrared wave lengths.\n", + "\n", + "!['Sentinel-2 spectral bands'](http://www.geosage.com/highview/figures/Sentinel2_Spectral_Bands.jpg)\n", + " \n", + "> **Note**: There are a number of additional datasets that are also returned as part of Sentinel-2 queries.\n", + "These are a combination of datasets used in the correction process, and layers relating to pixel quality." + ] + }, + { + "cell_type": "markdown", + "id": "503f2a9e", + "metadata": { + "papermill": { + "duration": 0.059172, + "end_time": "2022-01-13T14:56:44.941529", + "exception": false, + "start_time": "2022-01-13T14:56:44.882357", + "status": "completed" + }, + "tags": [] + }, + "source": [ + "## Description\n", + "\n", + "This notebook will run through loading in Sentinel-2A and Sentinel-2B satellite images.\n", + "Topics covered include:\n", + "\n", + "* Using the native `dc.load()` function to load in Sentinel-2 Definitive data from a single Sentinel-2 satellite\n", + "* Using the `load_ard()` wrapper function to load in a concatenated, sorted, and cloud masked time series from both Sentinel-2A and 2B\n", + "* Loading the latest available Sentinel-2 imagery from the Sentinel-2 Near Real Time products\n", + "\n", + "***" + ] + }, + { + "cell_type": "markdown", + "id": "6e55e4cf", + "metadata": { + "papermill": { + "duration": 0.058649, + "end_time": "2022-01-13T14:56:45.059313", + "exception": false, + "start_time": "2022-01-13T14:56:45.000664", + "status": "completed" + }, + "tags": [] + }, + "source": [ + "## Getting started\n", + "\n", + "To run this analysis, run all the cells in the notebook, starting with the \"Load packages\" cell." + ] + }, + { + "cell_type": "markdown", + "id": "21162f2c", + "metadata": { + "papermill": { + "duration": 0.059981, + "end_time": "2022-01-13T14:56:45.180557", + "exception": false, + "start_time": "2022-01-13T14:56:45.120576", + "status": "completed" + }, + "tags": [] + }, + "source": [ + "### Load packages" + ] + }, + { + "cell_type": "markdown", + "id": "9163886f", + "metadata": { + "tags": [ + "papermill-error-cell-tag" + ] + }, + "source": [ + "Execution using papermill encountered an exception here and stopped:" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "fc8c399f", + "metadata": { + "execution": { + "iopub.execute_input": "2022-01-13T14:56:45.306918Z", + "iopub.status.busy": "2022-01-13T14:56:45.306161Z", + "iopub.status.idle": "2022-01-13T14:56:45.397867Z", + "shell.execute_reply": "2022-01-13T14:56:45.385236Z" + }, + "papermill": { + "duration": 0.154588, + "end_time": "2022-01-13T14:56:45.398157", + "exception": true, + "start_time": "2022-01-13T14:56:45.243569", + "status": "failed" + }, + "tags": [] + }, + "outputs": [ + { + "ename": "ModuleNotFoundError", + "evalue": "No module named 'datacube'", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m/tmp/ipykernel_64/2856737284.py\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0;32mimport\u001b[0m \u001b[0mdatacube\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2\u001b[0m \u001b[0;32mfrom\u001b[0m \u001b[0modc\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mui\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mwith_ui_cbk\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0msys\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 5\u001b[0m \u001b[0msys\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpath\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0minsert\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'../Tools/'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;31mModuleNotFoundError\u001b[0m: No module named 'datacube'" + ] + } + ], + "source": [ + "import datacube\n", + "from odc.ui import with_ui_cbk\n", + "\n", + "import sys\n", + "sys.path.insert(1, '../Tools/')\n", + "from dea_tools.datahandling import load_ard\n", + "from dea_tools.plotting import rgb\n" + ] + }, + { + "cell_type": "markdown", + "id": "18f0d671", + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, + "source": [ + "### Connect to the datacube" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "798b67f7", + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, + "outputs": [], + "source": [ + "dc = datacube.Datacube(app=\"Sentinel_2\")" + ] + }, + { + "cell_type": "markdown", + "id": "30fc2106", + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, + "source": [ + "## Load Sentinel-2 data from the datacube\n", + "\n", + "We will load **Sentinel-2 Definitive** data from the Sentinel-2A and Sentinel-2B satellites using two methods.\n", + "Firstly, we will use [dc.load()](../Beginners_guide/04_Loading_data.ipynb) to return a time series of satellite images from a single sensor.\n", + "Secondly, we will load a time series using the [load_ard()](../Frequently_used_code/Using_load_ard.ipynb) function, which is a wrapper function around the dc.load module.\n", + "This function will load all the images from both Sentinel-2A and Sentinel-2B, combine them, and then apply a cloud mask.\n", + "The returned `xarray.Dataset` will contain analysis ready images with the cloudy and invalid pixels masked out.\n", + "\n", + "You can change any of the parameters in the `query` object below to adjust the location, time, projection, or spatial resolution of the returned datasets.\n", + "To learn more about querying, refer to the Beginner's guide notebook on [loading data](../Beginners_guide/04_Loading_data.ipynb).\n", + "\n", + "Sentinel-2 data is stored on file with a range of different coordinate reference systems or CRS (i.e. multiple UTM zones). \n", + "The different satellite bands also have different resolutions (10 m, 20 m and 60 m). \n", + "Because of this, all Sentinel-2 queries need to include the following two query parameters:\n", + "\n", + "* `output_crs`: This sets a consistent CRS that all Sentinel-2 data will be reprojected to, regardless of the UTM zone the individual image is stored in.\n", + "* `resolution`: This sets the resolution that all Sentinel-2 images will be resampled to. \n", + "\n", + "> **Note:** Be aware that setting `resolution` to the highest available resolution (i.e. `(-10, 10)`) will downsample the coarser resolution 20 m and 60 m bands, which may introduce unintended artefacts into your analysis.\n", + "It is typically best practice to set `resolution` to match the lowest resolution band being analysed. For example, if your analysis uses both 10 m and 20 m resolution bands, set `\"resolution\": (-20, 20)`." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "57b8e42e", + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, + "outputs": [], + "source": [ + "# Create a query object\n", + "query = {\n", + " \"x\": (153.45, 153.47),\n", + " \"y\": (-28.90, -28.92),\n", + " \"time\": (\"2018-01\", \"2018-02\"),\n", + " \"output_crs\": \"EPSG:3577\",\n", + " \"resolution\": (-10, 10),\n", + " \"group_by\": \"solar_day\",\n", + "}" + ] + }, + { + "cell_type": "markdown", + "id": "70968abc", + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, + "source": [ + "### Load Sentinel-2 using `dc.load()`\n", + "\n", + "The two **Sentinel-2 Definitive** products are:\n", + "\n", + "* `s2a_ard_granule`\n", + "* `s2b_ard_granule`\n", + "\n", + "Here we will load in a time-series of satellite images from only Sentinel-2A.\n", + "To load in images from Sentinel-2B, change the `product` variable to `'s2b_ard_granule'`." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "52a4a153", + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, + "outputs": [], + "source": [ + "ds = dc.load(product=\"s2a_ard_granule\",\n", + " progress_cbk=with_ui_cbk(),\n", + " **query)\n", + "\n", + "ds" + ] + }, + { + "cell_type": "markdown", + "id": "d0ea81e7", + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, + "source": [ + "The returned dataset contains all of the bands available for Sentinel-2.\n", + "These include both `NBAR` and `NBAR-T` versions of the optical bands, along with [fmask](../Frequently_used_code/Masking_data.ipynb) (used for cloud masking) and other measurements (e.g. `azimuthal_exiting`, `azimuthal_incident`) that are used for generating the surface reflectance product.\n", + "\n", + "Usually we are not interested in returning all the possible bands, but instead are only interested in a subset of these.\n", + "If we wished to return only a few of `NBAR-T` optical bands, then we would pass a `measurements` parameter to `dc.load()` (or, alternatively, amend the initial `query` object to have a `measurements` parameter). " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "c4cfb179", + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, + "outputs": [], + "source": [ + "bands = [\"nbart_blue\", \"nbart_green\", \"nbart_red\"]\n", + "\n", + "ds = dc.load(product=\"s2a_ard_granule\",\n", + " measurements=bands,\n", + " progress_cbk=with_ui_cbk(),\n", + " **query)\n", + "\n", + "ds" + ] + }, + { + "cell_type": "markdown", + "id": "ecaf384b", + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, + "source": [ + "Once the load is complete, we can then analyse or plot the Sentinel-2 data:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "7fc1b159", + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, + "outputs": [], + "source": [ + "rgb(ds, col=\"time\", col_wrap=6)" + ] + }, + { + "cell_type": "markdown", + "id": "c009c723", + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, + "source": [ + "### Load Sentinel-2 using `load_ard`\n", + "\n", + "This function will load images from both Sentinel-2A and Sentinel-2B, concatenate and sort the observations by time, and apply a cloud mask.\n", + "The result is an analysis ready dataset.\n", + "You can find more information on this function from the [Using load ard](../Frequently_used_code/Using_load_ard.ipynb) notebook." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4ebb0c83", + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, + "outputs": [], + "source": [ + "ds = load_ard(dc=dc,\n", + " products=[\"s2a_ard_granule\", \"s2b_ard_granule\"],\n", + " measurements=bands,\n", + " **query)\n", + "\n", + "ds" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "a55292cb", + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, + "outputs": [], + "source": [ + "rgb(ds, col='time', col_wrap=6)" + ] + }, + { + "cell_type": "markdown", + "id": "87bf9cda", + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, + "source": [ + "## Sentinel-2 Near Real Time\n", + "\n", + "> **Note:** Sentinel-2 Near Real Time is only currently only available to load via the [DEA Sandbox environment](https://docs.dea.ga.gov.au/setup/sandbox.html)\n", + "\n", + "The surface reflectance processing workflow for Sentinel-2 Definitive products typically causes a delay before this data is available to load through the datacube.\n", + "\n", + "To address this delay, DEA also provides a **Sentinel-2 Near Real Time** product which is available to load as early as ~24 hours after a satellite observation is made. \n", + "Near Real Time data is processed using best-available ancillary information to provide atmospheric corrections, and delivered as a rolling 90 day archive of imagery.\n", + "\n", + "The two Sentinel-2 Near Real Time products are:\n", + "\n", + "* `s2a_nrt_granule`\n", + "* `s2b_nrt_granule`\n", + "\n", + "We can load this data using either `dc.load()` or `load_ard()` using the [methods demonstrated above](#Load-Sentinel-2-data-from-the-datacube):" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "2b7968c8", + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, + "outputs": [], + "source": [ + "# Create a query object\n", + "query = {\n", + " \"x\": (153.45, 153.47),\n", + " \"y\": (-28.90, -28.92),\n", + " \"measurements\": [\"nbart_blue\", \"nbart_green\", \"nbart_red\"],\n", + " \"output_crs\": \"EPSG:3577\",\n", + " \"resolution\": (-10, 10),\n", + " \"group_by\": \"solar_day\",\n", + "}\n", + "\n", + "ds = load_ard(dc=dc,\n", + " products=[\"s2a_nrt_granule\", \"s2b_nrt_granule\"],\n", + " mask_pixel_quality=False,\n", + " **query)\n" + ] + }, + { + "cell_type": "markdown", + "id": "88eb5ffe", + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, + "source": [ + "We can now plot the most recently acquired Sentinel-2 image for our query region:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "d8266074", + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, + "outputs": [], + "source": [ + "# `index=-1` selects the final image in the dataset\n", + "rgb(ds, index=-1, size=8)" + ] + }, + { + "cell_type": "markdown", + "id": "8a090e37", + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, + "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", + "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:** September 2021\n", + "\n", + "**Compatible datacube version:** " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "bb5102cc", + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, + "outputs": [], + "source": [ + "print(datacube.__version__)" + ] + }, + { + "cell_type": "markdown", + "id": "3def0a71", + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "tags": [] + }, + "source": [ + "## Tags\n", + "Browse all available tags on the DEA User Guide's [Tags Index](https://docs.dea.ga.gov.au/genindex.html)" + ] + }, + { + "cell_type": "raw", + "id": "28a9355d", + "metadata": { + "papermill": { + "duration": null, + "end_time": null, + "exception": null, + "start_time": null, + "status": "pending" + }, + "raw_mimetype": "text/restructuredtext", + "tags": [] + }, + "source": [ + "**Tags**: :index:`NCI compatible`, :index:`sandbox compatible`, :index:`sentinel 2`, :index:`load_ard`, :index:`rgb`, :index:`near real time`, :index:`dea datasets`" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "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.12" + }, + "papermill": { + "default_parameters": {}, + "duration": 2.92255, + "end_time": "2022-01-13T14:56:45.673076", + "environment_variables": {}, + "exception": true, + "input_path": "/tmp/tmp_32oc9uv", + "output_path": "/tmp/notebook_output.ipynb", + "parameters": {}, + "start_time": "2022-01-13T14:56:42.750526", + "version": "2.3.3" + }, + "properties": { + "authors": [ + { + "id": "41048cd6-9abc-463b-aa1e-2bafbe725b36", + "name": "Demelezi.Florent@phd.uni-mate.hu" + } + ], + "description": "This is a sample for jupyter ntoebook", + "id": "c004919f-9d6c-4f80-a796-243d216f4fd7", + "license": null, + "name": "Flo_test", + "requirements": [ + "eurodatacube-geodb", + "eurodatacube", + "eurodatacube-xcube-gen" + ], + "tags": [ + "Sentinel Data" + ], + "tosAgree": true, + "type": "Jupyter Notebook", + "version": "0.0.1" + }, + "widgets": { + "application/vnd.jupyter.widget-state+json": { + "state": {}, + "version_major": 2, + "version_minor": 0 + } + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} \ No newline at end of file