# General advice (delete this cell before submitting for review)¶

• When choosing a location for your analysis, select an area that has data on both the NCI and DEA Sandbox to allow your code to be run on both environments. For example, you can check this for Landsat using the DEA Explorer (use the drop-down menu to view all products). As of September 2019, the DEA Sandbox has a single year of continental Landsat data for 2015-16, and the full 1987-onward time-series for three locations (Perth WA, Brisbane QLD, and western NSW).

• When adding Products used, embed the hyperlink to that specific product on the DEA Explorer using the [product_name](product url) syntax.

• When writing in Markdown cells, start each sentence on a new line. This makes it easy to see changes through git commits.

• Use Australian English in markdown cells and code comments.

• Check the known issues for formatting regarding the conversion of notebooks to DEA docs using Sphinx. Things to be aware of:

• Sphinx is highly sensitive to bulleted lists:

• Ensure that there is an empty line between any preceding text and the list

• Only use the * bullet (- is not recognised)

• Sublists must be indented by 4 spaces

• Two kinds of formatting cannot be used simultaneously:

• Hyperlinked code: [code_format](hyperlink) fails

• Bolded code: **code_format** fails

• Headers must appear in heirachical order (#, ##, ###, ####) and there can only be one title (#).

• Use the PEP8 standard 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.

• For additional guidance, refer to the style conventions and layouts in approved develop branch notebooks. Examples include

• Real_world_examples/Coastal_erosion.ipynb

• Scripts/dea_datahandling.py

• The DEA Image placed in the title cell will display as long as the notebook is contained in one of the standard directories. It does not work in the highest level directory (hence why it doesn’t display in the original template notebook).

• In the final notebook cell, include a set of relevant tags which are used to build the DEA User Guide’s Tag Index. 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. Ensure the tags cell below is in Raw format, rather than Markdown or Code.

## Descriptive title that follows notebook filename¶

• Compatability: Notebook currently compatible with the NCI|DEA Sandbox environment only

• Products used: s2a_ard_granule, s2b_ard_granule, ga_ls5t_ard_3, ga_ls7e_ard_3, ga_ls8c_ard_3

• Special requirements: An optional description of any special requirements, e.g. If running on the NCI, ensure that module load otps is run prior to launching this notebook

• Prerequisites: An optional list of any notebooks that should be run or content that should be understood prior to launching this notebook

### Background¶

An optional overview of the scientific, economic or environmental management issue or challenge being addressed by Digital Earth Australia. For Beginners_Guide or Frequently_Used_Code notebooks, this may include information about why the particular technique or approach is useful or required. If you need to cite a scientific paper or link to a website, use a persistent DOI link if possible and link in-text (e.g. Dhu et al. 2017).

### Description¶

A compulsory description of the notebook, including a brief overview of how Digital Earth Australia helps to address the problem set out above. It can be good to include a run-down of the tools/methods that will be demonstrated in the notebook:

1. First we do this

2. Then we do this

3. Finally we do this

### Getting started¶

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.

Import Python packages that are used for the analysis.

Use standard import commands; some are shown below. Begin with any iPython magic commands, followed by standard Python packages, then any additional functionality you need from the Scripts directory.

[ ]:

%matplotlib inline

import datacube
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import sys
import xarray as xr

sys.path.append('../Scripts')
from dea_plotting import rgb



# Connect to the datacube¶

Connect to the datacube so we can access DEA data. The app parameter is a unique name for the analysis which is based on the notebook file name.

[ ]:

dc = datacube.Datacube(app='DEA_notebooks_template')


# Analysis parameters¶

An optional section to inform the user of any parameters they’ll need to configure to run the notebook:

• param_name_1: Simple description (e.g. example_value). Advice about appropriate values to choose for this parameter.

• param_name_2: Simple description (e.g. example_value). Advice about appropriate values to choose for this parameter.

[ ]:

param_name_1 = 'example_value'
param_name_2 = 'example_value'


Use headings to break up key steps/stages of the notebook.

Use markdown text for detailed, descriptive text explaining what the code below does and why it is needed.

Note: Use this markdown format (sparingly) to draw particular attention to an important point or caveat

[ ]:

# Use code comments for low-level documentation of code
a = 1


Use subheadings to break up steps within a single section.

[ ]:

# Use code comments for low-level documentation of code
b = 2


Use markdown text for detailed, descriptive text explaining what the code below does and why it is needed.

[ ]:

# Use code comments for low-level documentation of code
c = 3


Contact: If you need assistance, please post a question on the Open Data Cube Slack channel or on the GIS Stack Exchange using the open-data-cube tag (you can view previously asked questions here). If you would like to report an issue with this notebook, you can file one on Github.

[ ]:

print(datacube.__version__)