Quick Plot of Waterbody Timeseries

  • Compatability: Notebook currently compatible with the NCI environment only. You can make this notebook Sandbox compatible by pointing it to the DEA Waterbodies timeseries located in AWS.

  • Products used: None.

  • Prerequisites: This notebook explores the individual waterbody timeseries csvs contained within the DEA Waterbodies dataset. It has been designed with that very specific purpose in mind, and is not intended as a general analysis notebook.

Description

This notebook plots up an individual waterbody timeseries from DEA Waterbodies

  1. Load the required python modules

  2. Set up the directory where the timeseries data are all located

  3. Choose the waterbody to be plotted

  4. Draw a plot


Getting started

To run this analysis, run all the cells in the notebook, starting with the “Load packages” cell.

Load packages

Import Python packages that are used for the analysis.

[1]:
%matplotlib inline
import matplotlib.pyplot as plt

import pandas as pd
from pandas.plotting import register_matplotlib_converters
register_matplotlib_converters()

Analysis parameters

  • TimeseriesDir: Folder where the DEA Waterbodies timeseries are saved

  • WaterID: A string containing the ID of the waterbody to plot

[2]:
TimeseriesDir = '/g/data/r78/cek156/dea-notebooks/Scientific_workflows/DEAWaterbodies/timeseries_aus_uid/'
WaterID = 'r4f2epyvw'

Plot it!

[3]:
TimeHistory = pd.read_csv(f'{TimeseriesDir}{WaterID[:4]}/{WaterID}.csv')

TimeHistory['Observation Date'] = pd.to_datetime(TimeHistory['Observation Date'])
RemoveMissing = TimeHistory.dropna()

plt.figure(figsize = [10,8])
plt.plot(RemoveMissing['Observation Date'], RemoveMissing['Wet pixel percentage'], '-o')
plt.xlabel('Year')
plt.ylabel('Percentage full')
plt.title(f'Percentage of total surface area observed as wet for ID {WaterID}');
#plt.xlim(['01-01-2018', '01-01-2020'])
[3]:
Text(0.5, 1.0, 'Percentage of total surface area observed as wet for ID r4f2epyvw')
../../../../_images/notebooks_Scientific_workflows_DEAWaterbodies_DEAWaterbodiesToolkit_QuickPlotofWaterBodyTimeseries_8_1.png

Additional information

License: The code in this notebook is licensed under the Apache License, Version 2.0. Digital Earth Australia data is licensed under the Creative Commons by Attribution 4.0 license.

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.

Last modified: January 2020

Compatible datacube version: N/A

Tags

Browse all available tags on the DEA User Guide’s Tags Index

Tags: DEA Waterbodies